laado Posted June 4, 2009 Share Posted June 4, 2009 in php is there any way to add frams on web page. if yes then what is the code? Link to comment Share on other sites More sharing options...
smerny Posted June 4, 2009 Share Posted June 4, 2009 echo "<frameset cols="25%,75%"> <frame src="frame_a.htm"> <frame src="frame_b.htm"></frameset>"; Link to comment Share on other sites More sharing options...
laado Posted June 4, 2009 Author Share Posted June 4, 2009 i write the following code<?phpecho"<frameset cols="25%,75%"><frame src="left.php"> <frame src="main.php"></frameset>";?>but it gives following errorParse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in C:\Program Files\VertrigoServ\www\fram.php on line 3whts wrong? Link to comment Share on other sites More sharing options...
smerny Posted June 4, 2009 Share Posted June 4, 2009 sorry, don't put double quotes around things within the echo quotesfor example, '25%,75%'btw, with php, the echo is just what the php is telling to display as html to the web browser Link to comment Share on other sites More sharing options...
laado Posted June 4, 2009 Author Share Posted June 4, 2009 Thanx for help. now i have another problem related to loginthe code for login is <?php//Database Information$dbhost = "localhost";$dbname = "news";$dbuser = "phpuser";$dbpass = "phppass";//Connect to databasemysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());mysql_select_db($dbname) or die(mysql_error());session_start();$username = $_POST[‘username’];$password = md5($_POST[‘password’]);$query = “select * from users where username=’$username’ and password=’$password’”;$result = mysql_query($query);if (mysql_num_rows($result) != 1) {$error = “Bad Login”; include “login.html”;} else { $_SESSION[‘username’] = “$username”; include “memberspage.php”;}?> it gives following errorParse error: syntax error, unexpected T_STRING in C:\Program Files\VertrigoServ\www\example\login.php on line 19 whts wrong in sql statement? sorry, don't put double quotes around things within the echo quotesfor example, '25%,75%'btw, with php, the echo is just what the php is telling to display as html to the web browser Link to comment Share on other sites More sharing options...
Synook Posted June 4, 2009 Share Posted June 4, 2009 You're using the wrong type of quotes, they need to be the "straight" ones. Link to comment Share on other sites More sharing options...
laado Posted June 4, 2009 Author Share Posted June 4, 2009 i change quotes but problem not solved Link to comment Share on other sites More sharing options...
laado Posted June 4, 2009 Author Share Posted June 4, 2009 now the error comesWarning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\VertrigoServ\www\example\login.php on line 24 i change quotes but problem not solved Link to comment Share on other sites More sharing options...
laado Posted June 4, 2009 Author Share Posted June 4, 2009 now the error comesWarning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\VertrigoServ\www\example\login.php on line 24 You're using the wrong type of quotes, they need to be the "straight" ones. Link to comment Share on other sites More sharing options...
smerny Posted June 4, 2009 Share Posted June 4, 2009 $query = "select * from users where username='".$username."' and password='".$password."'"; Link to comment Share on other sites More sharing options...
laado Posted June 4, 2009 Author Share Posted June 4, 2009 now the error comesWarning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\VertrigoServ\www\example\login.php on line 24line 24 is if (mysql_num_rows($result) !=1) { $query = "select * from users where username='".$username."' and password='".$password."'"; Link to comment Share on other sites More sharing options...
justsomeguy Posted June 4, 2009 Share Posted June 4, 2009 That error means the query is failing, the SQL query has an error in it. You can use mysql_error to get the error message.$result = mysql_query($query) or exit(mysql_error()); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.