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
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there is a way to track uploading with APC and php 5.2 + ?? any suggestions thanks
question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.I have roughly 30 files. I want to be able to edit every $_POST and $_GETCode:
array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I have a .csv file with about 300 records in it. The code worked perfect while testing on 3 or 4
How to ... (FAQs)
... get e-mail notifications
redirect standard error and assert (how to?)
How do you redirect standard error and assert?---(Why? I am creating an web app and assert does not show on the webpage. I do not think standard error does either. Not sure, but fairly certain.
Sending an SMS Message with ASP.NET
Often times it may be a requirement for your web application to send an SMS message. Such examples would be reminders, password resetting, and spam.Q: Can I have some code to send an SMS message?A:
Having Problem with Date
l have a submit buttom where user have the possibility to add a date to specify when his message should be made reachable online.I have seen a bug which l am not having a clue to solve and l need
error reporting
hey everyoneI have a production server in which I want error reporting but only on some pagesI haveini_set('display_errors', 1);ini_set('log_errors', 1);ini_set('error_log',
Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment that have 5 clients and 1 server. To do so, I need to be able to edit IP header to change it's
Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past 3-5 hours and have found nothing that'll help me.This is a project for school, and well I have to