Jump to content

Archived

This topic is now archived and is closed to further replies.

megamanhero

Using a form to make a variable

Recommended Posts

UPDATE Users SET Rank = 'Form_Variable' WHERE Rank = 'form_variable' AND User = 'Form_variable'

does anyone know how to use a form to be submitted to create a variable for the above

Share this post


Link to post
Share on other sites
well if form uses method="post" then it's $_POST['form_variable_name_here'] if it's method="get" then it's $_GET['form_variable_name_here']... what you also need to do it make an effort to stop someone SQL injecting your page so your could should be like this..

$variablename=mysql_real_escape_string($_POST['variablename']);

UPDATE Users SET Rank = 'Form_Variable' WHERE Rank = 'form_variable' AND User = '$variablename'


regards
Liam

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.