hi everyone,

I'm getting this error message from my script
"Parse error: syntax error, unexpected T_VARIABLE in C:\Program Files\Apache Group\Apache2\htdocs\sel_byid.php on line 18".

I have no Idea what this is or more importantly what it is trying to tell me to fix. I just started working with PHP, MYSQL, and APACHE. Here is my script, and thank you for your help.

<?
$db_name = "testdb2";
$table_name = "my_music";

$connection = @mysql_connect("localhost", "xxxxx", "xxxxx")
	or die(mysql_error());

$db = @mysql_select_db($db_name, $connection) or die(mysql_error());

$sql = "SELECT * FROM $table_name ORDER BY id";

$result = @mysql_query($sql,$connection) or die(mysql_error());

while ($row = mysql_fetch_array($result)) {

$id = $row['id'];
$format = $row['format']
$title = stripslashes($row['title']);
$artist_fn = stripslashes($row['artist_fn']);
$artist_ln = stripslashes($row['artist_ln']);
$rec_label = stripslashes($row['rec_label']);
$my_notes = stripslashes($row['my_notes']);
$date_acq = $row['date_acq'];

if (artist_fn != "") {
$artist_fullname = trim("$artist_fn $artist_ln");
} else {
	$artist_fullname = trim("artist_ln");
}

if ($date_acq == "0000-00-00") {
	$date_acq = "[unknown]";
}

$display_block .= "<P><strong>$title</strong> on $rec_label,
	by $artist_fullname<br>
$my_notes <em>(acquired:$date_acq, format:$format)</em></P>";
}
?>

<HTML>
<HEAD>
<TITLE>My Music (Ordered by ID)</TITLE>
</HEAD>
<BODY>
<H1>My Music: Ordered By ID</H1>
<? echo "$display_block"; ?>
<P><a href="my_menu.html">Return to menu</a></P>
</BODY>
</HTML>

    $format = $row['format']
    is missing the terminating semi-colon.

    Basically, look at line 18, and the surrounding code if necessary, to determine the problem.

      2 years later

      I have similar problem. I see the message: "Parse error: syntax error, unexpected T_VARIABLE in ......\moviedata.php on line 16" when I open my file and I can't understend where is my mistake. Here is my code:

      <?php
      //connect to MySQL
      $connect = mysql_connect("localhost", "xxx", "xxx") or die ("Proveri si vryzkata sys server-a.");

      //uverqvame se 4e polzame pravilnata DB
      mysql_select_db("moviesite");

      //vyvejdane da danni v tablicata "movie"
      $insert = "INSERT INTO movie (movie_id, movie_name, movie_type, movie_year, movie_leadactor, movie_director) " .
      "VALUES (1, 'Bruce Almighty', 5, 2003, 1, 2), " .
      "(2, 'Office Space', 5, 1999, 5, 6), " .
      "(3, 'Grand Canyon', 2, 1991, 4, 3)";
      $results = mysql_query($insert)

      //vyvejdane na danni v tablicata "movietype"
      $type = "INSERT INTO movietype (movietype_id, movietype_label) " .
      "VALUES (1, 'Sci Fi'), " .
      "(2, 'Drama'), " .
      "(3, 'Adventure'), " .
      "(4, 'War'), " .
      "(5, 'Comedy'), " .
      "(6, 'Horror'), " .
      "(7, 'Action'), " .
      "(8, 'Kids')" ;
      $resuts = mysql_query($type) or die (mysql_error());

      //vyvejdane na danni v tablicata "people"
      $people = "INSERT INTO people (people_id, people_fullname, people_isactor, people_isdirector) " .
      "VALUES (1, 'Jim Carrey', 1, 0), " .
      "(2, 'Tom Shadyac', 0, 1), " .
      "(3, 'Lawrence Kasdan', 0, 1), " .
      "(4, 'Kevin Kline', 1, 0), " .
      "(5, 'Ron Livingston', 1, 0), " .
      "(6, 'Mike Judje', 0, 1)";
      $results = mysql_query($people) or die (mysql_error());

      echo "Data inserted successfully!";
      ?>

        Djibri, you are missing a terminating semi-colon on line 13:

        $results = mysql_query($insert)

        Next time kindly start your own thread instead of resurrecting an old thread, especially one that is not yours. Link to the old thread if you must.

          Also, when posting PHP code, please use the board's [PHP][/PHP] bbcode tags - they make the code much, much easier to read (as well as aiding the diagnosis of syntax errors). You should edit your post now and add these bbcode tags to help others in reading/analyzing your code.

            a year later

            Hi All,

            This is racking my brain. I am getting the all infamous "Parse error: syntax error, unexpected T_VARIABLE" message. I know that 9 times out of 10 your either missing a semi-colon or opening/closing brackets in statements. I have checked my code like 20 times and I am just not seeing it! 😛

            Maybe you guys could see it.

            I am trying to take this "test" I guess you can call it for this freelance php developer gig, and want to make sure all the code works before I send it back to them for review.

            Exact error is: "
            Parse error: syntax error, unexpected T_VARIABLE in /home/content/j/m/b/jmbrink26/html/testing/index.php on line 39"

            Here is the code:

            <?php
            
            //Database Connection
            $msdb = mysql_connect("xxx", "xxx", "xxx");
            mysql_select_db("test", $msdb) or die(mysql_error());
            
            /*
            GENERAL INFORMATION:
            	Below is the current table structure for 'members':
            =====
            ID: id (autoincrement)
            firstname
            lastname
            phonenumber
            =====
            
            PUT YOUR NAME HERE PLEASE: John Doe
            
            PART 1:
            -------
            	* Below, write the PHP code to insert a first name, last name, and phone number
            into the 'members' table.  Use an HTML form to collect this information, then store it to the 'members' table.
            // 
            */
            
            
            /*
            PART 2:
            -------
            	* Below, write the PHP code to retrieve the previously inserted record from the
            'tests' table and display it in the browser.
            //*/
            
            // PHP Code
            // Code to pass HTML POST data
            
            $firstName = $_POST['firstname'];
            $lastName = $_POST['lastname'];
            $phoneNumber = $_POST['phonenumber']; //This is line 39 in my IDE
            if(!$firstName || !$lastName || !$phoneNumber) {
              echo "You did not enter all the necessary data into the fields as requested. Please fill in the information below and try again. Thank you.";
              } else {
              $number = is_numeric($phoneNumber);
              if($number == false) {
                echo "You did not type the Phone Number in the format shown as example in the field. Please fill in the information below and try again. Thank you.";
            	} else {
            	  $insert = "INSERT INTO members (firstname, lastname, phonenumber) VALUES($firstName, $lastName, $phoneNumber);";
            	  mysql_query($insert);
            	  //Code to retrieve record just inserted
            	  $query = "SELECT * FROM members WHERE firstname = $firstName AND lastname = $lastName AND phonenumber = $phoneNumber;";
            	  $result = mysql_query($query);
            	  echo $result;
            	  }
            ?>
            
            <html>
            
              <head>
            
            <title>PHP TEST</title>
            <!-- Link to a fake CSS Stylesheet -->
            <link rel="stylesheet" href="test.css" />
              </head>
            
              <body>
            
            <h2>PHP TEST</h2>
            <br />
            <p>Please enter data into all the fields, or an error will display. Thank you for your cooperation.</p>
            <br />
            <table name="form_table" id="form_table">
              <form name="phptest_form" id="phptest_form" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
                <tr>
                  <td>First Name &nbsp;</td>
                  <td><input type="text" name="firstname" id="firstname" /></td>
                </tr>
                <tr>
                  <td>Last Name &nbsp;</td>
                  <td><input type="text" name="lastname" id="lastname" /></td>
                </tr>
                <tr>
                  <td>Phone Number &nbsp;</td>
                  <td><input type="text" name="phonenumber" id="phonenumber" value="0000000000" /></td>
                </tr>
                <tr>
                  <td></td>
                  <td><input type="submit" name="submit" id="submit" value="Submit" /></td>
                </tr>
              </form>
            </table>
              </body>
            </html>

            Thanks in advance for your help.

              Is that the entire script? I get a different parse error: Parse error: syntax error, unexpected $end in C:\php\test.php on line 92.

              That parse error is referring to the unclosed '}' on the first else statement.

                laserlight;10794284 wrote:

                Next time kindly start your own thread instead of resurrecting an old thread, especially one that is not yours. Link to the old thread if you must.

                Next time maybe a bit of reading would be in order (2 posts above yours)

                But the solution is maybe a bit easier than you think.

                I have had comment lines throw off the error reporting, as far as the line with the error goes. Count the number of commented lines and add that to the 39 and see if you find the problem. If there are more commented lines in the code as you add you may need to add one more line for each. This will get you closer to the correct line of the error.

                  Also, jmbrink26, this bit of code:

                  <?php $_SERVER['PHP_SELF']; ?>

                  does nothing. Perhaps you meant:

                  <?php echo $_SERVER['PHP_SELF']; ?>

                  ?

                    Yes, that's it.

                    Interestingly enough though, I copied all the text from the original file, and pasted it into a new file, and then I got that same error about the $end. I forgot 1 curley brace at the end, and that fixed that issue.

                    Thanks for the reminder to put the echo in the php_self line, I totally forgot about that. Been a while since I've passed variables that way... That would explain why nothing ever gets inserted into the mysql table 😛

                    Thanks again. Much appreciated! 🙂

                      2 months later

                      hi every body
                      i have a problem with this code:

                      ////////////////////////////
                      //       config.php       //
                      ////////////////////////////
                      
                      
                      ////////////////////////////////////// CONNECTIN TO DATABASE AND SELECTING IT
                      <?php
                      
                      $host = $_POST['haddress'];
                      $usser = $_POST['huser'];
                      $pass = $_POST['hpass'];
                      $db =   $_POST['hname'];
                      $connect = mysql_connect($host,$usser,$pass) or die('tghrg');
                      mysql_select_db($connection,$db) or die('gggg');
                      
                      //////////////////////////////////// CREATING TABLES AND INSERTING MAIN DATA INTO THEM 
                      //////////dedws
                      $createinfo = "create table pscms_maininfo (
                      title     char(200)    not null default 'Simple cms by parsscript',
                      sdir      char(255)    ,
                      author    char(255)    not null  default 'parsscript.ir',
                      about     text 
                       )";
                      
                      sql_query($createinfo) or die('g')
                      
                      //////////////// sending grabed data into pscms_maininfo table
                      
                      $title = ($_POST['title']);
                      $sdir = $_post['sdir'];
                      $author = $_post['author'];
                      $about = $_post['about'];
                      
                      $sinfo = "insert into pscms_maininfo (title,sdir,author,about)
                             values ('$title','$sdir','$author','$about')";
                      mysql_query($sinfo) or die ('&#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1576;&#1589;&#1608;&#1585;&#1578; &#1589;&#1581;&#1740;&#1581; &#1575;&#1585;&#1587;&#1575;&#1604; &#1606;&#1588;&#1583;&#1606;&#1583;')
                      
                      //////////////// creating table pscms_admin
                      
                      $adminc = "create table pscms_admin (
                      username    char(200) not null  default 'admin',
                      password    char(200) not null  default 'admin'
                      )";
                      
                      mysql_query($adminc) or die ('&#1583;&#1585; &#1575;&#1740;&#1580;&#1575;&#1583; &#1601;&#1590;&#1575; &#1576;&#1585;&#1575;&#1740; &#1584;&#1582;&#1740;&#1585;&#1607; &#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1605;&#1583;&#1740;&#1585;&#1740;&#1578; &#1575;&#1588;&#1705;&#1575;&#1604; &#1608;&#1580;&#1608;&#1583; &#1583;&#1575;&#1585;&#1583; ')
                      //////////////// sending grabed data into pscms_admin table
                      
                      $username = $_post['auser'];
                      $password = $_post['apass'];
                      
                      $sadmin = "insert into pscms_admin (username,password)
                                  values ('$username','$password')";
                      mysql_query($sadmin) or die ('&#1575;&#1585;&#1587;&#1575;&#1604; &#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1605;&#1583;&#1740;&#1585;&#1740;&#1578; &#1575;&#1606;&#1580;&#1575;&#1605; &#1606;&#1588;&#1583;')
                      
                      //////////////// creating  table pscms_posts
                      
                      $cposts = "create table pscms_posts (
                      title  char(255),
                      text   text   not null  default '&#1576;&#1583;&#1608;&#1606; &#1605;&#1581;&#1578;&#1608;&#1740;'
                      )";
                      
                      mysql_query($cposts) or die ('&#1605;&#1581;&#1604;&#1740; &#1576;&#1585;&#1575;&#1740; &#1584;&#1582;&#1740;&#1585;&#1607; &#1605;&#1591;&#1575;&#1604;&#1576; &#1575;&#1740;&#1580;&#1575;&#1583; &#1606;&#1588;&#1583;')
                      //////////////// 
                      
                      
                      <table border="0" width="50%" align="center">
                      	<tr>
                      		<td bgcolor="#004A18">
                      		<p align="center" dir="rtl">
                      		<font face="Tahoma" size="2" color="#E6FFE6">&#1587;&#1740;&#1587;&#1578;&#1605; &#1576;&#1575; &#1605;&#1608;&#1601;&#1602;&#1740;&#1578; &#1606;&#1589;&#1576; &#1711;&#1585;&#1583;&#1740;&#1583;<span lang="en-us">!</span></font></td>
                      	</tr>
                      	<tr>
                      		<td bgcolor="#6F4200">
                      		<p dir="rtl"><font face="Tahoma" size="2" color="#FFAB2D">&#1740;&#1705;&#1740; &#1585;&#1575; &#1575;&#1606;&#1578;&#1582;&#1575;&#1576; &#1705;&#1606;&#1740;&#1583; :</font></p>
                      		<p dir="rtl" align="center"><font face="Tahoma" size="2">
                      		<font color="#FFAB2D">&nbsp;</font><a href="index.php"><font color="#FFAB2D">&#1589;&#1601;&#1581;&#1607; &#1575;&#1589;&#1604;&#1740; &#1608;&#1576;&#1587;&#1575;&#1740;&#1578;</font></a><font color="#FFAB2D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      		</font>
                      <a href="admin/index.php"><font color="#FFAB2D">&#1605;&#1585;&#1705;&#1586; &#1705;&#1606;&#1578;&#1585;&#1604; &#1608;&#1576;&#1587;&#1575;&#1740;&#1578; 
                      		</font> </a>
                      		</font>
                      </td>
                      	</tr>
                      </table>

                      i have a form wich it action is the page contain the this code
                      when i execute the form i get this error

                      Parse error: syntax error, unexpected T_VARIABLE in D:\Downloads\xampplite\htdocs\b\config.php on line 29

                      what should i do??????😕😕:glare:

                        you must use ; signs at that lines end that must close the commands:

                        and you forget to close your PHP block
                        ?> was misssing
                        AND $_POST is with CAPITAL letters!

                        And, check if you wrote mysql_query command... i found 1 part where you wrote it as wrong..

                        and use the source code insert in this forum.

                        <?php
                        
                        $host = $_POST['haddress'];
                        $usser = $_POST['huser'];
                        $pass = $_POST['hpass'];
                        $db = $_POST['hname'];
                        $connect = mysql_connect($host,$usser,$pass) or die('tghrg');
                        mysql_select_db($connection,$db) or die('gggg');
                        
                        //////////////////////////////////// CREATING TABLES AND INSERTING MAIN DATA INTO THEM
                        //////////dedws
                        $createinfo = "create table pscms_maininfo (
                        title char(200) not null default 'Simple cms by parsscript',
                        sdir char(255) ,
                        author char(255) not null default 'parsscript.ir',
                        about text
                        )";
                        
                        mysql_query($createinfo) or die('g');
                        
                        //////////////// sending grabed data into pscms_maininfo table
                        
                        $title = $_POST['title'];
                        $sdir = $_POST['sdir'];
                        $author = $_POST['author'];
                        $about = $_POST['about'];
                        
                        $sinfo = "insert into pscms_maininfo (title,sdir,author,about)
                        values ('$title','$sdir','$author','$about')";
                        mysql_query($sinfo) or die ('&#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1576;&#1589;&#1608;&#1585;&#1578; &#1589;&#1581;&#1740;&#1581; &#1575;&#1585;&#1587;&#1575;&#1604; &#1606;&#1588;&#1583;&#1606;&#1583;');
                        
                        //////////////// creating table pscms_admin
                        
                        $adminc = "create table pscms_admin (
                        username char(200) not null default 'admin',
                        password char(200) not null default 'admin'
                        )";
                        
                        mysql_query($adminc) or die ('&#1583;&#1585; &#1575;&#1740;&#1580;&#1575;&#1583; &#1601;&#1590;&#1575; &#1576;&#1585;&#1575;&#1740; &#1584;&#1582;&#1740;&#1585;&#1607; &#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1605;&#1583;&#1740;&#1585;&#1740;&#1578; &#1575;&#1588;&#1705;&#1575;&#1604; &#1608;&#1580;&#1608;&#1583; &#1583;&#1575;&#1585;&#1583; ');
                        //////////////// sending grabed data into pscms_admin table
                        
                        $username = $_POST['auser'];
                        $password = $_POST['apass'];
                        
                        $sadmin = "insert into pscms_admin (username,password) values ('$username','$password')";
                        mysql_query($sadmin) or die ('&#1575;&#1585;&#1587;&#1575;&#1604; &#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1605;&#1583;&#1740;&#1585;&#1740;&#1578; &#1575;&#1606;&#1580;&#1575;&#1605; &#1606;&#1588;&#1583;');
                        
                        //////////////// creating table pscms_posts
                        
                        $cposts = "create table pscms_posts (
                        title char(255),
                        text text not null default '&#1576;&#1583;&#1608;&#1606; &#1605;&#1581;&#1578;&#1608;&#1740;'
                        )";
                        
                        mysql_query($cposts) or die ('&#1605;&#1581;&#1604;&#1740; &#1576;&#1585;&#1575;&#1740; &#1584;&#1582;&#1740;&#1585;&#1607; &#1605;&#1591;&#1575;&#1604;&#1576; &#1575;&#1740;&#1580;&#1575;&#1583; &#1606;&#1588;&#1583;');
                        
                        ?>
                        
                        <table border="0" width="50%" align="center">
                        <tr>
                        <td bgcolor="#004A18">
                        <p align="center" dir="rtl">
                        <font face="Tahoma" size="2" color="#E6FFE6">&#1587;&#1740;&#1587;&#1578;&#1605; &#1576;&#1575; &#1605;&#1608;&#1601;&#1602;&#1740;&#1578; &#1606;&#1589;&#1576; &#1711;&#1585;&#1583;&#1740;&#1583;<span lang="en-us">!</span></font></td>
                        </tr>
                        <tr>
                        <td bgcolor="#6F4200">
                        <p dir="rtl"><font face="Tahoma" size="2" color="#FFAB2D">&#1740;&#1705;&#1740; &#1585;&#1575; &#1575;&#1606;&#1578;&#1582;&#1575;&#1576; &#1705;&#1606;&#1740;&#1583; :</font></p>
                        <p dir="rtl" align="center"><font face="Tahoma" size="2">
                        <font color="#FFAB2D">&nbsp;</font><a href="index.php"><font color="#FFAB2D">&#1589;&#1601;&#1581;&#1607; &#1575;&#1589;&#1604;&#1740; &#1608;&#1576;&#1587;&#1575;&#1740;&#1578;</font></a><font color="#FFAB2D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </font>
                        <a href="admin/index.php"><font color="#FFAB2D">&#1605;&#1585;&#1705;&#1586; &#1705;&#1606;&#1578;&#1585;&#1604; &#1608;&#1576;&#1587;&#1575;&#1740;&#1578;
                        </font> </a>
                        </font>
                        </td>
                        </tr>
                        </table>
                        
                          djjjozsi;10890585 wrote:

                          you must use ; signs at that lines end that must close the commands:

                          and you forget to close your PHP block
                          ?> was misssing
                          AND $_POST is with CAPITAL letters!

                          And, check if you wrote mysql_query command... i found 1 part where you wrote it as wrong..

                          and use the source code insert in this forum.

                          <?php
                          
                          $host = $_POST['haddress'];
                          $usser = $_POST['huser'];
                          $pass = $_POST['hpass'];
                          $db = $_POST['hname'];
                          $connect = mysql_connect($host,$usser,$pass) or die('tghrg');
                          mysql_select_db($connection,$db) or die('gggg');
                          
                          //////////////////////////////////// CREATING TABLES AND INSERTING MAIN DATA INTO THEM
                          //////////dedws
                          $createinfo = "create table pscms_maininfo (
                          title char(200) not null default 'Simple cms by parsscript',
                          sdir char(255) ,
                          author char(255) not null default 'parsscript.ir',
                          about text
                          )";
                          
                          mysql_query($createinfo) or die('g');
                          
                          //////////////// sending grabed data into pscms_maininfo table
                          
                          $title = $_POST['title'];
                          $sdir = $_POST['sdir'];
                          $author = $_POST['author'];
                          $about = $_POST['about'];
                          
                          $sinfo = "insert into pscms_maininfo (title,sdir,author,about)
                          values ('$title','$sdir','$author','$about')";
                          mysql_query($sinfo) or die ('&#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1576;&#1589;&#1608;&#1585;&#1578; &#1589;&#1581;&#1740;&#1581; &#1575;&#1585;&#1587;&#1575;&#1604; &#1606;&#1588;&#1583;&#1606;&#1583;');
                          
                          //////////////// creating table pscms_admin
                          
                          $adminc = "create table pscms_admin (
                          username char(200) not null default 'admin',
                          password char(200) not null default 'admin'
                          )";
                          
                          mysql_query($adminc) or die ('&#1583;&#1585; &#1575;&#1740;&#1580;&#1575;&#1583; &#1601;&#1590;&#1575; &#1576;&#1585;&#1575;&#1740; &#1584;&#1582;&#1740;&#1585;&#1607; &#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1605;&#1583;&#1740;&#1585;&#1740;&#1578; &#1575;&#1588;&#1705;&#1575;&#1604; &#1608;&#1580;&#1608;&#1583; &#1583;&#1575;&#1585;&#1583; ');
                          //////////////// sending grabed data into pscms_admin table
                          
                          $username = $_POST['auser'];
                          $password = $_POST['apass'];
                          
                          $sadmin = "insert into pscms_admin (username,password) values ('$username','$password')";
                          mysql_query($sadmin) or die ('&#1575;&#1585;&#1587;&#1575;&#1604; &#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578; &#1605;&#1583;&#1740;&#1585;&#1740;&#1578; &#1575;&#1606;&#1580;&#1575;&#1605; &#1606;&#1588;&#1583;');
                          
                          //////////////// creating table pscms_posts
                          
                          $cposts = "create table pscms_posts (
                          title char(255),
                          text text not null default '&#1576;&#1583;&#1608;&#1606; &#1605;&#1581;&#1578;&#1608;&#1740;'
                          )";
                          
                          mysql_query($cposts) or die ('&#1605;&#1581;&#1604;&#1740; &#1576;&#1585;&#1575;&#1740; &#1584;&#1582;&#1740;&#1585;&#1607; &#1605;&#1591;&#1575;&#1604;&#1576; &#1575;&#1740;&#1580;&#1575;&#1583; &#1606;&#1588;&#1583;');
                          
                          ?>
                          
                          <table border="0" width="50%" align="center">
                          <tr>
                          <td bgcolor="#004A18">
                          <p align="center" dir="rtl">
                          <font face="Tahoma" size="2" color="#E6FFE6">&#1587;&#1740;&#1587;&#1578;&#1605; &#1576;&#1575; &#1605;&#1608;&#1601;&#1602;&#1740;&#1578; &#1606;&#1589;&#1576; &#1711;&#1585;&#1583;&#1740;&#1583;<span lang="en-us">!</span></font></td>
                          </tr>
                          <tr>
                          <td bgcolor="#6F4200">
                          <p dir="rtl"><font face="Tahoma" size="2" color="#FFAB2D">&#1740;&#1705;&#1740; &#1585;&#1575; &#1575;&#1606;&#1578;&#1582;&#1575;&#1576; &#1705;&#1606;&#1740;&#1583; :</font></p>
                          <p dir="rtl" align="center"><font face="Tahoma" size="2">
                          <font color="#FFAB2D">&nbsp;</font><a href="index.php"><font color="#FFAB2D">&#1589;&#1601;&#1581;&#1607; &#1575;&#1589;&#1604;&#1740; &#1608;&#1576;&#1587;&#1575;&#1740;&#1578;</font></a><font color="#FFAB2D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          </font>
                          <a href="admin/index.php"><font color="#FFAB2D">&#1605;&#1585;&#1705;&#1586; &#1705;&#1606;&#1578;&#1585;&#1604; &#1608;&#1576;&#1587;&#1575;&#1740;&#1578;
                          </font> </a>
                          </font>
                          </td>
                          </tr>
                          </table>
                          

                          thank you for answering
                          i did what you told and i corrected the misings
                          but still i have a problem when i execute the form i told you about this error coms

                          Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\Downloads\xampplite\htdocs\b\config.php on line 7
                          tghrg

                          now?😕

                            please answer my question...
                            if you can
                            i need your professional guides , please

                              hosseind600;10890599 wrote:

                              please answer my question...
                              if you can
                              i need your professional guides , please

                              Lets write the values for the connection:

                              $host = $POST['haddress'];
                              $usser = $
                              POST['huser'];
                              $pass = $POST['hpass'];
                              $db = $
                              POST['hname'];

                              $host = "****";
                              $usser ="
                              *";
                              $pass = "
                              *";
                              $db = "
                              ****";

                                again thank you

                                this time this error comes

                                Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in D:\Downloads\xampplite\htdocs\b\config.php on line 8
                                gggg

                                do you know why?

                                  here is a good template to build the connection:

                                  anyway:

                                  in this line was just $connect....
                                  $connection = mysql_connect($host,$usser,$pass) or die('tghrg');
                                  mysql_select_db($connection,$db) or die('gggg');

                                  this is a template 4 you:

                                  <?php
                                  
                                  /// For the following details,
                                  /// please contact your server vendor
                                  
                                  $hostname='***'; //// specify host, i.e. 'localhost'
                                  $user='****'; //// specify username
                                  $pass='****'; //// specify password
                                  $dbase='****'; //// specify database name
                                  $connection = mysql_connect("$hostname" , "$user" , "$pass")
                                  or die ("Can't connect to MySQL");
                                  $db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
                                  ?>
                                  
                                    djjjozsi;10890608 wrote:

                                    here is a good template to build the connection:

                                    anyway:

                                    in this line was just $connect....
                                    $connection = mysql_connect($host,$usser,$pass) or die('tghrg');
                                    mysql_select_db($connection,$db) or die('gggg');

                                    this is a template 4 you:

                                    <?php
                                    
                                    /// For the following details,
                                    /// please contact your server vendor
                                    
                                    $hostname='***'; //// specify host, i.e. 'localhost'
                                    $user='****'; //// specify username
                                    $pass='****'; //// specify password
                                    $dbase='****'; //// specify database name
                                    $connection = mysql_connect("$hostname" , "$user" , "$pass")
                                    or die ("Can't connect to MySQL");
                                    $db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
                                    ?>
                                    

                                    thanks a lot
                                    it works correct🙂

                                      nice!

                                      hosseind600;10890618 wrote:

                                      thanks a lot
                                      it works correct🙂