Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2009
    Posts
    70
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Passing variables from page1.htm to page1.cgi

    Hi

    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 ?


    Moises

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,869
    Thanks
    2
    Thanked 163 Times in 158 Posts
    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:
    Code:
    print "<INPUT type=hidden value='$myuser' name='myuser' size='100' >";

  • #3
    New Coder
    Join Date
    Nov 2009
    Posts
    70
    Thanks
    1
    Thanked 0 Times in 0 Posts
    It works fine

    Great advice

    Thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •