Problem passing hidden field.
Page 1 of 1
Problem passing hidden field.
i am Working on a web app called Converser (http://converser.hostei.com/), and I came with a problem were the php gave a 404 error message because it went to /chat/.php, and it couldn't find the hidden field 'handle'.Join.php:
- Code: Select all
<html>
<head>
<title>
Joining
</title>
</head>
<body bgcolor="#D7EE98">
<form action="joining.php">
<?php
$v = $_POST['chatter']
echo "<input type='hidden' name='cn' value='" . $v . "'>";
?>
Enter your handle:
<br/>
<input type="text" name="handle">
<br/>
<input type="submit" value="go!">
</form>
</center>
</body>
</html>
- Code: Select all
<?php session_start();?>
<html>
<head>
<title>
.
</title>
</head>
<body>
<?php
$chat = $_POST['cn'];
$_SESSION[name] = $_POST['handle'];
Header("Location: http://converser.hostei.com/chat/" . $chat . ".php");
?>
</body>
</html>
Re: Problem passing hidden field.
you are getting handel by $_POST super globaland you did not mentioned in form starting tag by which method you are submiting the form
i.e
- Code: Select all
<form action="joining.php">
is should be changed to
<form action="joining.php" method="post">
after this change it should work properly.
XainPro
Re: Problem passing hidden field.
Check please if the problem is hereHeader("Location: http://converser.hostei.com/chat/" . $chat
Try to change it to:
Header("Location: http://converser.hostei.com/chat//" . $chat
regards
Mario
--
zaproszenia ślubne
Re: Problem passing hidden field.
i am beginner as well but i mean to say the solution i have provided i think was correct :) 2nd solution provided by aris is i don't think the correct 1 :)Last edited by XainPro on Thu Apr 19, 2012 12:37 pm, edited 1 time in total.
Re: Problem passing hidden field.
thanks and you are welcome :)Page 1 of 1