If Question!
am 21.05.2008 20:20:37 von Matthew Gonzales
Hello,
So I am trying to create a web app using some if statement logic. Right
now I am having some trouble getting a particular piece of the code to
work. (Highlighted in red below) I am trying to produce the user profile
and if the user does not have a profile a form will display asking the
user to create one. I can not get the highlighted if statement to work.
What am I doing wrong.
//Start the session
session_start();
//Include profile form file
include "profile_form.php";
include "login_form.php";
// Open a connection to the DB
$conn = mysql_connect('localhost', 'root', 'mg7448') or die(mysql_error());
mysql_select_db('newsprofs', $conn);
//Set session_id variable
$session_id = $_SESSION['user_id'];
//Check to see if the user is trying to update profile
if (isset($_GET['try']))
{
//User is trying to update profile. Make sure form is filled out
correctly
if ((!$_POST['fname']) || (!$_POST['lname']) ||
(!$_POST['company']) || (!$_POST['title']) || (!$_POST['degree']) ||
(!$_POST[
'school']))
{
//Left fields blank on the form
$msg = '
Please fill out all fields of the form!
';
//Display User profile form
$print_form = $profile_form;
}
else
{
//Form is filled out correctly. Insert into database
//Create variables for the sql string
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$company = $_POST['company'];
$title = $_POST['title'];
$degree = $_POST['degree'];
$school = $_POST['school'];
//Cerate query
$insert_profile = "insert into profiles (user_id, fname,
lname, company, title, degree, school) values ('" . $session_id .
"', '" . $fname ."', '" . $lname . "', '" . $company . "',
'" . $title . "', '" . $degree . "', '" . $school . "')" ;
$insert_results = mysql_query($insert_profile, $conn) or
die(mysql_error());
//Show success message
$msg = 'You have updated your profile
succesfully!
';
}
}
//Check to see if the user is logged in
elseif(isset($_SESSION['user_id']))
{
// User is logged in!
$query = "SELECT username FROM users WHERE id = '" . $session_id .
"' LIMIT 1";
$results = mysql_query ($query,$conn) or die(mysql_error());
//Save username
list($username) = mysql_fetch_row($results);
// Log in message
$msg= 'Welcome! '. $username . '
';
// Display User menu
$menu = '
';
//Check to see if user has a profile
$profile = "select fname, lname, company, title, degree, school from
profiles where user_id = '" . $session_id . "' ";
$profile_results = mysql_query($profile, $conn)
or die (mysql_error());
//Collect data for profile
//Find what the user_id is
while ($profile_id = mysql_fetch_array($profile_results))
{
$fname = $profile_id['fname'];
$lname = $profile_id['lname'];
$company = $profile_id['company'];
$title = $profile_id['title'];
$degree = $profile_id['degree'];
$school = $profile_id['school'];
//Add Profile to display block
$display_block = '
First Name: |
' . $fname . ' |
Last Name: |
' . $lname . ' |
Company: |
' . $company . ' |
Title: |
' . $title . ' |
Degree: |
' . $degree . ' |
School: |
' . $school . ' |
';
}
//If username is empty display error message
if (empty($username))
{
//Display error message
$msg = 'An error has occured trying to retrieve your user
profile. Please contact the webmaster. You have been logged out
to protect your data.
';
}
//If profile is not there display form to submit profile
elseif ($profile_results <= 0)
{
//Display notify message
$notify_msg = 'You have not created a profile yet! Please do
so by filling out the form below!
';
//Display User profile form
$print_form = $profile_form;
}
}
//User is not logged in display message and direct user to return to
index page
else
{
// User not logged in
$msg = 'You must be logged in to see your profile. Please return
to the to login!
';
}
//
?>
--
Matthew Gonzales
IT Professional Specialist
Enterprise Information Technology Services
University of Georgia
Email: matt323@uga.edu
Phone: (706)542-9538
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: If Question!
am 21.05.2008 21:29:45 von James Crow
Matt,
Since I am using a plain text mail reader I do not see any section
highlighted in red. I will however comment on the section I think you
are referring to. :)
This section:
if (isset($_GET['try']))
May not work correctly. If the request was something like
http://127.0.0.1/test.php?try=
then the $_GET['try'] variable will be set to NULL and the isset() will
return FALSE. If you instead check for the key existing and then the
value that would be better.
if(array_key_exists('try',$_GET) && $_GET['try'] == "blah")
Would be a more precise check on the try variable.
If I am not looking at the correct line please reply with the line that
is having the problem.
Thanks,
James
On Wed, 2008-05-21 at 14:20 -0400, Matthew Gonzales wrote:
> Hello,
>
> So I am trying to create a web app using some if statement logic. Right
> now I am having some trouble getting a particular piece of the code to
> work. (Highlighted in red below) I am trying to produce the user profile
> and if the user does not have a profile a form will display asking the
> user to create one. I can not get the highlighted if statement to work.
> What am I doing wrong.
>
>
>
> //Start the session
> session_start();
>
> //Include profile form file
> include "profile_form.php";
> include "login_form.php";
>
> // Open a connection to the DB
> $conn = mysql_connect('localhost', 'root', 'mg7448') or die(mysql_error());
> mysql_select_db('newsprofs', $conn);
>
> //Set session_id variable
> $session_id = $_SESSION['user_id'];
>
> //Check to see if the user is trying to update profile
> if (isset($_GET['try']))
> {
> //User is trying to update profile. Make sure form is filled out
> correctly
> if ((!$_POST['fname']) || (!$_POST['lname']) ||
> (!$_POST['company']) || (!$_POST['title']) || (!$_POST['degree']) ||
> (!$_POST[
> 'school']))
> {
> //Left fields blank on the form
> $msg = '
Please fill out all fields of the form!
';
>
> //Display User profile form
> $print_form = $profile_form;
>
> }
> else
> {
> //Form is filled out correctly. Insert into database
> //Create variables for the sql string
> $fname = $_POST['fname'];
> $lname = $_POST['lname'];
> $company = $_POST['company'];
> $title = $_POST['title'];
> $degree = $_POST['degree'];
> $school = $_POST['school'];
>
>
> //Cerate query
> $insert_profile = "insert into profiles (user_id, fname,
> lname, company, title, degree, school) values ('" . $session_id .
> "', '" . $fname ."', '" . $lname . "', '" . $company . "',
> '" . $title . "', '" . $degree . "', '" . $school . "')" ;
> $insert_results = mysql_query($insert_profile, $conn) or
> die(mysql_error());
>
> //Show success message
> $msg = 'You have updated your profile
> succesfully!
> ';
>
> }
> }
>
>
> //Check to see if the user is logged in
> elseif(isset($_SESSION['user_id']))
> {
>
> // User is logged in!
> $query = "SELECT username FROM users WHERE id = '" . $session_id .
> "' LIMIT 1";
> $results = mysql_query ($query,$conn) or die(mysql_error());
>
> //Save username
> list($username) = mysql_fetch_row($results);
>
> // Log in message
> $msg= 'Welcome! '. $username . '
';
>
> // Display User menu
> $menu = '
> ';
>
> //Check to see if user has a profile
> $profile = "select fname, lname, company, title, degree, school from
> profiles where user_id = '" . $session_id . "' ";
> $profile_results = mysql_query($profile, $conn)
> or die (mysql_error());
>
> //Collect data for profile
> //Find what the user_id is
> while ($profile_id = mysql_fetch_array($profile_results))
> {
> $fname = $profile_id['fname'];
> $lname = $profile_id['lname'];
> $company = $profile_id['company'];
> $title = $profile_id['title'];
> $degree = $profile_id['degree'];
> $school = $profile_id['school'];
>
> //Add Profile to display block
> $display_block = '
>
> First Name: |
> ' . $fname . ' |
>
>
> Last Name: |
> ' . $lname . ' |
>
>
> Company: |
> ' . $company . ' |
>
>
> Title: |
> ' . $title . ' |
>
>
> Degree: |
> ' . $degree . ' |
>
>
> School: |
> ' . $school . ' |
>
';
> }
>
> //If username is empty display error message
> if (empty($username))
> {
> //Display error message
> $msg = 'An error has occured trying to retrieve your user
> profile. Please contact the webmaster. You have been logged out
> to protect your data.
> ';
>
> }
>
> //If profile is not there display form to submit profile
> elseif ($profile_results <= 0)
> {
> //Display notify message
> $notify_msg = 'You have not created a profile yet! Please do
> so by filling out the form below!
';
>
> //Display User profile form
> $print_form = $profile_form;
>
> }
>
>
> }
>
> //User is not logged in display message and direct user to return to
> index page
> else
> {
>
> // User not logged in
> $msg = 'You must be logged in to see your profile. Please return
> to the to login!
';
>
>
> }
>
>
> //
>
>
> ?>
> --
> Matthew Gonzales
> IT Professional Specialist
> Enterprise Information Technology Services
> University of Georgia
> Email: matt323@uga.edu
> Phone: (706)542-9538
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: If Question!
am 21.05.2008 21:46:29 von Michael Southworth
SSBiZWxpZXZlIHRoZSBzYW1lIGlkZWEgTWF0dCBwb3N0ZWQgaXMgdHJ1ZSBm b3IgdGhpcyBsaW5l
OgoKaWYgKCghJF9QT1NUWydmbmFtZSddKSB8fCAoISRfUE9TVFsnbG5hbWUn XSkgfHwgKCEkX1BP
U1RbJ2NvbXBhbnknXSkKfHwgKCEkX1BPU1RbJ3RpdGxlJ10pIHx8ICghJF9Q T1NUWydkZWdyZWUn
XSkgfHwgKCEkX1BPU1RbCiAgICAgICdzY2hvb2wnXSkpCgpJIGFtIG91dCBv ZiByZWFjaCBvZiBh
IHBocCBwcm9jZXNzb3IsIGJ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