Solved

PHP/MYSQL Inserting Multiple to textarea

Posted on 2009-07-02
48
492 Views
Last Modified: 2012-05-07
this A Full code about my problem

i want make Insert multi data to my textarea


exmple :

if post

http://www.experts-exchange.com/m-ezzat/
http://www.experts-exchange.com//m-ezzat1/
http://www.experts-exchange.com//m-ezzat2/
http://www.experts-exchange.com//m-ezzat3/
http://www.experts-exchange.com//m-ezzat4/

the result must be

MyDomain like domain.com

http://www.domain.com.com/1/
http://wwwdomain.com//2/
http://www.domain.com//3/
http://www.domain.com//4/
http://wwwdomain.com//5/

My idea talk about Protection links

but i want insert every url to line in database

Inserting Multiple
Step 1
 
 
 
<form action="MultiDone/" method="post">
<table width="100%" border=0>
  <tbody>
  <tr>
    <td >File link:<br />
    <textarea rows="14" name="multiurls"  class="input"  cols="59"></textarea><br /></td></tr></tbody></table></td></tr><tr><td colspan="3" 
height="1%" width="738">
<p style="TEXT-AliGN: center" align=center><input class=submit type=submit value="Protect link &amp; Make It Short!" name=send></td> 
</form>
 
 
Step2
 
 
<?php
 
include_once("./includes/config.php") ;
 
$url   = $_POST['multiurls'];
 
 
if (!isset($url)) {
	print "please full all fields";
	
}
else {
$insert = "INSERT INTO `data` (`id` ,`url`) values (NulL ,'$url')";
$query  = mysql_query($insert);
if (!$query) die(mysql_error());
}
 
$select = "SELECT `id` FROM `data` WHERE `URL` = '$url'";
$amr = mysql_query($select);
if (!$amr) die(mysql_error());
list($url2) = mysql_fetch_array($amr);
 
 
 
$select1 = "SELECT `siteurl` FROM `config`";
$amr1 = mysql_query($select1);
if (!$amr1) die(mysql_error());
list($siteurl) = mysql_fetch_array($amr1);
 
 
 
?>
 
Result
 
 
<textarea  class="input" rows="14" name="multi" cols="59"><?php echo $siteurl; ?>/<? echo $url2 ?></textarea>

Open in new window

0
Comment
Question by:M-ezzat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 28
  • 20
48 Comments
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24771355
I think can help you with this.

Are you saying that you would like to enter URLS in the TEXTAREA and then insert every URL in separate row?

Please clarify and describe what you want your form to do more clearly.

Thanks
0
 

Author Comment

by:M-ezzat
ID: 24775388
Yes

i want send more than url in textarea




and separate the Results and add each url in line to SQL
<textarea  class="input" rows="14" name="multi" cols="59">
SendUrl1
SendUrl2
SendUrl3
SendUrl4
SendUrl5
SendUrl6
SendUrl7
SendUrl8
SendUrl9
SendUrl10
</textarea>
 
<textarea  class="input" rows="14" name="multi" cols="59">
Result1
Result2
Result3
Result4
Result5
Result6
Result7
Result8
Result9
Result10
</textarea>

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24776615
How would you like the result URLs be derived?

Say I type in:

www.google.com
www.yahoo.com/somepage/
www.google.com/search/

What would the result URLs look for example?

Thanks
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:M-ezzat
ID: 24778162

look this script like TinyURL.com

but i want make multi links

You said

www.google.com
www.yahoo.com/somepage/
www.google.com/search/


I want the result

MySiteName.Com/tiny/ID1
MySiteName.Com/tiny/ID2
MySiteName.Com/tiny/ID3

that mean every site will insert to my db as line
0
 

Author Comment

by:M-ezzat
ID: 24782303
Anyone can help?
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782429
I can. Are you saying that in this example:

Input:
www.google.com
www.yahoo.com/somepage/
www.google.com/search/


Output:

tblURL
ID    Real URL
==================================
1     www.google.com
2     www.yahoo.com/somepage/
3     www.google.com/search/

So that when someone goes to:

http://MySiteName.com/tiny/ID1

they are redirected to www.google.com?

Thanks
0
 

Author Comment

by:M-ezzat
ID: 24782443
when someone goes to:

http://MySiteName.com/tiny/ID1

Will redirected to My second page to tell him
wait 5 sc then the vistor will click to go to www.google.com?


example:

4share-forex.us/1
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782480
You would have to have apache and rewrite ON and create a .htmaccesss file in the public directory...

You would then need a processing page such as tiny.php - which would access the database entry for matched ID (such as 1) from the query string (corresponds to www.google.com in the above example) and outputs the result as a link or a redirect.

Hope this helps.

=NerdsOfTech

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^tiny/ID([0-9]+)/$ /tiny.php?id=$1 [L]

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782482
I mean .htmaccess
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782485
I am available for hire if you need this job done for you as this is a multi-step process.

=NerdsOfTech
0
 

Author Comment

by:M-ezzat
ID: 24782493
i'm already done this step i talk about Multi insert

Like

http://lenkawy.com/index.php5?op=large

Or

http://www.any-services.com/demo/short/multi.php


in form write any url like that

http://www.google.com
http://www.google.co.uk
http://www.google.us
http://www.googles.com

And click Go Or Protect Links

Will see the result

that what i mean
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782571
Okay. Post your database table you want the information to go into
0
 

Author Comment

by:M-ezzat
ID: 24782603
i'll post the the script

http://www.4share-forex.us/url.zip

all files + db

what i need in multi.php and MultiDone.php


NerdsOfTech Thanks for ur help
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782803
backup and replace:
MultiDone

:
<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1 ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here
$url =  $_POST['multiurls'];
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= (NULL ,'$value')";
 }
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT MAX(id) FROM `data` WHERE `URL` IN ()";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
list($url2)=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
list($siteurl) =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link: 
	<input size="40" onclick="highlight(this);" name="link" value="<?php echo $siteurl; ?>/<? echo $url2 ?>">
      <br />
      <br />
      <a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
	<a href="<? echo $url2 ?>">Test your link</a>
      
      <br /></td>
    </tr></tbody></table></td></tr><tr><td colspan="3" 
height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
 
</td> 
&nbsp;</p></div>
	</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782804
Oops wait don't use that. Be right back with correct code
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782812
Fixed.

<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1 ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here
$url =  $_POST['multiurls'];
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT MAX(id) FROM `data` WHERE `URL` IN ()";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
list($url2)=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
list($siteurl) =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link: 
	<input size="40" onclick="highlight(this);" name="link" value="<?php echo $siteurl; ?>/<? echo $url2 ?>">
      <br />
      <br />
      <a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
	<a href="<? echo $url2 ?>">Test your link</a>
      
      <br /></td>
    </tr></tbody></table></td></tr><tr><td colspan="3" 
height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
 
</td> 
&nbsp;</p></div>
	</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782829
That should fixed the insert and select functionality. However I think you should output the links in a similar way with foreach.

=NerdsOfTech
0
 

Author Comment

by:M-ezzat
ID: 24782839
Errors And Please Protection the Process

please full all fields

Warning: Invalid argument supplied for foreach() in G:\AppServ\www\url\MultiDone.php on line 57
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24782926
Fix error in SELECT.

Test #2
<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1 ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here
$url =  $_POST['multiurls'];
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT MAX(id) FROM `data` WHERE `URL` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
list($url2)=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
list($siteurl) =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link: 
	<input size="40" onclick="highlight(this);" name="link" value="<?php echo $siteurl; ?>/<? echo $url2 ?>">
      <br />
      <br />
      <a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
	<a href="<? echo $url2 ?>">Test your link</a>
      
      <br /></td>
    </tr></tbody></table></td></tr><tr><td colspan="3" 
height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
 
</td> 
&nbsp;</p></div>
	</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 

Author Comment

by:M-ezzat
ID: 24782948
Yes it's working now no errors

but the result get 1 query but i put many sites in text area

what about

Result
 
How get the protected link every line like

http://www.any-services.com/demo/short/multi.php
<textarea  class="input" rows="14" name="multi" cols="59"><?php echo $siteurl; ?>/<? echo $url2 ?></textarea>

Open in new window

0
 
LVL 19

Accepted Solution

by:
NerdsOfTech earned 500 total points
ID: 24782967
Nice.

As I mentioned before your output needs to be changed to output an "array" of URLS instead of just one.

I would use foreach to loop through the URLS.

Anyways, I added SQL-INJECTION protection to your input as you where wide open to attackers before.

=NerdsOfTech







<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1 ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here = DONE
$url =  mysql_real_escape_string($_POST['multiurls']);
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT MAX(id) FROM `data` WHERE `URL` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
list($url2)=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
list($siteurl) =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link: 
	<input size="40" onclick="highlight(this);" name="link" value="<?php echo $siteurl; ?>/<? echo $url2 ?>">
      <br />
      <br />
      <a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
	<a href="<? echo $url2 ?>">Test your link</a>
      
      <br /></td>
    </tr></tbody></table></td></tr><tr><td colspan="3" 
height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
 
</td> 
&nbsp;</p></div>
	</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 
LVL 19

Assisted Solution

by:NerdsOfTech
NerdsOfTech earned 500 total points
ID: 24783002
Test #3
<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1 ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here = DONE
$url =  mysql_real_escape_string($_POST['multiurls']);
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT MAX(id) FROM `data` WHERE `URL` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
$url2=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
list($siteurl) =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link:
 
      <input size="40" onclick="highlight(this);" name="link" value="<?php echo $siteurl; ?>">
      <br />
      <br />
      <a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
 
<br/>
Test your link(s):
<br/>
<br/>
<?php
 foreach ($url2 as $value){
?> 
	<a href="<? echo $value ?>">$value</a>
<?php
 }
?>      
      <br /></td>
    </tr></tbody></table></td></tr><tr><td colspan="3" 
height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
 
</td> 
&nbsp;</p></div>
	</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 

Author Comment

by:M-ezzat
ID: 24783162
Not working yet.

when send the values from multi.php
manysites like that

http://localhost/link.php
http://localhost/link2.php
http://localhost/link3.php

to multidone.php

as the same values

like that

<a href="61">$value</a>
 
<a href="61">$value</a>

0
 

Author Comment

by:M-ezzat
ID: 24783833
Not working cuz

when i'm add

http://localhost/url/multi.php
http://localhost/url/multi.php
http://localhost/url/multi.php
http://localhost/url/multi.php

the query add all like in 1 line in data table

not like what i want

i want every insert every site to db

id 1 http://localhost/url/multi.php
id 2 http://localhost/url/multi.php
id 3 http://localhost/url/multi.php
id 4 http://localhost/url/multi.php

and i tryed new func

<textarea rows="14" name="multiurls"  class="input"  cols="59">
<?php foreach ($url2 as $value)
{
?>
<? echo nl2br($value); ?><?php }?>
</textarea>
<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1 ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here = DONE
$url =  mysql_real_escape_string($_POST['multiurls']);
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT id FROM `data` WHERE `url` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
$url2=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
list($siteurl) =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link:
		
      <input size="40" onclick="highlight(this);" name="link" value="">
      <br />
      <br />
      <a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
 
<br/>
Test your link(s):
<br/>
<br/>
<textarea rows="14" name="multiurls"  class="input"  cols="59">
<?php foreach ($url2 as $value)
{
?> 
<? echo nl2br($value); ?><?php }?>
</textarea>     
      <br /></td>
    </tr></tbody></table></td></tr><tr><td colspan="3" 
height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
 
</td> 
&nbsp;</p></div>
	</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24791116
what were the results from your alteration?
0
 

Author Comment

by:M-ezzat
ID: 24791412
Now url multidone.php add every site in line to db but

the result

Not correct

Go to this page

http://www.4share-forex.us/url/multi.php

and copy all sites and past it in the form

http://localhost/url/multi.php
http://localhost/url/multi.php
http://localhost/url/multi.php
http://localhost/url/multi.php



you will understand what i say

and i want send you private data to my site to see everything

0
 

Author Comment

by:M-ezzat
ID: 24791591
I think the problem here

$amr=new mysqlQueryClass();
$select = "SELECT MAX(id) FROM `data` WHERE `URL` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";


becuase this query get Max id in data only

not all values
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24792119
Thanks!
$amr=new mysqlQueryClass();
$select = "SELECT id FROM `data` WHERE `URL` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24792154
Never mind, I didn't see MAX anywhere?

I fixed the problem I think on the one we were working on:
<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1 ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here = DONE
$url =  mysql_real_escape_string($_POST['multiurls']);
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT id FROM `data` WHERE `url` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
$url2=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
$siteurl =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link:
 
<?php 
 foreach ($url2 as $value)
 {
?>	
 <input size="40" onclick="highlight(this);" name="link" value="$value"> 
 <a href="value">Test Link</a>
 <br />
<?php
 }
?>
 
<a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<br /> 
</td>
</tr></tbody></table></td></tr>
<tr><td colspan="3" height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
</td> 
&nbsp;</p></div>
</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24792160
typo

use this instead:
<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1 ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here = DONE
$url =  mysql_real_escape_string($_POST['multiurls']);
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT id FROM `data` WHERE `url` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
$url2=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
$siteurl =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link:
 
<?php 
 foreach ($url2 as $value)
 {
?>	
 <input size="40" onclick="highlight(this);" name="link" value="<?php echo $value ?>"> 
 <a href="<?php echo $value ?>">Test Link</a>
 <br />
<?php
 }
?>
 
<a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<br /> 
</td>
</tr></tbody></table></td></tr>
<tr><td colspan="3" height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
</td> 
&nbsp;</p></div>
</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24792165
Typo #2 fixed use this instead:
<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1; ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here = DONE
$url =  mysql_real_escape_string($_POST['multiurls']);
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT id FROM `data` WHERE `url` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
$amr->mysqlQuery($select);
$url2=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
$siteurl =$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename; ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link:
 
<?php 
 foreach ($url2 as $value)
 {
?>	
 <input size="40" onclick="highlight(this);" name="link" value="<?php echo $value; ?>"> 
 <a href="<?php echo $value; ?>">Test Link</a>
 <br />
<?php
 }
?>
 
<a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<br /> 
</td>
</tr></tbody></table></td></tr>
<tr><td colspan="3" height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
</td> 
&nbsp;</p></div>
</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 

Author Comment

by:M-ezzat
ID: 24792385
same problem

http://4share-forex.us/url/multi.php

the script given me same id in result

check the site
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24792435
Test, upload, and link
<?php
include_once("./includes/Global.php");
?>
 
<!DOCTYpE HTML pUBliC "-//W3C//Dtd hTML 4.01 transitional//EN" "http://www.w3c.org/tr/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<TITLE><? echo _SITE_TITLE_;?></TITLE>
<meta http-equiv=content-type content="text/html; charset=iso-8859-1">
<meta content="<? echo _KEYWORKDS_;?>" name=keywords>
<meta content="<? echo _DESCRIPTION_;?>" name=description>
<link href="<? echo _SITE_URL_;?>/style/default.css" type=text/css rel=stylesheet>
 
<script type="text/javascript">
 
function highlight(field)
{
        field.focus();
        field.select();
}
</script>
</head>
 
<body>
<? echo $Notices1; ?>
 
<?php
 
include_once("./includes/Global.php");
//$array = array();
 
 
//// I reccomend you do some anti-sql-injection code here = DONE
$url =  mysql_real_escape_string($_POST['multiurls']);
 
 
 
if (!isset($url))
{
	print "please full all fields";
}
else
{
 $aurl = explode("\n", $url);
 $insert= new mysqlQueryClass();
 $insert = "INSERT INTO `data` (`id`, `url`) values ";
 foreach ($aurl as $value){
  $insert .= "(NULL ,'$value'),";
 }
 $insert = rtrim($insert, ",");
 $mysqlQuery->mysqlQueryUpdate($insert);
 if (!$mysqlQuery) die(mysql_error());
}
 
$amr=new mysqlQueryClass();
$select = "SELECT `id` FROM `data` WHERE `url` IN (";
foreach ($aurl as $value){
 $select .= "'$value',";
}
$select = rtrim($select, ","); // remove last comma in list
$select .= ");";
 
////DEBUG select
echo $select; 
 
$amr->mysqlQuery($select);
$url2=$amr->result;
 
$amr1=new mysqlQueryClass();
$select1 = "SELECT `siteurl` FROM `config`";
$amr1->mysqlQuery($select1);
list($siteurl)=$amr1->result;
 
?>
 
<div id=outer>
<div id=inner>
<div id=header>
<h1><? echo $sitename; ?></h1>
			<h2>Sharing is just getting better!</h2></div>
<div id=menu>
<ul>
  <li class=first><a href="<? echo _SITE_URL_;?>/">home</a>
  <li><a href="<? echo _SITE_URL_;?>/Upload/">Upload</a>
  <li><a href="<? echo _SITE_URL_;?>/">protect</a>
  <li><a href="<? echo _SITE_URL_;?>/Tos/">Tos</a>
  <li><a href="<? echo _SITE_URL_;?>/ContactUs/">Contact us</a>
  </ul>
  </div>
<div id=primarycontent><!-- primary content start -->
<div class=post>
<div class=header>
<H3>Get Short &amp; protected link for your big files links:</H3></div>
<div class=content>
<table width="100%" border=0>
  <tbody>
  <tr>
    <td align=middle>
	<div id="outer0">
		<div id="inner0">
			<div id="primarycontent0">
				<div class="post">
					<div class="content">
						<p align="center"><b><font color="#006600">Your File was 
						successfully added :</font></b></div>
				</div>
			</div>
		</div>
	</div>
	<p>link:
 
<?php 
 foreach ($url2 as $value)
 {
?>	
 <input size="40" onclick="highlight(this);" name="link" value="<?php echo $siteurl . '\' . $value; ?>"> 
 <a href="<?php echo $siteurl . '\' . $value; ?>">Test Link</a>
 <br />
<?php
 }
?>
 
<a href="/index.php">protect another link</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<br /> 
</td>
</tr></tbody></table></td></tr>
<tr><td colspan="3" height="12%" width="738"></td></tr><tr><td colspan="3" height="0%" width="738">
<p style="text-align: center" align=center>
</td> 
&nbsp;</p></div>
</div></div>
<? echo $Footer; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24792438
Also, output the debug for the select query I put in the code... thanks.
0
 

Author Comment

by:M-ezzat
ID: 24792464
Error when use mysql_real_escape_string

when remove all errors is gone


but the same error

http://www.4share-forex.us/url/24
http://www.4share-forex.us/url/24
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24792606
use code in #24792435

upload and post message.

I want to see the select SQL be printed out
0
 

Author Comment

by:M-ezzat
ID: 24792615
oki

Go to

http://4share-forex.us/url/multi.php

And wirte many sites and you will see the result
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24796303
yeah the select SQL looks perfect. However I think you need to add some sort of tranasction reference to the table so the select doesn't pickup other's URL entries that are similar.
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24796313
However, there are some problems in your processing gateway page you need to fix.

=NerdsOfTech
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24796318
Please post the structure of your tables here.

Thanks!
0
 

Author Comment

by:M-ezzat
ID: 24799727
DROP TABLE IF EXISTS `admins`;
CREATE TABLE IF NOT EXISTS `admins` (
  `Admin_ID` int(11) NOT NULL auto_increment,
  `Admin_UserName` varchar(255) NOT NULL default '',
  `Admin_Password` varchar(255) NOT NULL default '',
  `Admin_Level` int(11) NOT NULL default '0',
  `Admin_LastVisit` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`Admin_ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

DROP TABLE IF EXISTS `config`;
CREATE TABLE IF NOT EXISTS `config` (
  `id` int(2) NOT NULL auto_increment,
  `sitename` varchar(225) NOT NULL default '',
  `siteurl` varchar(225) NOT NULL default '',
  `adminemail` varchar(50) NOT NULL default '',
  `keywords` text NOT NULL,
  `description` text NOT NULL,
  `notes` text NOT NULL,
  `visits` int(20) NOT NULL default '0',
  `google1` text NOT NULL,
  `google2` text NOT NULL,
  `count` int(255) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

DROP TABLE IF EXISTS `data`;
CREATE TABLE IF NOT EXISTS `data` (
  `id` int(255) NOT NULL auto_increment,
  `title` varchar(255) collate latin1_general_ci NOT NULL default '',
  `url` text collate latin1_general_ci NOT NULL,
  `size` int(255) NOT NULL default '0',
  `email` varchar(255) collate latin1_general_ci NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=35 ;
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24805423
Can you give a few examples of data rows from config and data

Thanks!
0
 

Author Comment

by:M-ezzat
ID: 24812317
You can download the script and see what you want


or i can give my Cpanel to see everything :)
0
 

Author Comment

by:M-ezzat
ID: 24812328
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24815624
Thanks.

Now after the website gets the input and inserts into db

lets say for example:

CREATE TABLE `config` (
  `id` int(2) NOT NULL auto_increment,
  `sitename` varchar(225) NOT NULL default '',
  `siteurl` varchar(225) NOT NULL default '',
  `adminemail` varchar(50) NOT NULL,
  `keywords` text NOT NULL,
  `description` text NOT NULL,
  `notes` text NOT NULL,
  `visits` int(20) NOT NULL default '0',
  `google1` text NOT NULL,
  `google2` text NOT NULL,
  `count` int(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;




1, "Google", "www.google.com", "admin@google.com", etc.

Is there a particular URL you will give this entry?
Like:
http://www.4share-forex.us/url/1

?

thanks for the upload.
0
 

Author Comment

by:M-ezzat
ID: 24822655
CREATE TABLE IF NOT EXISTS `data` (
  `id` int(255) NOT NULL auto_increment,
  `title` varchar(255) collate latin1_general_ci NOT NULL default '',
  `url` text collate latin1_general_ci NOT NULL,
  `size` int(255) NOT NULL default '0',
  `email` varchar(255) collate latin1_general_ci NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ;


(1, 'MyProblem', 'http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_24541635.html', 99, 'll3okl_elgnll@yahoo.com')

this page will get the url from database and give it to me.

http://www.4share-forex.us/url/1
0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 24823231
Sorry request the mod to post an alert on this Q I wont be able to help further. Good luck.
0
 

Author Comment

by:M-ezzat
ID: 24823266
Any way you will award the points

Thanks for ur help i'll try to end what ur started it
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question