View Full Version : Passing variables from page1.htm to page1.cgi

11-21-2009, 05:44 PM

I am trying to pass my variables values from page1.htm to page1.cgi and then to page2.cgi

From page1.htm to page1.cgi there is no problem, because I do as below

$myuser = $field{myuser} ;

The problem happens when I try to pass it from page1.cgi to page2.cgi

I tried to build a form in pag1.cgi using print command, as below

print ' <INPUT type=hidden value='.$myuser.' name=myuser size="100" >';

Supposing my user is jhon francisco , it breaks the string and only jhon is shown

Is there a way to pass variables values from a page1.cgi to page2.cgi without having
to build them as hidden files of a form?

If not, is there a way from preventing them to break ?


11-21-2009, 06:22 PM
You could use server side sessions but at this point, that would be above your experience level.

You need to put quotes around the $myuser var. Rather than using the concatenation operator, do this:

print "<INPUT type=hidden value='$myuser' name='myuser' size='100' >";

11-21-2009, 08:26 PM
It works fine

Great advice