nav33n 472 Purple hazed! Team Colleague Featured Poster

It depends on how you want to design the page ! You can have checkboxes to select the desired dates. These checkboxes should hold the id of the dates. Then when the user clicks on "Book", it should fetch the date and time from the available_dates (?) table for that particular id and insert it to the booking table.

nav33n 472 Purple hazed! Team Colleague Featured Poster

-828

nav33n 472 Purple hazed! Team Colleague Featured Poster

sad
just
men

Component

nav33n 472 Purple hazed! Team Colleague Featured Poster

So, you say she is dumb ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

-826

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Welcome to Daniweb Russel and Vouge!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Check this out. http://www.irt.org/script/29.htm . You can have an onblur event for the textbox and then call the function. You can validate if age < 16 in the function. If true, return false. Else continue.

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Lol..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep. This is correct. But, its a good practice to have column name in your insert query. And also, Dont execute your query directly. Store the query in a variable and then execute it. This way, if you encounter any problem, you can easily print the query for manual testing.
ie.,

$query = "insert into table1 (col1) values ('ttt')";
mysql_query($query);

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

during each while loop, print out what's in $sum.

while($a_row= mysql_fetch_assoc($result)) {
echo "<tr><td style=\"color:Black\">".$a_row
['DayofWeek']."</td>".
"<td style=\"color:Black\">".$a_row['Bookingdate']."</td>".
"<td style=\"color:red\">".$a_row['Total']."</td></tr>";
$sum=$sum+$a_row['Total'];
echo $sum;
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

Check your query. Print it out and execute it in phpmyadmin /mysql. Maybe the query is wrong. And, what is $sql in insert.php ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Have another variable which adds $a_row value.

$sum=0;
while($a_row= mysql_fetch_assoc($result)) {
echo "<tr><td style=\"color:Black\">".$a_row['DayofWeek']."</td>".
"<td style=\"color:Black\">".$a_row['Bookingdate']."</td>".
"<td style=\"color:red\">".$a_row['Total']."</td></tr>";
$sum=$sum+$a_row['Total'];
}

By the end of the loop, $sum will have the total of $a_row.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Have a form. When he clicks on the button, do the validation.

if(isset($_POST['submit'])){
//check if the session is set
if set, redirect to the correct page 
 else , redirect to login page
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

:) You are welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Then something is wrong with the 2nd page. Try this instead.

<?php
   session_start();
  ?>
<html>
<head></head>
<body>
<?php
$hostname = "";
$username = "";
$password = "";
$dbid = "";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$myusername=$_REQUEST['myusername'];
$mypassword=$_REQUEST['mypassword'];
$sql="SELECT username,password FROM login WHERE username='$myusername' and password='$mypassword' and type='0'";
$result=mysql_query($sql);
// If result matched $myusername and $mypassword, table row must be 1 row
if(mysql_num_rows($result) > 0) { // that means, a record exists for that username and password
// Register $myusername, $mypassword and redirect to file "login_success.php"
$_SESSION['un']=$myusername;
print "<script>";
print " window.location='http://www/web.com/z_login2.php'";
print "</script>"; 
}
else
{
 print "<script>";
print " window.location='http://www.web.com/z_login.html'";
print "</script>";  
}
?>
</body>
</html>
nav33n 472 Purple hazed! Team Colleague Featured Poster

-823

nav33n 472 Purple hazed! Team Colleague Featured Poster

-821

nav33n 472 Purple hazed! Team Colleague Featured Poster

take off the exit in 3rd page. put it after header.

nav33n 472 Purple hazed! Team Colleague Featured Poster

-818

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. What exactly is the error ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

i dont see session_start in page2 ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Start learning php from w3schools !
http://www.w3schools.com/php/php_intro.asp . You can install wamp or xamp . Its a package which consists of apache, php and mysql. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Btw, turn on error reporting in php.ini file or put

ini_set("display_errors","on"); 
error_reporting(E_ALL);

in your script. This will display any errors in your script.

nav33n 472 Purple hazed! Team Colleague Featured Poster

huh!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb ! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

-816

nav33n 472 Purple hazed! Team Colleague Featured Poster

brace
bar
race

Outstanding

nav33n 472 Purple hazed! Team Colleague Featured Poster

-813

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Welcome to Daniweb James!

(know this i dont use periods all the time unless made to )

Lol..Why not ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. AFAIK, only mysql uses port 3306. To check what ports are being used, open command prompt and type netstat -ab. It ll list all the applications and the ports used by those applications.

Maybe that port is blocked by your firewall ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

The script which displays the captcha (image).

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you post the code ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

-811

nav33n 472 Purple hazed! Team Colleague Featured Poster

-809

nav33n 472 Purple hazed! Team Colleague Featured Poster

-807

nav33n 472 Purple hazed! Team Colleague Featured Poster

-805

nav33n 472 Purple hazed! Team Colleague Featured Poster

Direct
toy
troy

Playstation

nav33n 472 Purple hazed! Team Colleague Featured Poster

As Suomedia has already mentioned, Joomla is easy to setup and use !

nav33n 472 Purple hazed! Team Colleague Featured Poster

The problem is quite clear in the error that was generated:

No database selected

Matti Ressler
Suomedia

Do you have mysql_select_db in your script ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Cool !

nav33n 472 Purple hazed! Team Colleague Featured Poster

-798

nav33n 472 Purple hazed! Team Colleague Featured Poster

Here is a simple example.
This is test.php

<html>
<head>
<script type="text/javascript">
function popup(){
	window.open("popup.php","100","100");
}
</script>
</head>
<body>
<form name="test">
<a href="#" onclick="javascript:popup();">Login</a>
</form>
</body>
</html>

And this is the popup.

<html>
<head>
<?php
if(isset($_POST['submit'])){
if($_POST['name'] == "test") {
	echo "<script type='text/javascript'>window.opener.location='test2.php'</script>";
} else {
	echo "<script type='text/javascript'>window.opener.location='http://www.google.com'</script>";
}
}
?>
</head>
<body>
<form method="post" action="popup.php">
Name: <input type="text" name="name"><br />
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

In the popup, if the user inputs name as test, it will redirect the parent window to test2.php and if its wrong, it will redirect to google.com :)
Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Any programmer with a good logic can write good programs! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

You aren't executing the create table query.

$sql = "CREATE TABLE images (imageID int NOT NULL AUTO_INCREMENT, Broad1 varchar(50), Broad2 varchar(50), Broad3 varhar(50))";

After this, you need to have mysql_query($sql);

nav33n 472 Purple hazed! Team Colleague Featured Poster

Real programmer ? umm.. Yes, I guess..

nav33n 472 Purple hazed! Team Colleague Featured Poster

There must be a whitespace before <?php . Check it out ! There shouldn't be any whitespace, any echo statements or any html tags before setcookie! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

and view/execute your script by typing http://localhost/path_of_the_file.php (Start apache before running your script!)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Do you have any html tag or any echo statement ? Can you post your code ?