
White_Lily
Members-
Posts
531 -
Joined
-
Last visited
-
Days Won
1
Everything posted by White_Lily
-
Doesn't having 2 queries break the script and show a 500 error? or thats what happens whenever ive done 2 queries in one script...
-
Hi, I want to do a registration form where once submitted will go to "register_handler.php" which will check and insert all the information entered in the form prior to this page. I was wondering how I go about doing 2 SQL queries in one script?
-
Login Script failing with Internal Server Error 500.
White_Lily replied to White_Lily's topic in PHP Coding Help
Thank you darkfreaks, that code seems to work -
Login Script failing with Internal Server Error 500.
White_Lily replied to White_Lily's topic in PHP Coding Help
I don't have access to the web-server :/ -
Login Script failing with Internal Server Error 500.
White_Lily replied to White_Lily's topic in PHP Coding Help
this is iwhat is in my php.ini file at the moment: error_reporting = -1 display errors = On upload tmp dir = /tmp/ -
Login Script failing with Internal Server Error 500.
White_Lily replied to White_Lily's topic in PHP Coding Help
If session_register() can't be used, what else do i use? In the php.ini file how do i turn on error reporting? -
Login Script failing with Internal Server Error 500.
White_Lily replied to White_Lily's topic in PHP Coding Help
The little guy: The connection is brought in further up the page in the header - this works as the other pages are fine with the connection. PFM: Read my original question AGAIN and you will see ive already tried error reporting >_> -
Try replacing "===" with "==" i think you may have to many equal signs when your checking to see if one is equal to another.
-
Okay - so i wrote a login script for a site im building. However when you click "Login" it goes to a login-handler.php script, which seems to only show an Internal Server Error 500. I've tried using error checking to no success as it still shows the same screen. I'm hoping someone will be able to tell me what I have done wrong. <?php $log_user = $_POST["username"]; $log_pass = $_POST["password"]; if(empty($log_user)) { die "Please go back and fill in your username."; } if(empty($log_pass)) { die "Please go back and fill in your password."; } $sql = "SELECT * FROM users"; $res = mysql_query($sql); if(mysql_num_rows($res) != 0) { $row = mysql_fetch_assoc($res); $dbuser = $row["username"]; $dbpass = $row["password"]; if($log_user != $dbuser) { echo 'Please go back and enter a valid username.'; } if($log_pass != $dbpass) { echo 'Please go back and enter a valid password.'; } if($log_user == $dbuser && $log_pass == $dbpass) { session_register($log_user); session_register($log_pass); header("Location: index.php"); } } else { echo "There doesn't appear to be any users in the database."; } ?>
-
im just saying it may be worth searching the web for a different hashing method, never know - the different one may even be better
-
Ive read through this quite carefully and like you i can't see any errors, however the script does look a bit awkward in the way of proccessing - maybe try searching the web for a pre-built secure login system, and just modify it to suit your needs - you may even find videos on youtube which you can follow, this way your learning to.
-
getting 500 internal server error - not sure why
White_Lily replied to White_Lily's topic in PHP Coding Help
Anyway - a few errors poped up with your code, however i fixed them and my problem is solved. Fixed code: <?php include "sql/conf.php"; include "sql/connect.php"; $page = "Welcome"; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[url=http://www.w3.org/TR/html4/loose.dtd]http://www.w3.org/TR/html4/loose.dtd[/url]"> <html> <head> <title><?php echo $GLOBALS["siteName"]." - ".$page; ?></title> <link rel="stylesheet" type="text/css" href="css/main.css"> <link rel="stylesheet" type="text/css" href="css/sub-css.css"> <link rel="stylesheet" type="text/css" href="css/tags.css"> </head> <body> <div class="wrapper"> <div class="header"> <div class="head"> <img src="images/logo.png" alt="HTML Bites Logo"> <> <> <div class="sub-wrapper"> <div class="navigation"> <div id="navigation"> <a href="index.php">Home</a> <a href="#">News</a> <a href="#">Gallery</a> <a href="#">Tutorials</a> <a href="#">Downloads</a> <a href="#">Contact</a> <> <> <div class="content"> <div class="center-column"> <?php //$page_name = $_POST['page']; $sql = 'SELECT * FROM pages WHERE title = "'.$page.'"'; $res = mysql_query($sql); while($row = mysql_fetch_assoc($res)) { $title = $row["title"]; $content = $row["content"]; echo "<h1>".$title."</h1>"; echo $content; } if(mysql_num_rows($res) == 0) { echo "<h1>Oops...</h1>"; echo "<p>This page doesn't appear to exsist!</p>"; echo "<p>Use the 'Quick Contact' box to contact the webmaster and tell them about the page you are requesting.</p>"; } ?> -
getting 500 internal server error - not sure why
White_Lily replied to White_Lily's topic in PHP Coding Help
my $page variable is always defined before the doctype, this way i can use it in the pages <title> tags. -
getting 500 internal server error - not sure why
White_Lily replied to White_Lily's topic in PHP Coding Help
wont "$_POST["page"]" only work if there was a form prior to this line? -
getting 500 internal server error - not sure why
White_Lily replied to White_Lily's topic in PHP Coding Help
the connection is established in "connect.php". thanks premiso the page is now displaying however its is now echoing the "else" statement - the rows that were specified do actually exsist in the database. and they have content. http://tutorials.janedealsart.co.uk <-- This is the "else" statement im getting. -
Hi, I made a bit of code that would get a pages title and content from a database, however every time i put this bit of code into the file, and upload that file, i then get an "Internal Server Error (500)". Whereas if i take the code out, and uplaod the file - the webpage is fine? <?php $sql = "SELECT * FROM pages WHERE title = '$page'"; $res = mysql_query($sql); if($row = mysql_fetch_assoc($res) { $title = $row["title"]; $content = $row["content"]; echo "<h1>".$title."</h1>"; echo $content; } else { echo "<h1>Oops...</h1>"; echo "<p>This page doesn't appear to exsist!</p>"; echo "<p>Use the 'Quick Contact' box to contact the webmaster and tell them about the page you are requesting.</p>"; } ?> Not sure where ive gone wrong.
-
i don't remember saying anything about column-width >_> i said try setting heights: e.g: "min-height: px;" and "height: auto;" <-- nothing there about column-width >_>
-
Forget this - I managed to find a different way to do it.
-
Hi, I have written some code that once the form prior to this page is completed and submitted should update the users password. Problem im having is that everytime i submit the form for testing, it comes up with a blank page, which is usually a Internal Server Error 500. However i cannot see where the code has gone wrong! Any help appreciated. <div class="form_form"> <?php $old = $_POST["old"]; $new = $_POST["new"]; $conf = $_POST["conf"]; if(!$user && !$pass) { echo "You need to be logged in to change any passwords."; } else { $sql = "SELECT * FROM members WHERE password = '$old'"; $res = mysql_query($sql); $row = mysql_fetch_assoc($res); if($old != $row["password"]) { die "The old password you provided did not match the database, go back and try again."; } if($new != $conf) { die "The new passwords you entered did not match each other, go back and try again."; } $sql = "UPDATE members SET password = '$new' WHERE password = '$old'"; $res = mysql_query($sql); if(!$res) { die "Could not update your password. Error: ".mysql_error(); } else { echo "You password has been changed."; } } ?> </div>
-
I can only answer the first question, i dont tend to work with mobile devices so the second question is out of my knowledge. as for the width of the sub-nav, try setting the width to something like 100-150px, and set the height to auto, this way anything longer should just stretch to two lines.
-
I dont like using blob. i tend to use VARCHAR in phpMyAdmin, and it works fine for me. and from what my code is the php is pretty simple, although im using the code for avatars and banner images. What i do is store the image in a directory, and the filename in the database.
-
okay - simple thing to solve. In the CSS file replace "float:left;" with: margin: auto;
-
the only reason they are like that is because when they were in one file everytime i had to work on say... the footer, id have to scroll for 10 minutes until i got to where i wanted. Plus all thos files will be needed on almost all pages, but i will consider what you said for where they dont apply.
-
Just needing to ask - is it a bad thing to have lots of CSS files in the header? <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS["siteUrl"]; ?>/css/whole_design.css"> <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS["siteUrl"]; ?>/css/navigation.css"> <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS["siteUrl"]; ?>/css/content.css"> <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS["siteUrl"]; ?>/css/latest.css"> <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS["siteUrl"]; ?>/css/category.css"> <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS["siteUrl"]; ?>/css/footer.css">
-
well in that case then you need to take the