Question:
I am not able to pass variables between PHP scripts. what may be the reason?
VAL
2009-10-24 10:57:13 UTC
I tried to send the value of one variable to second php using - echo " $row[2]"; When clicked on the link, the address bar shows show.php?catid=4. but in show.php when i give echo "$catid";, it does not print anything. show.php works taking the value of catid as 0 or NULL. (Same thing happens when i copy and run the examples given in sites). Pls help.
Three answers:
Shariq (http://coinsindia.info)
2009-10-24 11:05:08 UTC
You have no need to pass them as query, you can use post or get method



in your seond php file you can read post or get variable as follows



$catid=$_POST["catid"];



in first file when suppose that you have a input like







Manish kumar
2009-10-24 23:49:52 UTC
set the from method attribute to 'get'...

and read variables value as :



echo $_GET['catid'];



and never user '$' before catid.



thanx.
hannigan
2016-11-30 14:48:22 UTC
Do you have get right of entry to to the two servers? if so you may encode a tcp/ip connection between them in own dwelling house page or Perl or some thing. Or probable shop them to a report and rsync it each and every so generally with a cronjob?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...