Hi all, I think this is going to be easy to resolve but for I have been looking at it to long and I cannot see my issue!
I hope this is in the right section as it uses modalbox, however I think its a php error not modalbox.
Basically I have a registration form as follows:
Code: <form action="pages/reg_do.php" id="myform" onsubmit="return false;">
<fieldset>
<legend>Register New User</legend>
<table>
<tr>
<td><label for="name"><strong>Username </strong></label></td>
<td> </td>
<td><input type="text" size="30" id="username" name="username" /></td>
</tr>
<tr>
<td><label for="password"><strong>Password </strong></label></td>
<td> </td>
<td><input type="text" size="30" id="password" name="password" /></td>
</tr>
<tr>
<td><label for="email"><strong>Email</strong></label></td>
<td> </td>
<td><input type="text" size="30" id="email" name="email" /></td>
</tr>
<tr>
<td> <label for="first_name"><strong>First Name</strong></label></td>
<td> </td>
<td><input type="text" size="30" id="first_name" name="first_name" /></td>
</tr>
<tr>
<td><label for="last_name"><strong>Last Name</strong></label></td>
<td> </td>
<td><input type="text" size="30" id="last_name" name="last_name" /></td>
</tr>
<tr>
<td><label for="city"><strong>City</strong></label></td>
<td> </td>
<td><input type="text" size="30" id="city" name="city" /></td>
</tr>
<tr>
<td><label for="state"><strong>State</strong></label></td>
<td> </td>
<td><select name="state">
<option value="WA">Western Australia</option>
<option value="SA">Southern Australia</option>
<option value="VIC">Victoria</option>
<option value="NT">Nothern Territories</option>
<option value="TAS">Tasmania</option>
<option value="QLD">Queensland</option>
</select></td>
</tr>
</table>
</fieldset>
<p><input type="submit" value="Register" onclick="Modalbox.show('pages/reg_do.php', {title: 'Registering....', width: 500, params:Form.serialize('myform') }); return false;" /> or <a href="#" title="Cancel & close dialog" onclick="Modalbox.hide(); return false;">Cancel & close</a></p>
</form>
</body>
</html>
This is opened from the main page in a modalbox popup box, once the form is submitted it goes to red_do.php, which loads in a replacement modalbox:
Code: <?php
session_start();
include '../common/dbconnect.php';
$username = $_GET['username'];
$password = $_GET['password'];
$first_name = $_GET['first_name'];
$last_name = $_GET['last_name'];
$email = $_GET['email'];
$city = $_GET['city'];
$state = $_GET['state'];
$query = 'INSERT INTO users (user_id, username, password)
VALUES ("", "$username", "$password")';
$result = mysql_query($query, $conn) or die(mysql_error());
$user_id = mysql_insert_id($conn);
$query = 'INSERT INTO users_details
(user_id, username, first_name, last_name, email, city, state)
VALUES
("$user_id","$username", "$first_name", "$last_name", "$email", "$city", "$state") ';
$result = mysql_query($query, $conn) or die(mysql_error());
$_SESSION['logged'] = 1;
$_SESSION['username'] = $username;
echo "thankyou, working";
?>
I then get the thankyou message, however instead of submitting the actual values into the database it will physically submit $username as apposed to the value of $username.
What am I missing.
As a sidenote, i understand the importance of escaping strings and this is done in the database connect file using:
Code: foreach ($_POST as $key => $value) {
$_POST[$key] = mysql_real_escape_string($value);
}
foreach ($_GET as $key => $value) {
$_GET[$key] = mysql_real_escape_string($value);
}
as I know people like pointing this out
Displaying Multidimensional Arrays...about to put my head in a vice, PLEASE HELP
I am fairly new to PHP and MySQL and I have a problem which I have been trying to resolve for days. I just can't figure it out and can't find anything on the web that is helping me work it out.I hope
Multi-image upload problems
Lets see if I can get some help on this one. Can anyone show me what I am doing wrong here. I'm just trying at this point to verify that the form inputs will work right. $max_img is set to 6. Here is
firefox wouldnt stream mp3 files completely from my php page
hi everyone,I have a php file trying to read and stream mp3 files. It works fine in IE but my problem is Firefox streams only 3 seconds of them.$direction =
output printing as hexadecmal... XD
Everything works except the calcem call for the totusold and totuprice. The out put shows up as hex. Im not positive but i think i might have to use PBV or PBR?
value not going in data base
hello friends.... i am having a working javascript....when i am selecting any designation and refresh/validation problem the form is resetting the designation value and the
PHP Code reffering to database, doing something wrong.. pls help
Well i am quite new with PHP and for school we have to make a PHP script which reffers to a Database,Well, more explicit, we have this form showing all "employees"last name etc. made it week
check_changed_data - I can't get data from the called method event
I use check_changed_data to trigger my event method.
array ...
hiCode: function formatCategories($categories, $parentId){ // $navCat stores all children categories // of $parentId $navCat = array(); // expand only the categories with the same parent id
returning data from an ssh2_exec()
here's what i got.$conn = ssh2_connect($this->_host); ssh2_auth_password($conn,$this->_user,$this->_pass)or die("Cannot Connect"); //build command line to include
Vertical Alligning - Not working in 1 cell?
<?phpecho "<table id=\"valign\" width=\"60%\" style=\"border:1px solid #EEE;\">";echo "<tr><td