hi everyone thanx alot for helping me u solved me many problem so i need ur help again after i'm login and choose a movie that the person want to watch it i'm create table time and i insert the time for booking and the user will choose the time that he can choose it work but if he dosen't choose time and enter booking they show me error here my code

<?php
session_start();
require("../../../dbc.php");
if(isset($_POST['submit']))
{

 $start =mysql_real_escape_string($_POST['start']);  



if ($start)
{
    $connect=mysql_connect("127.0.0.1","root","") or die("couldnt connect to database");
    mysql_select_db("login") or die("couldnt find database");
    $query = mysql_query("SELECT * FROM  `time` WHERE `start` ='$start'");

    $numrow = mysql_num_rows($query);


    if($numrow !=0) 
    {
    while($row = mysql_fetch_assoc($query))
    {
         $dbstart= $row['start'];



         }
         if($start==$dbstart)
         {
             echo  header("location:book.php");
           $_SESSION['start'] = $dbstart ;
         }

    }

}
         else 
          die( " please enter the time .<a href='../3D The Croods.php'>click here to choose time</a>");




}


 ?>

So what exactly is it that you're asking us? :)

Member Avatar for diafol

hi everyone thanx alot for helping me u solved me many problem so i need ur help again after i'm login and choose a movie that the person want to watch it i'm create table time and i insert the time for booking and the user will choose the time that he can choose it work but if he dosen't choose time and enter booking they show me error here my code

Any chance you could rephrase that to include some punctuation? I ran out of breathe half way through the sentence.

my programe is grand cienema after i'm login and choose the movie i creat another database for time booking so if i dont choose the time and press enter the message will be please inter the time but above these message they tell me

( ! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: start in C:\wamp\www\cinema3\movies\films\booking\book here1.php on line7

here my form action to choose time

<tr><td><center><form action="booking/book here.php" method="post">
<input type="radio" name="start" value="18:00:00">18:00
<input type="radio" name="start" value="20:00:00">20:00
<input type="radio" name="start" value="22:00:00">22:00<p>

  <input type="submit" name="submit" value="BOOK HERE"><p>

</form></td></tr>

So.. are you asking how you can get rid of your error on line 7 of "book here1.php"? If yes, could you share with us what's on line 7 of that file? If no, could you please (re)phrase your question?

The problem is probably in this line:

$start =mysql_real_escape_string($_POST['start']);

$_POST['start'] is set if user selects one of the radio buttons (booking time). If user does not select any button you have to display an error message, but you have to test for it first:

if(isset($_POST['start'])) {
    $start =mysql_real_escape_string($_POST['start']);
} else {
    die( " please enter the time .<a href='../3D The Croods.php'>click here to choose time</a>");
}

And another thing: I thing it is not a good idea to have php script names with spaces in them.

in line7 i'm creat database
start time

Notice: Undefined index: start in C:\wamp\www\cinema3\movies\films\booking\book here1.php on line 7

This error says that index named start does not exist in some array (most probably $_POST). I expect it is this line that is causing troubles:

$start =mysql_real_escape_string($_POST['start']);

See my post above for the solution.

the same error
i think my problem in my database how identify time in database?
i'm create table call it time it contain
start time

Member Avatar for diafol

Why don't you start again? List your fieldnames and datatypes for your table(s). Also show your complete code if relevant. At the moment we've got a letterbox view of it.

hi i'm change my code but still i have problem when i don't choose time still i have error
the error is undnified index start and they echo the username without time i want if i dont choose time they will get a message please choose time how i do that? here my code

<?php
session_start();
    if($_SESSION['start'])
{
    if(isset($_POST['submit']))
    {
    $start=$_POST["start"];


echo "<var>you Are Booking At:".$start."</var>";
echo"<p>";

echo "<var>3D THE CROODS has been booked as:</var>".$_SESSION['username'];
echo"<p>";
echo date("Y/m/d") ."<br>";
    }
    else

         {
          echo " please enter the time .<a href='../3D The Croods.php'>click here to choose time</a>";

         }
}




and here my code form action


            <tr><td><center><form action="booking/book.php" method="post">
<input type="radio" name="start" value="18:00:00">18:00
<input type="radio" name="start" value="20:00:00">20:00
<input type="radio" name="start" value="22:00:00">22:00<p>

  <input type="submit" name="submit" value="BOOK HERE"><p>

</form></td></tr>






?>

Change line 5 to:

if(isset($_POST['submit']) && isset($_POST['start']) {
    ...

thanxxxxx alottt my problem is solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.