URL .php?xx=yy question, need help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
heycci
Forum Newbie
Posts: 2
Joined: Wed Dec 16, 2009 1:46 pm

URL .php?xx=yy question, need help!

Post by heycci »

Hi,

I'm having problems implementing php at the end of a URL. The code works perfectly on an other site
using PHP 5.2.11, but on an other site using PHP 5.2.9 the code suddenly stops working. Is there
any way the problem could be fixed?

Thank you for your time!

Code: Select all

 
print "<div style='padding-top:10px;'><a href='" .$_SERVER['PHP_SELF']. "?mode=add'>Add info</a></div>"; }
 
 
if ($mode=="add") {
print "
CREATES A HTML TABLE WITH A SUBMIT FORM
";
}
 
heycci
Forum Newbie
Posts: 2
Joined: Wed Dec 16, 2009 1:46 pm

Re: URL .php?xx=yy question, need help!

Post by heycci »

Ha, figured this one out myself. Had been wrestling with this problem for hours, and the answer was simpler than I thought:
I used the $_GET function!

Code: Select all

 
 print "<div style='padding-top:10px;'><a href='" .$_SERVER['PHP_SELF']. "?mode=add'>Add info</a></div>"; }
  
$mode = $_GET['mode'];
 
 if ($mode=="add") {
 print "
 CREATES A HTML TABLE WITH A SUBMIT FORM
 ";
 }
 
Thank you anyway!
Post Reply