Jump to content
Larry Ullman's Book Forums

Paul_Blackpool

Members
  • Content Count

    68
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Paul_Blackpool

  • Rank
    Advanced Member
  1. Thanks Larry I've managed to fix it. For ref if anyone else is having the same problem: This bit // URL is http:// plus the host name plus the current directory $url = 'http://localhost/tuition'; Should be: // URL is http:// plus the host name plus the current directory: $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); It all works fine now. I couldn't see the wood for the trees as we say in the UK
  2. Sorry to be a pain Larry I've followed all the instruction to the letter and the error I am getting now is Warning: require_once(includes/login_functions.inc.php): failed to open stream: No such file or directory in D:\xampp\htdocs\tuition\loggedin.php on line 9 Fatal error: require_once(): Failed opening required 'includes/login_functions.inc.php' (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\tuition\loggedin.php on line 9 The login pages are <?php # Script 11.1 - login_page_inc.php // This page prints any errors associated with logging in. // and it creates the
  3. Thanks for the reply Larry. The URL is: http://localhost/login.php Hope this helps Also The login.php page is located at C:/xampp/htdocs/tuition The login_page_inc.php and login_functions_inc.php are located at C:/xampp/htdocs/tuition/includes - in the same includes directory as the header and footer. Thanks
  4. Sorry Larry i forgot to include the login.php. <?php // Script 11.3 - login.php // This page processes the login form submission. // Upon successfull login the user is re-directed. // Two include files are required // Send NOTHING to the web browser prior to the setcookie() lines! // Check if the form has been submitted if(isset($_POST['submitted'])) { // For processing the login require_once ('includes/login_functions_inc.php'); // Connect to the database require_once ('conn.php'); // check the login: list ($check, $data) = check_login($dbc, $_POST['email'], $_POST['pass'])
  5. Thanks Larry. I must be doing something wrong here. I have posted the login page and the login script. If i try and login using incorrect credentials i don't get any error messages and if i enter the correct credentials i get no indication i am logged in. Both the login_page.inc.php and the login_functions.inc.php are both in the includes folder as the book tells me to. <?php # Script 11.1 - login_page_inc.php // This page prints any errors associated with logging in. // and it creates the entire login page including the form. // Include the header: $page_title = 'Login'; includ
  6. Sorry to be a pain but I'm a little confused where to enter the server and directory name, also if they should be in upper or lower case. I'm using xampp on localhost and the directory path is D://xampp/htdocs/tuition. If someone could point me in the right direction. I've already tried a number of computations but I must be doing something wrong, i cant seem to get it to work. // Start defining the URL // URL is http:// plus the host name plus the current directory $url = 'http//' . $_localhost['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Remove any trailing slashes: $url = rt
  7. I am having a problem when I click on the link that this script creates. My structure is D://xampp/uploads (This is where the images have been uploaded to) My main files are in D://xampp/htdocs/tuition. When I publish the script in the browser it sees the images in the table I.E.: Image Name - Image Size basketball.jpg 154kb penguins.jpg 89kb I have checked and double checked the code. I have also tried replacing line 46 from $dir = '../../uploads'; // Define the directory to view. to $dir = 'D://xampp/uploads'; // Define the directory to view. But i still g
  8. Just got a little stuck. Iv'e created a form but I cant get the items from my multi select items list into the database. Everything else works fine could just do with a little help. PHP <?php # script 8.5 - register.php # 2 $page_title = 'Register'; include ('../Includes/header.html'); // Check if the form has been submitted: if (isset($_POST['submitted'])) { require_once ('../conn/mysqli_connect.php'); // connect to the database. $errors = array(); // Initialise error array // Check for a first name: if (empty($_POST['first_name'])) { $errors[] = 'You forgot to enter y
  9. I have a multi select combo box on my site. If the user fills in the form wrong the site retains all the information already entered, however the multi select combo box comes back with the selections de-selected. How can I get the combo box to retain the values entered when the user happens to fill something wrong elsewhere on the form? <select name="Skills[]" multiple size="1" id="Combobox1"> <option value="LGV Class 1">LGV Class 1</option> <option value="LGV Class 2">LGV Class 2</option> <option value="7.5 Ton Drivers">7.5 Ton Drivers</option> &l
  10. I am getting to the end of Edition 3 and thinking about Edition 4. What’s the deference or whats new in Edition 4?
  11. Whe I try to upload a file (Chapter 10 file_upload.php) I get the following errors Warning: move_uploaded_file(../tmp/agriculture.jpg): failed to open stream: No such file or directory in C:\xampp\htdocs\trsb\upload_image.php on line 28 Warning: move_uploaded_file(): Unable to move 'C:\xampp\tmp\phpA805.tmp' to '../tmp/agriculture.jpg' in C:\xampp\htdocs\trsb\upload_image.php on line 28 The folder I have created is called "tmp" and I followed the instructions for the local server. here is the line the error is referring to: // Move the file over if(move_uploaded_file($_FILE
  12. Thanks Larry I started Mercury in the xammp control panel and it worked fine
  13. Thanks Larry and Jonathon. I followed the link and also looked at other sites for a soloution and they all tell me to do the same thing but it's still not working. I have posted the relavent bit of the php.ini and also the page code. Don't think the code is wrong as the form all works correctly. [mail function] XAMPP: Comment out this if you want to work with an SMTP Server like Mercury SMTP = mail.me.co.uk sendmail_from = paul@me.co.uk <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http:
×
×
  • Create New...