Why are you using "global $continue". It's not being bused for anything in this function.
You know, just in case.... Honestly, I don't know why that's there, considering a $continue variable isn't used in the entire site....
I've modified the cleanup_input function as sugguested but still get an error:
PHP Code:
I've Failed You For The Last Time:
# Script Name: /RVM/registration/register2.php
# Include File: /home/rahl/public_html/RVM/include/functions.php
# errorno=1064
# error=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
# query= 1
if(empty($error))
{
$query = mysql_query("UPDATE Users SET title='$title',last_name='$l_name',first_name='$f_name',zip='$zip' WHERE handle='$user_name'")
or die(mysql_error());
safe_query($query);
I don't understand what is going on here. Anyway I was right about a boolean. It is an UPDATE query and mysql_query is returning true. Then for some reason you are running that boolean as if it were another query. Also what is the point having that function if you never use the return value for anything.
Thanks guys! That fixed the query problem. It now reads:
PHP Code:
UPDATE Users SET title='Ms.',last_name='dsfad',first_name='dfasf',zip='23456' WHERE handle=''
It doesn't seem to be passing the user name from page one correctly though.
When I type the user name in registration1.php and it fowards to the next page, it shows up in the header as "....php?user_name=doofus", and I can get it using HTTP_GET_VARS[] and display it back to the user, (as in "Thank you, Doofus for completing page one!") but once the submit button is pressed on the second page, it seems to 'forget' the username. Maybe it needs to be put into a hidden form field?
Also, I'm wondering if there's not a more secure way to do this (even if it's a bit more complex). My fear is that a malicious user could change the "?user_name=john" line, and use the second registration page to change people's information. (since the record is modified based on the posted username)
How else would it work? Session variables or cookies?
I've switched to session variables to handle all of the passing of information from one page to another, and I have *most* everything working.
I'm having trouble with my email confirmation page now, and I can't figure out why. It changes the database corectly, but it isn't printing the error or confirmation method.
I've been working on it for a couple hours now and I can get the message to print under the table, but not inside it!
This is the confirmation page:
PHP Code:
<?PHP
session_start( );
$location_ID ="RVM Email Confirmation"; // Set the location variable
// Include the registration forms functions page
Require('../registration/registration_forms.php');
// Include Database connection information
Require('../include/SQL_connect.php');
// Include the shared registration functions
Require('../include/functions.php');
// get the confirmation code
$code = $HTTP_GET_VARS["confirmation_code"];
function check_confirmation_code($code)
{
$query = "SELECT * FROM Users WHERE confirmation_code = '$code'";
$result = safe_query($query);
if (mysql_num_rows($result) > 1)
{
$return_message = "AAAAAAAAHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!<br/> Something has gone teribly wrong. Please email technical support,
or <a href='../registration/dc_request.php' class='inline_link'>request a new confirmation code here</a>.";
// draw the page
registration_email_confirmation();
}
elseif (mysql_num_rows($result) < 1)
{
$return_message = "I'm sorry, but the confirmation code you have entered isn't valid.<br/>Please be sure you are using the
code provided in your confirmation email, and that you are doing so within 24 hours of receiving it.
If you need to, you may <a href='../registration/dc_request.php' class='inline_link'>request a new confirmation code here</a>.";
// draw the page
registration_email_confirmation();
$return_message = "Thank you, ".$_SESSION["title"]." ".$_SESSION["l_name"].".<br/><br/><br/>
You are now registered under the username: ".$_SESSION["user_name"]." Using the email address: ".$_SESSION["email"]."
<br/><br/> From here, you can <a href='../interface/user_home.php' class='inline_link'>go to your homepage</a>.... more options when I acctually code somewhere to go.";
$query = "UPDATE Users SET confirmation_code='0',confirmed='1' WHERE confirmation_code='".$_SESSION["confirmation_code"]."'";
$result = safe_query($query);
// draw the page
registration_email_confirmation();
}
}
and this is the function that prints the HTML, and *should* be printing out the $return_message variable inside of it:
Bookmarks