Page 1 of 1

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

Posted: Wed Dec 16, 2009 1:53 pm
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
";
}
 

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

Posted: Wed Dec 16, 2009 2:08 pm
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!