Jump to content
Larry Ullman's Book Forums

tri

Members
  • Posts

    5
  • Joined

  • Last visited

tri's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi! It is now solved! Actually I had deleted XAMPP and reinstalled it because of some Mysql problems. Then I forgot that the database were all affected. As a solution I had to create all the databases again. Thanks a lot. Tri.
  2. Hi! I have been working in Script 12.6 but when I try to run it I get the message below: Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in C:\xampp\htdocs\23_view_entry_v5.php on line 19 will you please help me? For further details please chech the attached file. all the best! Tri. 23_view_entry_v5.php
  3. Hi, Larry. Sorry for my late feedback. I am using Windows 7 and my e-mail from gmail but I cann´t just the email. Please see below the last message I got: Warning: mail(): SMTP server response: 553 We do not relay non-local mail, sorry. in C:\XAMPP\htdocs\19_register_v12.php on line 51 Thanks a lot, AT.
  4. Hi, I am using Xampp 3.2.2 and have written script 8.10 below (Page 228) but I just can´t get an e-mail. Everything looks fine but I get no e-mail at all. PIease help! <?php // Script 8.10 - 19_register.php /*This page lets people register for the site in theory*/ //Set the page title and include the header file: define ('TITLE', 'Register'); include ('templates/19_header_v6.html'); //print some introductory text: print '<div id = "leftcontent"> <h2>Registration Form</h2> <p>Register so that you can take advantages of certain features like this, that and the other thing.</p>'; //Check whether the form has been submitted (handle form if): if ($_SERVER['REQUEST_METHOD'] =='POST'){ $problem = false; //Check for each value: if (empty ($_POST['first_name'])){ $problem = TRUE; print '<p class="text--error">Please enter your first name!</p>'; } if (empty ($_POST['last_name'])){ $problem = TRUE; print '<p class="text--error">Please enter your last name!</p>'; } // Change the email validation(from 19_rigister_v11.php file) so that it also checks for a single "at" symbol: if (empty ($_POST['email']) || (substr_count ($_POST['email'], '@')!=1)){ $problem = TRUE; print '<p class="text--error">Please enter your email!</p>'; } //Validate the password: if (empty ($_POST['password1'])){ $problem = TRUE; print '<p class="text--error">Please enter your password!</p>'; } if ($_POST['password1'] != $_POST['password2']){ $problem = TRUE; print '<p class="text--error">Your password did not match your confirmed password!</p>'; } // Check whether a problem occured: if (!$problem){ print '<p>You are now registered!<br />Okay, you are not really registered but ...</p>'; //Send the email: $body = "Thank you, {$_POST['first_name']}, for registering with the J.D. Salinger fan club!"; mail($_POST['email'], 'Registration Confirmation', $body, 'From:me@example.com'); }else{ //Forgot a field print '<p>Please try again!</>'; } /*if (!problem){ // if there weren´t any problems ... print '<p class ="text--success">You are now registered!<br />Okay, you are not really registerd but ...</p>'; //$_POST = []; }else{//Forgot a field: print '<p class = "text--error">Please try again!</p>'; }*/ } // End of handle form if: if ($_SERVER['REQUEST_METHOD'] =='POST'){ ?> <!--Display the form--> <form action="19_register_v12.php" method="post" class="form--inline"> <!-- Create the sticky first name, last name and email inputs--> <p><label for="first_name">First Name: </label><input type="text" name="first_name" size="20" value="<?php if (isset($_POST['first_name'])){ print htmlspecialchars($_POST['first_name']); }?>"></p> <p><label for="last_name">Last Name: </label><input type="text" name="last_name" size="20" value="<?php if (isset($_POST['last_name'])){ print htmlspecialchars($_POST['last_name']); }?>"></p> <p><label for="email">Email Address: </label><input type="email" name="email" size="20" value="<?php if (isset($_POST['email'])){ print htmlspecialchars($_POST['email']); }?>"></p> Password: <input type = "password" name = "password1" size = "20"/><br /><br /> Confirm Password: <input type = "password" name = "password2" size = "20" /><br /><br /> <p><input type="submit" name="submit" value="Register!" class="button--pill"></p> </form> <?php print '</div>'; require ('templates/19_footer_v6.html'); ?>
  5. Considering the last line: Divided over <span class=\"number\">$payments</span> monthly payments, that would be $<span class=\"number\"$monthly</span> each.</p>"; Add: > before $monthly That would now be: <span class=\"number\">$monthly</span> All the best! Tri.
×
×
  • Create New...