Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 15th, 2005, 3:29 PM   #1
wingz198
Newbie
 
wingz198's Avatar
 
Join Date: Sep 2005
Location: Omaha, NE
Posts: 8
Rep Power: 0 wingz198 is on a distinguished road
Sending parameters through anchor tags?

Hi,
I'm making a site with php and I'm not sure if what I'm trying to do is possible. What I have is a navigation menu with links to a php file that searches an sql table for matching parameters. Is there a way to attach the element to search for to the end of the url or another way to do that?

Not sure if I explained that correctly
wingz198 is offline   Reply With Quote
Old Sep 15th, 2005, 3:32 PM   #2
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
do you mean passing parameters in an url? You can do this as url:
somepage.php?parameter1=value&parameter2=anothervalue&parameter3 =etc

and this is how to get the parameters in somepage.php:
<?php
$param1 = $_GET['parameter1'] // $param1 contains now value
$param2 = $_GET['parameter2'] // $param2 contains now anothervalue

// the same counts for parameter3
?>
Polyphemus_ is offline   Reply With Quote
Old Sep 15th, 2005, 3:58 PM   #3
wingz198
Newbie
 
wingz198's Avatar
 
Join Date: Sep 2005
Location: Omaha, NE
Posts: 8
Rep Power: 0 wingz198 is on a distinguished road
Yeah, that's what I was looking for.
Thanks
wingz198 is offline   Reply With Quote
Old Sep 17th, 2005, 11:48 AM   #4
gandalf
Newbie
 
Join Date: Sep 2005
Posts: 1
Rep Power: 0 gandalf is on a distinguished road
If you have global variables turned on you can just call the parameter by its name.

eg somepage.php?parametername=1234

then php will automatically create a variable for the parameter

<?
echo $parametername; // this will display the value 1234 no need for $_GET
?>
gandalf is offline   Reply With Quote
Old Sep 17th, 2005, 12:00 PM   #5
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Using register_globals can lead to serious security issues.

http://us2.php.net/register_globals
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Sep 18th, 2005, 12:35 PM   #6
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Even without, if you switch to a server without global vars it can be a pain (you an turn them back on with a .htaccess file, but still like you said security issues). It's also considered sloppy code when you write it like that.

BTW, good to see another wings fan.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Sep 18th, 2005, 11:35 PM   #7
jasper_ferrer
Newbie
 
Join Date: Sep 2004
Posts: 23
Rep Power: 0 jasper_ferrer is on a distinguished road
don't forget to read about sql injection!
jasper_ferrer is offline   Reply With Quote
Old Sep 19th, 2005, 1:54 AM   #8
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 4 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
Yeah there are quite a few vunerabilities you will need to check for. Check out www.securityfocus.com it says all the vunerabilities to different software, and how to fix them/exploit them.
__________________
Join us at #programmingforums @ irc.freenode.net!

My software never has bugs. It just develops random features.
coldDeath is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:27 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC