• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[$_POST] Form values.

xFalcon

New Member
Joined
Dec 2, 2011
Messages
33
Reaction score
1
I'm having this problem with a form, I want to get values from post but I could not get it working..Here is my code:

PHP:
if(!isset($_REQUEST['action']) or ($_REQUEST['action'] != 'final')) {
	echo '<form action="?page=form&action=final" method="post" name="form">
		<table cellspacing=15 width="80%">
			<tr>
				<td>	<center><b>Select your Region:</b></center>	</td>
				<td>	<select name="reg" id="reg" onChange="alterreg();" style="width:150px">
							<option></option>
							<option value="EU">Europe</option>
							<option value="CH">China</option>
						</select></center>
				</td>				
			</tr>
		</table>
		<input type="submit" id="enter" value="Process" style="display:none;width:150px"/>
		</form>
}
else {
	if(empty($_POST['reg'])) echo 'fill reg';
	else echo $_POST['reg'];
}

I want when player select CH or EU and click on buttom 'Process' I can get the value with $_POST['reg'].. but I'm always getting 'fill reg'.. like if it was always empty >.<
 
Well first of all this code causes syntax error, just put '; after </form> and it works. I dont know how you even got that code to execute but after i fixed that error it worked fine for me and printed correctly
 
Yeah my code already had the '; i just forgot to paste it in this thread xd anyways I got it working the same day I posted it.. thanks anyways

My problem was on function alterreg(), this funtion disables 'reg' once its changed.. I did it so usr could not be able to change the value once its chosen but didnt realize that then the value could not be transfered to the final part.. xd
 
Back
Top