Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

sending varibles?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Postby Skeletor » Tue Jul 01, 2003 3:14 am

If you are defining and setting the $nc variable within your script, and want to pass it along when the form is submitted, then pass it as a hidden variable.

print('<input type="hidden" name="nc" value="'.!empty($nc) ? $nc : ''.'">');

This will create a hidden variable named "nc". It will set the value to the value of $nc as long as nc is not empty. If it is empty, it will set the value to blank.

When referring to your variable after submission, unless your global variables are set on then you have to use something like $_POST['nc'] or $_REQUEST['nc']
Skeletor
New php-forum User
New php-forum User
 
Posts: 147
Joined: Tue Nov 19, 2002 7:47 am
Location: US, Ohio

Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron