| | |
need help using links like test.php3?id=2
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2004
Posts: 3
Reputation:
Solved Threads: 0
I have been tring for a month now to figure out why I can't program my site to open field information from a link that looks like http://www.blablabla.com/test.php3?ID=2
I can't seem to figure out how to open just the field thats ID is = to 2.
If anyone can help I would be greatful. Thank you.
-Specdro
I can't seem to figure out how to open just the field thats ID is = to 2.
If anyone can help I would be greatful. Thank you.
-Specdro
•
•
•
•
Originally Posted by Specdro
I have been tring for a month now to figure out why I can't program my site to open field information from a link that looks like http://www.blablabla.com/test.php3?ID=2
I can't seem to figure out how to open just the field thats ID is = to 2.
If anyone can help I would be greatful. Thank you.
-Specdro
Ben
Application development, webhosting, and much more: www.webcentric-hosting.com
•
•
Join Date: Jul 2004
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by liliafan
How are you trying to access the data? Do you have a code example?
Ben
[php]$query = "SELECT * FROM mobsters";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
echo "<li><font face=verdana size=-2><b><a href=http://www.mafia-files.com/test2.php3?ID=$row[ID]><?$row[Name]
</td></tr><tr><td>";
}
?>[/php]
Last edited by cscgal; Jun 10th, 2006 at 11:54 pm.
From the look of the code on the next page:
Should work.
HTH
Ben
PHP Syntax (Toggle Plain Text)
<?php echo $ID; ?>
Should work.
HTH
Ben
Application development, webhosting, and much more: www.webcentric-hosting.com
What code are you actually using to fetch the ID on the next page?
Ben
Ben
Application development, webhosting, and much more: www.webcentric-hosting.com
•
•
Join Date: Jul 2004
Posts: 11
Reputation:
Solved Threads: 1
•
•
•
•
Originally Posted by huwgomez
Try this as the query on ur second page. worked for me. (Got this off Roberdin)
$query = "SELECT * FROM mobsters where ID='{$_GET['ID']}'";
Huw.
[PHP]
$pageID = $_GET['ID'];
if(is_numeric($pageID) && $pageID > 0) {
$pageID = round($pageID);
$query = "SELECT * FROM mobsters where ID='{$_GET['ID']}'";
}
else {
print("Invalid Page ID");
}
[/PHP]
•
•
Join Date: Jun 2006
Posts: 1
Reputation:
Solved Threads: 0
I think he means how to access it..You would do this:
PHP Syntax (Toggle Plain Text)
$id = $_REQUEST["id"];
![]() |
Other Threads in the PHP Forum
- Previous Thread: Please Help me
- Next Thread: You have not selected search details.
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube





