Jump to content

Search the Community

Showing results for tags 'errors'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 5 results

  1. Did HTML update to where you can't go to a site with a Iframe anymore? If you try to go to a site in a Iframe now you get these errors: 1. Refused to frame 'https://www.w3schools.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' https://mycourses.w3schools.com". 2. Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
  2. I took a Python coding course in college. Basic level, it taught me how to code short, basic programs. This was six months ago. I recently tried to pick coding back up, and decided my first project; a dice game I had an idea for a while back, as a computer program. Problem: I've apparently forgotten how to do just about everything, because I can't even figure out why Pyzo (my program of choice for writing in Python) is throwing an error. All I want to do on the line in question is set a variable to 1. That's all. I've tried changing the variable name, tried putting it in all forms of quotation marks that I could think of. I even tried double equal signs. But: "dice1 = 1" is absolutely against the law, and I can not understand why. I've tried google search. I've tried Youtube for basic learning videos on Python. I tried everywhere I could think of on w3schools. I even tried StackOverflow, but they're very professional, like actual software developers, and that... intimidates me. I'm simply trying to pick this back up as a hobby.
  3. Hello all, I have a PHP contact form that is working fine on localhost. However when I upload it to a liveserver(hostgator) and test it, the user input gets submitted to my email inbox but sends an error message on the browser and refuses to redirect to another page(thank-you page). I am using PHPMailer class to send the form. PHP Form <?php session_start(); //INITIALIZE VARIABLES and set to empty values $name = $phone = $email = $message= $captchaResults= ""; $nameErr = $phoneErr = $emailErr = $checkboxErr= $messageErr= $captchaErr= ""; ini_set('display_errors', 1); error_reporting(E_ALL); if ($_SERVER["REQUEST_METHOD"] == "POST") { $valid = true; //check if name is empty and performs functions in curly brackets if (empty($_POST["name"])) { $valid = false; $nameErr = "Please fill out this field"; } else { //Passes name throught test input function at the bottom of page $name = test_input($_POST["name"]); //remove illegal characters from name , Sanitize data $nm =filter_var($name, FILTER_SANITIZE_STRING); // Validate Data if (!preg_match("/^[a-zA-Z\s,.-]{3,30}$/", $nm)) // Regexp requiring letters, spaces, commas and fullstops and should not exceed 30 letters { $valid = false; $nameErr = "Please don't insert numbers*"; } } //check if phone contains numbers if (empty($_POST["phone"])) { $valid = false; $phoneErr = "Please fill out this field"; } else { $phone = test_input($_POST["phone"]); if (!preg_match("/^[0-9\s(),+.-]*$/", $phone)) { $valid = false; $phoneErr = "Please don't insert letters*"; } } //check if email is valid if (empty($_POST["email"])) { $valid = false; $emailErr = "Please fill out this field"; echo'email is empty<br>'; } else { $email = test_input($_POST["email"]); //Remove all illegal characters from email $em = filter_var($email, FILTER_SANITIZE_EMAIL); if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $em)) { $valid = false; $emailErr = "*Please insert a valid email address*"; } } // Check the values from checkbox and POST them to email $value= ""; // if (empty($_POST["checkbox"])) { $valid = false; $checkboxErr = "Please fill out this field*"; } else{ $checkbox =$_POST["checkbox"]; //Array of values from the checkbox values $value= implode(' , ', $checkbox); //implode values and separate by a comma $value = test_input($value); } //check if message contains letters and white-space if (empty($_POST["message"])) { $valid = false; $messageErr = "Please fill out this field"; echo 'Message is empty<br>'; } else { $message = test_input($_POST["message"]); //remove illegal characters from url $msg =filter_var($message, FILTER_SANITIZE_STRING); if (!preg_match("/^[a-zA-Z\s-,:;`~.?()]*$/", $msg)) //Regexp requiring spaces, full-stops, colon, semi-colons brackets, question marks { $valid = false; $messageErr = "Only letters and spaces are allowed*"; } } //Captcha Results $getRandomNumber1 = $_POST["firstRandomNumber"]; $getRandomNumber2 = $_POST["secondRandomNumber"]; $getCaptchaResults = $_POST["captchaResults"]; $totalNumber= $getRandomNumber1 + $getRandomNumber2; if($totalNumber == $getCaptchaResults){ echo''; } else{$valid = false; $captchaErr="Wrong Answer";} //stores name in a session variable to be used in thank-you page $_SESSION["nm"]= $nm; require ("PHPMailer/PHPMailerAutoload.php"); //including phpmailer class $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->SMTPDebug = 2; $mail->Host = "gator4261.hostgator.com"; // specify main and backup server, $mail->Port = 465; //Gmail SMTP port $mail->SMTPSecure = "ssl"; // Connect using a TLS connection $mail->SMTPAuth = true; // turn on SMTP authorization $mail->Username = "info@myemailaccount.com"; // SMTP username $mail->Password = "****************"; // SMTP password $mail->From = "$em"; //email of sender $mail->FromName = "$nm"; //name of the sender $mail->AddAddress("info@myemailaccount.com", "Petfar Designers"); //email address of recepient and name $mail->AddReplyTo($em, $nm); //Address to which recepient will reply $mail->WordWrap = 100; // set word wrap to 100 characters $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Contact Form"; //subject of email $mail->Body = "Name: " . $nm . "<br>Phone: " . $phone . "<br>Email: " . $em . "<br>Subject: " . $value . "<br>Message: " . $msg ; //$mailphp = false; if ($valid) { // if (!$mailphp) { if (!$mail->Send()) { echo 'Form could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; } else { header('Location:thank_you.php'); } } } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?> thank-you form <?php session_start(); ?> <!DOCTYPE html> <html lang= "en-US"> <head> <title> Thank_you_Page </title> </head> <body> <div class="container2"> <br> <br> <div class="thanks"> <b> Hello <i> <?php echo $_SESSION["nm"]; ?> </i> ,Your Contact form was successfully sent! One of our agents will reply to your query as soon as possible. <br> Thank you for choosing us </b> </div> <br> <br> <a href="contact.php"> Go Back </a> </div> </body> </html> Error message on the browser Warning: Cannot modify header information - headers already sent by (output started at /home4/petansk/public_html/PHPMailer/class.smtp.php:234) in /home4/petansk/public_html/contact.php on line 157 Attached is the class.smtp.php in the PHPMailer classclass.smtp.php
  4. echo '<a href="game.php?id=$row->gameTitle" style="display:block; text-decoration:none;">';
  5. ok i need some help please. Web site looks fine in Firefox But not in IE villagrande-texmex.com the bottom is in white,can someone let me know how i can fix this problem or guide me the correct way '~' Thanks Jay
×
×
  • Create New...