session_start();

I want to send information from one page to another by using the session_start();

Lets say that page1.php has a session that precedes the <! DOCTYPE HTML > doctype.

<? PHP

session_start();

$_SESSION ['myaccess'] = $row_mymeeting ["congremtid"];

? >

And in my body tag the following...

< body >

< a href = "page2.php" > there < /a >

< / body >

When I look at page1.php in my browser I get an error

Notice: Undefined variable: row_mymeeting in/Applications/MAMP/htdocs/phptest/www/index.php on line 5

However if I put $_SESSION ['myaccess'] = ' Hello, welcome to Adobe! " When I click on the link to the page page2.php it shows.

And on page2.php I want to echo what ever the $row_mymeeting ["congremtid"] has in my database.

A page 2 I...

<? PHP

session_start();

? >

<? PHP

echo $_SESSION ['mylink'];

? >

But I have a white.

How can I make my $_SESSION ['myaccess'] = $row_mymeeting ["congremtid"]; ECHO in my second page, that I am I missing?

Thank you.

Kind regards

AdonaiEchad

You have a recordset on the page that allows you to SELECT 'congremtid' from the database? AND is the line $_SESSION ['myaccess'] = $row_mymeeting ["congremtid"]; AFTER the sql query? If you do not have, or that the line is NOT AFTER the sql query, you will get an error message about undefined variables.

Tags: Dreamweaver

Similar Questions

  • login script error session_start() Warning

    I used the connection behavior in dreamweaver and when I run the page it gives the following error

    Warning: session_start() [Function.session - start]: Cannot send session cache limiter - already sent headers (output started at usr/users1/jonfort/public_html/think/beta/index.php:263) in/usr/users1/jonfort/public_html/think/beta/index.phpon line 474

    I looked at the error line session_start();

    the ruble is the form is in a model and used throughout the site. I placed the php in the body of the page, then it will support all of the pages and the error is pointed to the line that is locked

    If anyone has had this problem and how do you overcome

    Thanks in advance

    The problem is not with the data.  Simply the function is not defined.  DW puts usually of code like:

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION< 6)="">

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    Upward at the top of the PHP file and it is missing in your.

  • mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in

    Hello world... I use Dreamweaver CC 2015 and create the registration page. I am facing error in highest title mentioned using php and mysql server side programming. The error found in function php code was generated using the server behavior in Dreamweaver CC 2015. Here's the complete code for my

    Register.php file. Y at - there someone who can help resolve the error in my folder.

    HERE IS THE CODE:

    -----------------------

    <? php require_once('Connections/user_informaion.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysqli_real_escape_string")? mysqli_real_escape_string ($user_informaion, $theValue): mysqli_escape_string ($user_informaion, $theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }

    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "register_form")) {}

    $insertSQL = sprintf ("INSERT INTO"user"(Fname, Lname, Email, username, password, 'Timestamp') VALUES (%s %s %s, %s, %s, %s)",

    GetSQLValueString ($_POST ["firstname"], "text").

    GetSQLValueString ($_POST ['name'], "text").

    GetSQLValueString ($_POST ['email1 "],"text").

    GetSQLValueString ($_POST ['email2'], "text").

    GetSQLValueString ($_POST ['password'], "text"));

    mysqli_select_db ($user_informaion, $database_user_informaion);

    $Result1 = mysqli_query ($insertSQL, $user_informaion) or die (mysqli_error ());

    $insertGoTo = 'login.php ';

    If (isset {}

    $insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;

    $insertGoTo. = $_SERVER ['QUERY_STRING'];

    }

    header (sprintf ("location: %s", $insertGoTo));

    }

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysqli_real_escape_string")? mysqli_real_escape_string ($TheValue): mysqli_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    mysqli_select_db ($user_informaion, $database_user_informaion);

    $query_user_request = "SELECT * FROM 'user" ";

    $user_request = mysqli_query ($user_informaion, $query_user_request) or die (mysqli_error ());

    $row_user_request = mysqli_fetch_assoc ($user_request);

    $totalRows_user_request = mysqli_num_rows ($user_request);

    ? >

    <? PHP

    Validate request to connect to this site.

    If (! isset {})

    session_start();

    }

    $loginFormAction = $_SERVER ['PHP_SELF'];

    If (isset($_GET['accesscheck'])) {}

    $_SESSION ['PrevUrl'] = $_GET ['accesscheck"];

    }

    If (isset($_POST['firstname'])) {}

    $loginUsername = $_POST ["firstname"];

    $password = $_POST ["password"];

    $MM_fldUserAuthorization = "";

    $MM_redirectLoginSuccess = 'login.php ';

    $MM_redirectLoginFailed = "accessd.php";

    $MM_redirecttoReferrer = false;

    mysqli_select_db ($user_informaion, $database_user_informaion);

    $LoginRS__query = sprintf ("SELECT Fname, password AND password FROM 'user' WHERE Fname = %s is %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysqli_query ($LoginRS__query, $user_informaion) or die (mysqli_error ());

    $loginFoundUser = mysqli_num_rows ($LoginRS);

    If {($loginFoundUser)

    $loginStrGroup = "";

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}

    Declare two session variables and assign them

    $_SESSION ['MM_Username"] = $loginUsername;

    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    If (isset($_SESSION['PrevUrl']) & & false) {}

    $MM_redirectLoginSuccess = $_SESSION ["PrevUrl"];

    }

    Header ("Location:".) $MM_redirectLoginSuccess);

    }

    else {}

    Header ("Location:".) $MM_redirectLoginFailed);

    }

    }

    ? >

    <! doctype html >

    < html >

    < head >

    < meta charset = "utf-8" >

    < title > < /title > registration

    < / head >

    < body >

    Registration of < h1 > < / h1 >

    < are method = "POST" action = "<?" PHP echo $loginFormAction;? ">" name = "register_form" >

    < label > first name: < / label >

    < name of entry = "FirstName" type = "text" autofocus required = "required" >

    < label > first name: < / label >

    < name of entry = "lastname" type = "text" >

    < br / >

    < br / >

    < label > Email: < / label >

    < input name = "email1" type = "email" required = "required" >

    < label > user/E-mail name: < / label >

    < input name = "email2" type = "email" required = "required" >

    < br / >

    < br / >

    < label > password: < / label >

    < name of entry = "password" type = "password" required = "required" >

    < label > confirm password: < / label >

    < name of entry = "passwordC" type = "password" required = "required" >

    < br / >

    < br / >

    < input type = "submit" value = "Registration" >

    < / make >

    < input type = "hidden" name = "MM_insert" value = "register_form" >

    You already have an account? < a href = "login.php" > Connect < /a >

    < / body >

    < / html >

    <? PHP

    mysqli_free_result ($user_request);

    ? >

    No, this code was generated by Dreamweaver Server behavior. You used a Dreamweaver Server behavior and then just do a transaction search and replace to replace all mysql_ functions * functions of mysqli_. It won't work.

    Although improved MySQL (MySQLi) resembles the original PHP MySQL extension, it works differently. The first argument to any function mysqli_ * must be the MySQLi connection to the database. In the original MySQL extension, the connection has always been an optional argument at the end.

    If the passage of mysql_ * to mysql_ * had been so simple, Adobe would have updated the server years ago behaviors. Because everything has to be rewritten, Adobe has decided instead to leave the server behaviors. They could be rewritten at some point in the future, but there is no guarantee that they will be.

    There is no simple solution to your problem. You must learn to write your own PHP code, or you need to invest in an extension of third parties, such as those created by DMXZone or WebAssist.

    Learn how to write your own PHP code isn't difficult, but it takes time and effort. I wrote the books on PHP, and I also created a large number of PHP for lynda.com video training courses. There are many other resources out there, free and paid. Depending on what you choose, make sure that the information you are using is up-to-date. Unfortunately, there are many bad tutorials on the internet using obsolete or insecure code.

  • How to add an extra session variable to authenticate the connection

    Hello

    IM totally new to php and dreamweaver develop a web application that uses the user name and password to authenticate the connection, and works very well. My question is, how do I add an extra session variable to capture another field in the users table for example type to redirect some pages based on the value of the type?

    If you're completely new to Dreamweaver and PHP, it sounds as if you're using Dreamweaver server behaviors. Take a friendly piece of advice and stop using the server now behaviors. They have been removed from Dreamweaver CC a couple of years because they use functions that had to be stripped on the next version of PHP. This version (PHP 7) was released in November. If you rely on Dreamweaver server behaviors, you are living on borrowed time. For a person to debut, it makes no sense to learn how to use a dead technology. The server behaviors work only in PHP 5. As soon as your server is upgraded to 7 PHP, you will have to start all over again. To understand the problem, see the following page in the PHP online documentation: PHP: Introduction - manual.

    If you want Dreamweaver to generate the code for you, you will need to use (paid-for) third-party extensions, such as those created by DMXZone or WebAssist. You can also learn how to write PHP code yourself. It is not as difficult as it sounds.

    To create a variable session, just to assign a value to an element in the superglobal array $_SESSION:

    $_SESSION ["$myvariable"] = "value";

    Session variables are available only on the pages that begin with session_start().

  • Do not find data on the server of Web pages, but do developing PC localserver

    My website access data OK on my localserver, but once I download on my server online, it cannot be found. It is there because I can access it via my ISP software.

    The error I get is - the website has encountered an error during recovery http://Bega.org.UK/gateway/graveyard/public/data/view_graves_date.php . It is perhaps out of service for maintenance or configured incorrectly.

    (The rsobj code file and php php is installed in my HTML files by WebAssist Server Assistant)


    By trial and error I found (I think) that the problem is the code on my web page

    <? php require_once('.. /.. /.. /.. / Connections/Graveyard.php');? >

    <? php require_once('.. /.. /.. /.. / webassist/mysqli/rsobj.php');? >

    <? PHP

    $rsGraveyard = new WA_MySQLi_RS("rsGraveyard",$Graveyard,0);

    $rsGraveyard-> setQuery ("SELECT * FROM gravestones ORDER BY grave_funeral_yyyy DESC");

    $rsGraveyard-> execute();

    ? >

    <! doctype html >

    < html >

    < head >

    .......

    .......

    Once again, by a process of trial and error, I think the connections file graveyard.php there is an error in the path or a case issue between graveyard.php and Graveyard.php.

    The connections file is

    <? PHP

    # FileName = "WADYN_MYSQLI_CONN.htm"

    # Type = 'MYSQL '.

    # HTTP = 'true '.

    $hostname_Graveyard = "localhost";

    $database_Graveyard = "cemetery."

    $username_Graveyard = ' * ';

    $password_Graveyard = ' * ';

    @session_start ();

    $Graveyard = new mysqli ($hostname_Graveyard, $username_Graveyard, $password_Graveyard, $database_Graveyard);

    ? >


    I'd appreciate any help on this. Try to understand me he kept me entertained all weekend.

    I looked again, and that's what I found.

    My first site was based on the original David tutorial "build your first dynamic web site. I was advised by Nancy O when DW CC dropped behaviors side server using WebAssist ones. The code mentioned earlier in this thread has been inserted in the file by WebAssist server behaviors.

    I didn't like my first site so I made a cosmetic redesign, but kept the dynamic code on the site first - it worked. Still doesn't work.

    The new site has been working properly until a week or two ago but then, for some inexplicable reason, he stopped allowing me to add or edit records. Now I can view and the list of records, as described in the tutorial of David but not add or change. This problem applies to all three databases.

    Although I saw no difference in code between the old and new files (apart from the cosmetic things) I tried to copy the code of the dynamic action from the work to those inactive files but it does not work in the new files.

    So the problem must lie elsewhere. The files in the folder connections are all correct (same as the old site) and as I said I can list all of the records and discovered the complete data of the selected, both paths to the files, and the user name, passwords and the information contained in the files in the folder of connection should be OK.

    So, what's the problem? Where should I look? I'm getting pretty desperate scrap ot batch and leave. As a great need to exercise for me probably not quite a waste of learning time, but it's frustrating.

  • Dreamweaver CS5 - welcome message and restriction of access

    I've been looking for a while now and I can't seem to find the right answer. I tried many websites help but could not find the right answer.

    I'm trying to get a message of welcome ("welcome, username") to appear on the side of my test site when a user connects and when they are not connected to display the message "welcome, comments.

    I use MySQL with Xampp and my database fields are the username, password, Userlevel (admin or user), e-mail, etc.

    I also want to make when a user connects it gets rid of the navigation 'Register' and 'Login' link and adds the link "logout".

    Search this forum for "samers" and read her son.

    Here is a response that I gave her - maybe this will help you:

    So, it's done with Dreamweaver's user authentication server PHP behavior standard? If Yes, then on each page where you want the menu item to show, put this code ABOVE theTag-

    <>

    If (! isset ($_SESSION)) {}

    session_start();

    ?>

    Then in your code from menu to do this-

  • HOME
  • Who are we
  • SERVICES
  • ACCOMMODATION
  • OUTSOURCING
  • HOT OFFERS
  • CONTACT
  • The standard DW server behavior for authentication of the user sets a session variable called "MM_username" when someone authenticates successfully. You test to see if the session variable is set in the menu code and if it * is * the value, you display the link single user registered. If it is not set, the conditional test fails, and the link is not displayed.

  • Protect a Page

    Hello

    with this code I can hide the menu point "HOT OFFER" linked to the hotoffers.php page, so ONLY connected the user can see it, BUT when NOT connected the user gives the url in the browser xxxx.com/hotoffers.php, he can see the page without connection, then how can I solve this in a simple way

    < div id = "Visibility" >

    < nav >

    < ul >

    < li > < a href = "index.php" > HOME < /a > < /li >

    < li > < a href = "aboutus.php" > ABOUT US < /a > < /li > ""

    < li > < a href = "services.php" > SERVICES < /a > < /li > ""

    < li > < a href = "#" > ACCOMMODATIONS < /a > < /li >

    < li > < a href = "#" > OUTSOURCING < /a > < /li >

    <? PHP if (isset($_SESSION['MM_Username'])) {? > < li > < a href = "hotoffers.php" > HOT OFFER < /a > < /li > <? ' "} PHP}? >

    < li > < a href = "#" > CONTACT < /a > < /li >

    < /ul >

    < / nav >

    < / div >

    Thank you

    Top of the page put this over another PHP block:

    <>

    If (! isset {session_start() ;})

    If (! isset ($_SESSION ['MM_Username'])) {}

    Header ('Location: path_to_login_page.php "");

    "exit";

    }

    ?>

    [CODE CORRECTED AFTER SUBMISSION]

  • Google racaptcha question

    Login submit very well and opens on localhost with the recaptcha, but when I download on iPage it throws an error (I change the connection info).  If I do not use the recaptcha, the shape is very well.

    The address is - www.veniceoptometry.com/sched_dev/ and the error is

    Warning: session_start() [Function.session - start]: Cannot send session cookie - headers already sent by (output started at hermes/bosoraweb062/b927/ipg.veniceoptometrycom/recaptchalib.php:142) in /hermes/bosoraweb062/b927/ipg.veniceoptometrycom/sched_dev/secure/functions.php on line 13

    Warning: session_start() [Function.session - start]: Cannot send session cache limiter - already sent headers (output started at hermes/bosoraweb062/b927/ipg.veniceoptometrycom/recaptchalib.php:142) in /hermes/bosoraweb062/b927/ipg.veniceoptometrycom/sched_dev/secure/functions.php on line 13

    Warning: session_regenerate_id() [Function.session - regenerate-id]: cannot regenerate the session id - headers already sent in /hermes/bosoraweb062/b927/ipg.veniceoptometrycom/sched_dev/secure/functions.php on line 14

    Warning: cannot modify header information - headers already sent by (output started at hermes/bosoraweb062/b927/ipg.veniceoptometrycom/recaptchalib.php:142) in /hermes/bosoraweb062/b927/ipg.veniceoptometrycom/sched_dev/secure/process_login.php on line 33


    If you try the below section without the recaptcha, that's fine and both use the same PB.

    In addition, the recaptcha is not asking the questions about my apple products.  Not sure if it's true.

    Thanks in advance!


    session_start() must be at the top of your script.

    With a few exceptions, it should be the first line.

  • How to display an image from the file in the database

    I want to be able to display an image from the file that I have stored in a database. In the database, the image is store as a file with numbers. When I go to display only the sign of an image appears. I want to be able to display the image not the symbol for numbers of the image or file. I know I'm close I just can't understand what I'm messing, to get the image to display.

    Here is the code:

    <? PHP require Connections/Connections.php"?" >

    <? PHP

    session_start();

    {if (isset($_SESSION["fname"]))}

    }

    else {}

    Header('Location:NewRequest.php');

    }

    ? >

    <? PHP

    $User = $_SESSION ['Pnom"];

    $result = $con-> query ("SELECT ALL * from newrequest where Fname ="$User"" ");

    ? >

    <! doctype html >

    < html >

    < head >

    < link href = "CSS/Master.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "CSS/Menu.css" rel = "stylesheet" type = "text/css" / > "

    < meta charset = 'utf-8 '.

    ReviewRequest < title > < / title >

    < / head >

    < body >

    < div class = "Container" >

    < div class = "Header" > < / div >

    < div class = "Menu" >

    < div id = 'Menu' >

    < nav >

    < ul class = "cssmenu" >

    < li > < a href = "Account.php" > account < /a > < /li > ""

    < li > < a href = "UpdateAccount.php" > update account < /a > < /li > ""

    < li > < a href = "NewRequest.php" > new request < /a > < /li > ""

    < li > < a href = "ReviewRequest.php" > Review Request < /a > < /li > ""

    < li > < a href = "LogOut.php" > sign out < /a > < /li > ""

    < /ul >

    < / nav >

    < / div >

    < / div >

    < div class = "LeftBody" > < / div >

    < div class = "RightBody" >

    < name of the form = "form1" method = "post" action = "" >

    < table border = "1" >

    < b >

    < td = '26' height > name < table >

    Location < td > < table >

    Description < td > < table >

    Image of < td > < table >

    < Td > status < table >

    < /tr >

    <? PHP while ($row = $result-> fetch_assoc()) {? >}

    < b >

    < class td = "GFied" > <? PHP echo $row ["Fname"];? > < table >

    < class td = "GFied" > <? PHP echo $row ['Location'];? > < table >

    < class td = "GFied" > <? PHP echo $row ['Description'];? > < table >

    < class td = "GFied" > < img src = "<?" PHP echo $row ["numero_imagenom_image"];? > "alt =" "> < table >"

    < class td = "GFied" > <? PHP echo $row ['Status'];? > < table >

    <? PHP}? >

    < /tr >

    < /table >

    < / make >

    < / div >

    < div class = "Footer" > < / div >

    < / div >

    < / body >

    < / html >

    This is what it looks like when it displays:

    Capture3.PNG

    How can I actually picture to display?

    emrenilo32520834 wrote:

    I added the .jpg but the image still does not display, the images are saved in a jpg file.

    If the images in the database to follow this format - 1234567.jpg, 9897654.jpg

    Then your original code must have worked:

    Are the images in their own folder, if so you need to add this folder for code name:

  • Login page does not work

    Hello

    I developed the admin dashboard a simple for my project.


    http://BHC.edu.in/BHCNET/admin/login.php


    The login page works well in localhost. After the download on my site, the login page does not work.


    It shows that the user name and password is incorrect. Kindly help me.

    username : admin

    password: admin

    Here is my code.

    <? PHP

    session_start();

    ? >

    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > Untitled Document < /title >

    < / head >

    < body >

    < h1 align = "center" > welcome aboard the Admin! < / h1 >

    < img src = "Images/Admin - icon.png" width = "200" height = "200" style = "float: left;" Display: block; "class ="admin">

    < do action = "login.php" method = "post" name = 'loginform' id 'french' = > "

    < table width = "278" height = '174' border = '0' >

    < b >

    < td width = "102" height = "59" > < label > user name: < / label > < table >

    < td width = "187" > < input type = "text" name = "user name" placeholder = "Enter your name" / > < table >

    < /tr >

    < b >

    < td = "46" height > < label > password: < / label > < table >

    < td > < input type = "password" name = placeholder "password" = "Enter your password" / > < table >

    < /tr >

    < b >

    < td = "37" height > < input type = "submit" name = "login_but" id = "login" value = "Login" / > < table >

    < td > < p >

    < input type = "reset" value = "Reset" name = "reset_but" id = "reset" / >

    < /p > < table >

    < /tr >

    < /table >

    < / make >

    < / body >

    < / html >

    <? PHP

    If (isset($_POST['login_but']))

    {

    $name = mysql_real_escape_string($_POST['username']);

    $pass = mysql_real_escape_string($_POST['password']);

    $encrypt = md5 ($pass);

    include("include/Connection.php");

    $query = "select * from users_login where name = '$name' and password = '$pass'"; "

    $run_query = mysql_query ($query, $conn);

    If (mysql_num_rows ($run_query) > 0)

    {

    $_SESSION ['username'] = $name;

    echo 'window.open ('index.php', '_self') < script > < /script >';

    }

    on the other

    {

    echo "< script > alert ("user name or password is incorrect!") < /script > ';

    }

    }

    ? >

    Kindly help me.

    Thank you in advance.

    There are two things that stand out immediately as incorrect:

    • You call mysql_real_escape_string() before connecting to the database. The connection must come first.
    • You use the original functions of PHP MySQL. They have been deprecated and do not work on several servers. Use MySQLi .
  • Dynamic array, not filling, works very well with the test button

    I built a recordset object and tested with the Test button and the Recordset returns my data on my remote server.  I then put a dynamic array on my php page that it points to the recordset of this work and that the PivotTable is empty.  The table displayed in design mode correctly with the recordset.vcolname, but when running that data are not to be connected.  I even tried just drag a few pieces of data on and still no data.  Any help would be appreciated.  Have a great day!

    There are a lot of things I want to mention, but do not have the time to.

    I'll start with the fact that you are using soon be deprecated MySQL instead of MySQLi or PDO.

    Second, you can't have your markup in the head section of your document as in

    Third, none of the session variables will not work if you start the session after your conditional statements. In other words, session_start() should be at the top of your document.

    There is more, but lack of time prevents me from analyzing those.

    My advice is to start with my third point, which is to place the session_start() at the beginning of your document and see if that changes things.

  • How to download an image and save it in a database?

    I created a new application form, so that the user can send a new request. It works fine, but I also wanted them to be able to download an image. I'm stuck on how to add a picture to download and mount with the code I already have for other data I ask. Is there a way to do this or suggestions?

    I still have useful and suggested changes that I get; that I intend on taking, I did not yet because I was trying to get it all to work before me.

    Code: NewRequest

    <? PHP require Connections/Connections.php"?" >

    <? PHP

    {if (isset($_POST['NewRequest']))}

    session_start();

    $FName = $_POST ["FirstName"];

    $Location = $_POST ['location'];

    $Description = $_POST ['description'];

    $Image = $_POST ['image'];

    $sql = $con-> query ("INSERT INTO newrequest (Fname, Location, Description, Image) Values('{$FName}','{$Location}','{$Description}','{Image}'"); ")

    Header ('Location: Account.php "");

    }

    ? >

    <! doctype html >

    <! doctype html >

    < html >

    < head >

    < link href = "CSS/Master.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "CSS/Menu.css" rel = "stylesheet" type = "text/css" / > "

    < meta charset = 'utf-8 '.

    < title > NewRequest < / title >

    < / head >

    < body >

    < div class = "Container" >

    < div class = "Header" > < / div >

    < div class = "Menu" >

    < div id = 'Menu' >

    < nav >

    < ul class = "cssmenu" >

    < li > < a href = "Account.php" > account < /a > < /li > ""

    < li > < a href = "UpdateAccount.php" > update account < /a > < /li > ""

    < li > < a href = "NewRequest.php" > new request < /a > < /li > ""

    < li > < a href = "ReviewRequest.php" > Review Request < /a > < /li > ""

    < li > < a href = "LogOut.php" > sign out < /a > < /li > ""

    < /ul >

    < / nav >

    < / div >

    < / div >

    < div class = "LeftBody" > < / div >

    < div class = "RightBody" >

    < do action = "" method = "post" name = "NewRequest" id = "NewRequest" > "

    < div class = "FormElement" >

    < label for = "" > < / label >

    < name of entry = "FirstName" type = "text" required class = "TField" id = "First name" = "First name" placeholder >

    < / div >

    < div class = "FormElement" >

    < label for = "" > < / label >

    < name of entry = 'Location' type = 'text' required class = "TField" id = 'Place' = 'Rental' placeholder >

    < / div >

    < div class = "FormElement" >

    < label for = "Description" > < / label >

    < name textarea = 'Description' required class = "TField" id = "Description" = "Description" placeholder > < / textarea >

    < / div >

    < do action = "NewRequest.php" method = "post" enctype = "multipart/form-data" > "

    Select the picture to download:

    < input type = "File" name = "Image" >

    < input type = "submit" name = "upload" value = "Upload" >

    < / make >

    <? PHP

    {if (isset($_POST['Upload']))}

    echo $name = $_FILES ['images'] ['name'];

    echo $tmp_name = $_FILES ['images'] ['tmp_name'];

    If ($name)

    {

    $location = "name of assets / $';

    move_upload_file($tmp_name,$location);

    }

    }

    ? >

    < div class = "FormElement" >

    < name of entry = "NewRequest" type = "submit" class = "button" id = "Send" value ="" >

    < / div >

    < / make >

    < / div >

    < div class = "Footer" > < / div >

    < / div >

    < / body >

    < / html >

    This is the page:

    New Request Design.PNG

    Do not store images in databases. Period.

    The procedure to transfer an image to a directory server and location of reference is not complex, but very important security problems there. You must prevent hackers to download malicious code to your server.

    The book PHP Solutions by powers details the code to do this.

  • How to display all the data to a database with the same name?

    I am familiar with the creation of basic website, but I want to learn how to create more dynamic Web sites.

    I create a Web site where a user can register on the site and counts there. Once into account here, there will be different options they can do.

    The new application form is in the section account it is configured for a user to submit a multiple application and save it in the database, that works, but the problem I have is during the examination of the application, it does show that one of them, not all.

    How can view the request of a user, sign in?datab.PNG

    revreq.PNG

    I can get to the screen, but not all.

    Is it possible to do this or any suggestions on how to do?

    Here's the code for the ReviewRequest:

    <? PHP require Connections/Connections.php"?" >

    <? PHP

    session_start();

    {if (isset($_SESSION["fname"]))}

    }

    else {}

    Header('Location:NewRequest.php');

    }

    ? >

    <? PHP

    $User = $_SESSION ['Pnom"];

    $result = $con-> query ("SELECT ALL * from newrequest where Fname ="$User"" ");

    $row = $result-> fetch_array (MYSQLI_BOTH);

    $_SESSION ["FirstName"] = $row ["Fname"];

    $_SESSION ['location'] = $row ["Location"];

    $_SESSION ['description'] = $row ['Description'];

    ? >

    <! doctype html >

    < html >

    < head >

    < link href = "CSS/Master.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "CSS/Menu.css" rel = "stylesheet" type = "text/css" / > "

    < meta charset = 'utf-8 '.

    ReviewRequest < title > < / title >

    < / head >

    < body >

    < div class = "Container" >

    < div class = "Header" > < / div >

    < div class = "Menu" >

    < div id = 'Menu' >

    < nav >

    < ul class = "cssmenu" >

    < li > < a href = "Account.php" > account < /a > < /li > ""

    < li > < a href = "UpdateAccount.php" > update account < /a > < /li > ""

    < li > < a href = "NewRequest.php" > new request < /a > < /li > ""

    < li > < a href = "ReviewRequest.php" > Review Request < /a > < /li > ""

    < li > < a href = "LogOut.php" > sign out < /a > < /li > ""

    < /ul >

    < / nav >

    < / div >

    < / div >

    < div class = "LeftBody" > < / div >

    < div class = "RightBody" >

    < name of the form = "form1" method = "post" action = "" >

    < div class = "FormElement" >

    < label for = "FirstName" > < / label >

    < input name = "FirstName" type = 'text' required class = "TField" id = "First name" value = "<?" PHP echo $_SESSION ['FirstName'];? ' > ' >

    < / div >

    < div class = "FormElement" >

    < label for = 'Place' > < / label >

    < input name = "Location" type = 'text' required class = "TField" id = 'Location' value = "<?" PHP echo $_SESSION ['Location'];? ' > ' >

    < / div >

    < div class = "FormElement" >

    < label for = "Description" > < / label >

    < input name = "Description" required class = "TField" id = "Description" value = "<?" PHP echo $_SESSION ['Description'];? ' > ' >

    < / div >

    < / make >

    < / div >

    < div class = "Footer" > < / div >

    < / div >

    < / body >

    < / html >

    You would browse the information stored in the $result variable.

    $result = $con-> query ("SELECT ALL * from newrequest where Fname ="$User"" ");

    As below:

    fetch_assoc()) {? >}

    (I don't see a reason to assign data to a variable of $_SESSION?)

    You also probably would be well advised to select information based on a uniquie rather than a name id - if two people have the same name youre UNLESS you want to make sure that two identical Fname can be stored in your tabe stuffed.

    $result = $con-> query ("SELECT ALL * from newrequest where userID = '$userID'");

    userID |     Fname |     Location |                      Description

    8 the end of the road muddy and foggy

    11 this something, no idea

    8               the              rstreet                           rah

    8 is not a clue

    14 Hello Goodbye

  • Record the path of the image in MySQL and store files

    Hello

    I have a form that saves the data in a MySQL database. In this form, there are four files of entry type to download images.

    Everything is done in Dreamweaver.

    What I have to do is store the path of file in MySQL and the file in a folder of the Web site.

    This is my code in the page and I am stuck don't know what someone can help.

    <? php require_once('.. / Connections/connect.php');? >
    <? PHP
    If (! isset {})
    session_start();
    }
    $MM_authorizedUsers = 'admin ';
    $MM_donotCheckaccess = "true";

    Restrict access to Page: grant or deny access to this page
    Function isAuthorized ($strUsers, $UserGroup, $strGroups, $UserName) {}
    For safety, first assuming that the visitor is NOT allowed.
    $isValid = false;

    When a visitor is connected to this site, the MM_Username of Session variable value equal to their username.
    So, we know that a user is NOT logged if this Session variable is empty.
    If (! empty ($UserName)) {}
    In addition to being connected, you can restrict access to only certain users based on a created ID when they connect.
    Analyze the channels in the tables.
    $arrUsers = explode (",", $strUsers);
    $arrGroups = explode (",", $strGroups);
    If (in_array ($UserName, $arrUsers)) {}
    $isValid = true;
    }
    Or, you can restrict access to only certain users based on their user name.
    If (in_array ($UserGroup, $arrGroups)) {}
    $isValid = true;
    }
    If (($strUsers == "") & & true) {}
    $isValid = true;
    }
    }
    return $isValid;
    }

    $MM_restrictGoTo = 'login.php ';
    If (!) {(((isset($_SESSION['MM_Username']))) & & (isAuthorized ("", $MM_authorizedUsers, $_SESSION ['MM_Username'], {$_SESSION ['MM_UserGroup']})))}
    $MM_qsChar = ';?
    $MM_referrer = $_SERVER ['PHP_SELF'];
    If (strpos ($MM_restrictGoTo, "?")) $MM_qsChar = "&";
    If (isset($_SERVER['QUERY_STRING']) & & strlen($_SERVER['QUERY_STRING']) > 0)
    $MM_referrer. = « ? ». $_SERVER ['QUERY_STRING'];
    $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar. "accesscheck =". UrlEncode ($MM_referrer);
    Header ("Location:".) $MM_restrictGoTo);
    "exit";
    }
    ? >
    <? PHP
    If (! function_exists ("GetSQLValueString")) {}
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    If (via PHP_VERSION < 6) {}
    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;
    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}
    case 'text ':
    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';
    break;
    case "double":
    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';
    break;
    case "date":
    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
    break;
    case "set":
    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
    break;
    }
    Return $theValue;
    }
    }

    $editFormAction = $_SERVER ['PHP_SELF'];
    If (isset {}
    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);
    }

    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "form1")) {}
    $insertSQL = sprintf ("INSERT INTO petrole2 (productName, productPrice, make, model, color, 'year', engineSize, fuelType, gearbox, productDescription, image, image1, image2, image3, image4) VALUES (%s, %s %s %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", ")
    GetSQLValueString ($_POST ["productName"], "text").
    GetSQLValueString ($_POST ['productPrice'], "text").
    GetSQLValueString ($_POST ['make'], "text").
    GetSQLValueString ($_POST ['model'], "text").
    GetSQLValueString ($_POST ['color'], "text").
    GetSQLValueString ($_POST ['year'], "text").
    GetSQLValueString ($_POST ['engineSize'], "text").
    GetSQLValueString ($_POST ['fuelType'], "text").
    GetSQLValueString ($_POST ['box'], "text").
    GetSQLValueString ($_POST ["'productDescription"], "text").
    GetSQLValueString ($_POST ['image'], "text").
    GetSQLValueString ($_POST ["image1"], "text").
    GetSQLValueString ($_POST ["image2"], "text").
    GetSQLValueString ($_POST ['image3'], "text").
    GetSQLValueString ($_POST ['image4 "],"text"));

    @mysql_select_db ($database_connect, $connect);
    $Result1 = mysql_query ($insertSQL, $connect) or die (mysql_error ());

    $insertGoTo = "productlist.php";
    If (isset {}
    $insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;
    $insertGoTo. = $_SERVER ['QUERY_STRING'];
    }
    header (sprintf ("location: %s", $insertGoTo));
    }
    ? >
    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""
    " < html xmlns =" http://www.w3.org/1999/xhtml ">
    < head >
    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"
    < title > Western St Motors Barnsley Admin Area < /title >
    < style type = "text/css" >
    {body
    background-color: #000;
    }
    < / style >
    "" < link href = "... / images/css/layout.css" rel = "stylesheet" type = "text/css" / >
    "" < link href = "... / images/css/style.css" rel = "stylesheet" type = "text/css" / >
    "" < link href = "... / images/css/links.css" rel = "stylesheet" type = "text/css" / >
    < / head >

    < body >
    < div id = "wapper" >
    "" < div id = "logo" > < img src = "... / images/main_header.jpg" width = "1001" height = "187" / > < / div >
    < div id = "navigation" >
    < ul >
    < li > < /li >
    "< id li ="active"> < a href ="... / index.php "> home < /a > < /li >"
    < li > < /li >
    "< li > < a href ="... / used_cars.html "> cars used < /a > < /li >"
    < li > < /li >
    "< li > < a href ="... / contact.html "> contact us < /a > < /li >"
    < li > < /li >
    < li > < /li >
    < li > < /li >
    < /ul >
    < / div >
    < div id = "bodyArea" >
    < div id = "left" >
    < div id = "info" >
    < div id = "adminarea" >
    Administrative add new product of < h1 > < / h1 >
    < p > to change user information, please use the < a href = "adminUserUpdate.php" > update user page < /a >. or Goto < a href = "adminarea.php" > area Admin < /a > < br / >
    < /p >
    < form action = "<?" PHP echo $editFormAction;? ">" method = "post" enctype = "multipart/form-data" name = "form1" id = "form1" >
    < table align = "center" >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > product name: < table >
    < td > < input name = "productName" type = "text" value = "" size = "80" maxlength = "255" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > product price: < table >
    < td > < input type = "text" name = "productPrice" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > do: < table >
    < td > < input type = "text" name = "make" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > model: < table >
    < td > < input type = "text" name = "model" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > color: < table >
    < td > < input type = "text" name = value "color" = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > year/Reg: < table >
    < td > < input type = "text" name = value "year" = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    the engine size < td nowrap = "nowrap" align = "right" >: < table >
    < td > < input type = "text" name = "engineSize" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > Type of fuel: < table >
    < td > < input type = "text" name = "fuelType" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > gear box: < table >
    < td > < input type = "text" name = "reductive" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" valign = "top" > Product Description: < table >
    < td > < textarea name = "productDescription" cols = "80" rows = "3" > < / textarea > < table >
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > Image: < table >
    < td > < input type = 'file' name = 'image' id = 'image' value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > Image1: < table >
    < td > < input type = "file" name = "image1" id = "image1" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > Image2: < table >
    < td > < input type = "file" name = "image2" id = "image2" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > Image3: < table >
    < td > < input type = "file" name = "3" id = "3" value = "" size = "32" / > < table > "
    < /tr >
    < tr valign = 'of basic">
    < td nowrap = "nowrap" align = "right" > < table >
    < td > < input type = "submit" value = "Add a product" / > < table >
    < /tr >
    < /table >
    < input type = "hidden" name = "MM_insert" value = "form1" / >
    < / make >
    < / div >
    < / div >
    < / div >
    < div id = "right" >
    < div id = 'open' >
    Opening time < p > < br / >
    < /p >
    < table width = "100%" border = "0" cellspacing = "2" cellpadding = "0" >
    < b >
    < td width = "37%" > Monday < table >
    < td width = "24%" > 09:00 < table >
    < td width = "13%" align = "center" valign = "middle" > - < table >
    < td width = "% 26" > 17:00 < table >
    < /tr >
    < b >
    < td > Tuesday < table >
    < td > < table > 09:00
    < td align = "center" valign = "middle" > - < table >
    < td > < table > 17:00
    < /tr >
    < b >
    < td > Wednesday < table >
    < td > < table > 09:00
    < td align = "center" valign = "middle" > - < table >
    < td > < table > 17:00
    < /tr >
    < b >
    < td > Thursday < table >
    < td > < table > 09:00
    < td align = "center" valign = "middle" > - < table >
    < td > < table > 17:00
    < /tr >
    < b >
    < td > Friday < table >
    < td > < table > 09:00
    < td align = "center" valign = "middle" > - < table >
    < td > < table > 17:00
    < /tr >
    < b >
    < td > Saturday < table >
    < td > < table > 09:00
    < td align = "center" valign = "middle" > - < table >
    < td > < table > 16:00
    < /tr >
    < b >
    < td > Sunday < table >
    < td > < table > 11:00
    < td align = "center" valign = "middle" > - < table >
    < td > < table > 14:00
    < /tr >
    < /table >
    < id p = "textopen" > Alternative times available by appointment. Please call and make arrangements. < /p >
    < / div >
    < div id = "advert1" > < / div >
    < div id = "advert2" > < / div >
    < / div >
    < div id = "footer" >
    < div align = "center" > Western Street Motors < / div >
    < / div >
    < / div >
    < / div >
    < / body >
    < / html >

    DW behaviors are not able to do.  And it's much more complicated than you realize.  How much real coding experience do you have?

    PHP 5 File Upload

    Nancy O.

  • I have a problem with a CS6 dynamic table creation

    I have 2 tables, 1 of them is caled 'user', the other a "cars" they are inked with a foreign key in the table of cars there is a column called UserID and takes the value of "user", so my question is I tried to make it dynamic table when the user is connected to display its cars that have his Userid on them only unfortunetly when I do this I get a blank table with nothing in it anyone can help me solve this problem. This is the code I use:

    <? php require_once('Connections/MyConnection.php');? >

    <? PHP

    initialize the session

    If (! isset {})

    session_start();

    }

    * Log out the current user. **

    $logoutAction = $_SERVER ['PHP_SELF']. » ? doLogout = true;

    If ((isset & & ($_SERVER ['QUERY_STRING']! = "")) {})

    $logoutAction. = '& '. htmlentities($_SERVER['QUERY_STRING']);

    }

    {If ((isset($_GET['doLogout'])) & & ($ {_GET ['doLogout'] == "true"))}

    to completely disconnect a visitor, you must delete the session varialbles

    $_SESSION ['MM_Username'] = NULL;

    $_SESSION ['MM_UserGroup'] = NULL;

    $_SESSION ['PrevUrl'] = NULL;

    unset($_SESSION['MM_Username']);

    unset($_SESSION['MM_UserGroup']);

    unset($_SESSION['PrevUrl']);

    $logoutGoTo = "/ cars/LogOut.php";

    If {($logoutGoTo)

    Header ("Location: $logoutGoTo");

    "exit";

    }

    }

    ? >

    <? PHP

    If (! isset {})

    session_start();

    }

    $MM_authorizedUsers = '1', 2;

    $MM_donotCheckaccess = "false";

    Restrict access to Page: grant or deny access to this page

    Function isAuthorized ($strUsers, $UserGroup, $strGroups, $UserName) {}

    For safety, first assuming that the visitor is NOT allowed.

    $isValid = false;

    When a visitor is connected to this site, the MM_Username of Session variable value equal to their username.

    So, we know that a user is NOT logged if this Session variable is empty.

    If (! empty ($UserName)) {}

    In addition to being connected, you can restrict access to only certain users based on a created ID when they connect.

    Analyze the channels in the tables.

    $arrUsers = explode (",", $strUsers);

    $arrGroups = explode (",", $strGroups);

    If (in_array ($UserName, $arrUsers)) {}

    $isValid = true;

    }

    Or, you can restrict access to only certain users based on their user name.

    If (in_array ($UserGroup, $arrGroups)) {}

    $isValid = true;

    }

    If (($strUsers == "") & & false) {}

    $isValid = true;

    }

    }

    return $isValid;

    }

    $MM_restrictGoTo = "/ cars/Home.php";

    If (!) {(((isset($_SESSION['MM_Username']))) & & (isAuthorized ("", $MM_authorizedUsers, $_SESSION ['MM_Username'], {$_SESSION ['MM_UserGroup']})))}

    $MM_qsChar = ';?

    $MM_referrer = $_SERVER ['PHP_SELF'];

    If (strpos ($MM_restrictGoTo, "?")) $MM_qsChar = "&";

    If (isset($_SERVER['QUERY_STRING']) & & strlen($_SERVER['QUERY_STRING']) > 0)

    $MM_referrer. = « ? ». $_SERVER ['QUERY_STRING'];

    $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar. "accesscheck =". UrlEncode ($MM_referrer);

    Header ("Location:".) $MM_restrictGoTo);

    "exit";

    }

    ? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $maxRows_cars = 10;

    $pageNum_cars = 0;

    If (isset($_GET['pageNum_cars'])) {}

    $pageNum_cars = $_GET ['pageNum_cars'];

    }

    $startRow_cars = $pageNum_cars * $maxRows_cars;

    $colname_cars = "-1";

    If (isset($_SESSION['MM_Username'])) {}

    $colname_cars = $_SESSION ['MM_Username"];

    }

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_cars = sprintf ("" SELECT * FROM cars WHERE UserID = %s ", GetSQLValueString ($colname_cars,"int")");

    $query_limit_cars = sprintf ("%s LIMIT %d, %d", $query_cars, $startRow_cars, $maxRows_cars);

    $cars = mysql_query ($query_limit_cars, $MyConnection) or die (mysql_error ());

    $row_cars = mysql_fetch_assoc ($cars);

    If (isset($_GET['totalRows_cars'])) {}

    $totalRows_cars = $_GET ['totalRows_cars'];

    } else {}

    $all_cars = mysql_query ($query_cars);

    $totalRows_cars = mysql_num_rows ($all_cars);

    }

    $totalPages_cars = ceil($totalRows_cars/$maxRows_cars)-1;

    $colname_user = "-1";

    If (isset($_SESSION['MM_Username'])) {}

    $colname_user = $_SESSION ['MM_Username"];

    }

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_user = sprintf ("SELECT * FROM 'user' WHERE Email = %s", GetSQLValueString ($colname_user, "text") ");

    $user = mysql_query ($query_user, $MyConnection) or die (mysql_error ());

    $row_user = mysql_fetch_assoc ($user);

    $totalRows_user = mysql_num_rows ($user);

    $colname_user = "-1";

    If (isset($_SESSION['MM_Username'])) {}

    $colname_user = $_SESSION ['MM_Username"];

    }

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_user = sprintf ("SELECT FirstName, LastName FROM 'user' WHERE Email = %s", GetSQLValueString ($colname_user, "text") ");

    $user = mysql_query ($query_user, $MyConnection) or die (mysql_error ());

    $row_user = mysql_fetch_assoc ($user);

    $colname_User = "-1";

    If (isset($_SESSION['MM_Username'])) {}

    $colname_User = $_SESSION ['MM_Username"];

    }

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_User = sprintf ("SELECT * FROM 'user' WHERE Email = %s", GetSQLValueString ($colname_User, "text") ");

    $User = mysql_query ($query_User, $MyConnection) or die (mysql_error ());

    $row_User = mysql_fetch_assoc ($User);

    $colname_User = "-1";

    If (isset($_GET['MM_Username'])) {}

    $colname_User = $_GET ['MM_Username"];

    }

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_User = sprintf ("SELECT * FROM 'user' WHERE Email = %s", GetSQLValueString ($colname_User, "text") ");

    $User = mysql_query ($query_User, $MyConnection) or die (mysql_error ());

    $row_User = mysql_fetch_assoc ($User);

    $colname_User = "-1";

    If (isset($_SESSION['MM_Username'])) {}

    $colname_User = $_SESSION ['MM_Username"];

    }

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_User = sprintf ("SELECT * FROM 'user' WHERE Email = %s", GetSQLValueString ($colname_User, "text") ");

    $User = mysql_query ($query_User, $MyConnection) or die (mysql_error ());

    $row_User = mysql_fetch_assoc ($User);

    $colname_User = "-1";

    If (isset($_SESSION['MM_Username'])) {}

    $colname_User = $_SESSION ['MM_Username"];

    }

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_User = sprintf ("SELECT * FROM 'user' WHERE UserID = %s", GetSQLValueString ($colname_User, "int") ");

    $User = mysql_query ($query_User, $MyConnection) or die (mysql_error ());

    $row_User = mysql_fetch_assoc ($User);

    ? >

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < link href = "CSS/Layout.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "CSS/Menu.css" rel = "stylesheet" type = "text/css" / > "

    "< link href="/Cars/CSS/VerticalMenu.css "rel ="stylesheet"type =" text/css"/ >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > Untitled Document < /title >

    < / head >

    < body >

    < div id = 'Holder' >

    < div id = "Header" >

    < div id = "HeaderContentRight" >

    < table width = "0" border = "0" align = "right" >

    < b >

    < td > logged in as: <? PHP echo $row_user ["FirstName"];? > <? PHP echo $row_user ['name'];? > < table >

    < td > < a href = "<?" PHP echo $logoutAction? > "> sign out < /a > < table >"

    < /tr >

    < /table >

    < / div >

    < / div >

    < div id = "NavBar" >

    < nav >

    < ul >

    "< li > < a href="/Cars/HomeAccount.php "> home < /a > < /li >

    < /ul >

    < / nav >

    < / div >

    < div id = "Content" >

    < div id = "PageHeading" >

    Welcome < h1 >, <? PHP echo $row_user ["FirstName"];? > <? PHP echo $row_user ['name'];? >! < / h1 >

    < / div >

    < div id = "ContentLeft" >

    Control Panel < h6 > < / h6 >

    < p > < / p >

    < ul id = "MyMainMenu" >

    < li > < a href="/Cars/Account.php" > account < /a > < /li > ".

    < li > < a href="/Cars/UpdateAccount.php" > update account < /a > < /li > ".

    < li > < a href="/Cars/CarManagment.php" > car management < /a > < /li > ".

    < /ul >

    < / div >

    < div id = "ContentRight" >

    < table border = "1" align = "center" >

    < b >

    CarBrand < td > < table >

    CarModel < td > < table >

    YearOfProduction < td > < table >

    < /tr >

    <? PHP {? >}

    < b >

    < td > <? PHP echo $row_cars ["CarBrand'];? > < table >

    < td > <? PHP echo $row_cars ["CarModel'];? > < table >

    < td > <? PHP echo $row_cars ["YearOfProduction"];? > < table >

    < /tr >

    <? PHP} while ($row_cars = mysql_fetch_assoc ($cars));? >

    < /table >

    < / div >

    < / div >

    < div id = "Footer" > < / div >

    < / div >

    < / body >

    < / html >

    <? PHP

    mysql_free_result ($CARS);

    mysql_free_result ($User);

    ? >

    Thank you for your time!

    Nowhere on this page I see that you have found the "UserID" variable that is used to query the database of cars everywhere.

    You must get that table "user" when a successful connection occurred.

    Go to your login page and find the code which queries the database (it will look something like the below, your request will be slightly different)

    $LoginRS__query = sprintf ("SELECT username, password loginUsers WHERE username = %s AND password is %s",

    MAKE SURE YOU add to THE QUERY "UserID" (see below.) This is the column of your 'user' table and the foreign key record unique identifier in your table 'cars')

    $LoginRS__query = sprintf ("SELECT UserID, username, password AND password loginUsers WHERE username = %s is %s",

    Then, find the lines of code below:

    $LoginRS = mysql_query ($LoginRS__query, $MyConnection) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    Include these two lines of code directly after the above code:

    $row = mysql_fetch_assoc ($LoginRS);

    $UserID = $row ['UserID']

    Can find these lines of code:

    If {($loginFoundUser)

    $loginStrGroup = "";

    Declare two session variables and assign them

    $_SESSION ['MM_Username"] = $loginUsername;

    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    Add this line of code directly after the above code:

    $_SESSION ['username'] = $UserID;

    Now, go to the login page of success (whatever you call that)

    Find the code at the top of the page below:

    If (! isset {})

    session_start();

    }

    Add the line of code below:

    If (! isset {})

    session_start();

    $userID = $_SESSION ['username'];

    }

    Look for the query:

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_cars = sprintf ("" SELECT * FROM cars WHERE UserID = %s ", GetSQLValueString ($colname_cars,"int")");

    $query_limit_cars = sprintf ("%s LIMIT %d, %d", $query_cars, $startRow_cars, $maxRows_cars);

    $cars = mysql_query ($query_limit_cars, $MyConnection) or die (mysql_error ());

    $row_cars = mysql_fetch_assoc ($cars);

    and replace with:

    @mysql_select_db ($database_MyConnection, $MyConnection);

    $query_query_cars = "SELECT * FROM cars WHERE userID ="$userID "";

    $query_cars = mysql_query ($query_query_cars, $MyConnection) or die (mysql_error ());

    $row_query_cars = mysql_fetch_assoc ($query_cars);

    $totalRows_query_cars = mysql_num_rows ($query_cars);

    Now, you can pass the details of the car associated with the user ID in the 'user' table and a foreign key in the table "cars."

    You probably want to use a / while loop to get all the information from the database. With a DW repeat region behavior.

Maybe you are looking for

  • How can I get rid of the right scrollbar being all the time?

    Using Firefox on Windows 8, a Web page that contains a frame that has a long text that it displays a white scroll bar. The same page does not display the scroll bar when using Firefox on Mac. I tried a number of things inclucing enter topic: config b

  • A color box control are editable so that only 4 colors can be selected.

    Hello I wanted a color box to be used as a control so that when left clicked, there are 4 colors that they can select which will dictate what will do the program.  Currently, make a left click on the color box brings a variety of colors, and the only

  • Lost calendar information

    Please HELP my computer is updated nightly and restarted my computer when I loged in and went to my palm desktop all my info calendar was gone, everything is still there. I tried to restore my computer to an earlier date and who does not. How can I g

  • MSI error 1920

    Trying to install my kodak esp 5250 printer all-in-one.  get msi error 1920... Discovery service was able to start.  Make sure you have sufficient privileges to start the system.  I already ran services.msc and entered the spooler printer and changed

  • QuickWeb Probook 4420 to s

    Hello friends, I realized a recovery on my laptop and my QuickWeb does more. never actually worked... I noticed that the Bios doesn't have the option of Instant-On, but the big picture is specified that this model has support QuickWeb. It has a parti