Jump to content

dbznss

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dbznss's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thank you very much for all your help haku.
  2. Now that's more what I'm looking for, thank you very much. as of right now I actually am using a header tag: if ($success){ Header("Location: sent.html"); } else{ Header("Location: invalid.html"); }
  3. It's giving me the OMMITAG NO errors because in order for it to work as PHP it has to look like this: <meta http-equiv=\"refresh\" content=\"0;URL=invalid.html\">"; Regardless of whether I do: <meta http-equiv=\"refresh\" content=\"0;URL=invalid.html\" />"; or not it doesn't solve the issue. W3 validator tells me to put it like you mentioned, but then it no longer works as part of the PHP if...else...statement. So the only solution I can see is to replace the meta tag all together with a location line. This is why my post belongs in the PHP section and not HTML.
  4. That line of code won't work. The meta tags were used with an if...else... statement. The PHP was part of an email contact form. If the user didn't fill in the form properly it would send them to invalid.html. If they filled in everything correctly it would send them to sent.html. Simply adding a meta tag in the head wouldn't do the trick, because it's not linked to the if...else... statement. Hence, why this post is PHP and not HTML. Take a look at the finished form. Thank you anyways for trying however.
  5. Actually it wasn't. What I was really asking for was a better line of code for the <meta> PHP line. I should have phrased it better I guess, but I solved the issue on my own anyhow.
  6. The moderator moved my topic out of the PHP section, and into the HTML section. Obviously he didn't read it. A topic you are watching has been moved to another board by thorpe. View the topic at: http://www.phpfreaks.com/forums/index.php?topic=290287.new;topicseen#new Unsubscribe to this topic by using this link: http://www.phpfreaks.com/forums/index.php?action=notify;topic=290287.0 Regards, The PHP Freaks Forums Team.
  7. I do understand meta tags are only allowed in the head section. however, that still does not solve my problem, I still get errors regardless of where I place the code. I still get OMMITTAG NO errors. No matter what I do I can't seem to close those tags. I solved my problem anyhow by replacing the <meta http-equiv="refresh" content="0;URL=invalid.html"> and <meta http-equiv="refresh" content="0;URL=sent.html"> tags with the lines if (!$validationOK) { Header("Location: invalid.html"); exit; and if ($success){ Header("Location: sent.html"); } else{ Header("Location: invalid.html"); } Thank you for the help though.
  8. Heres my code: and Here is a link to the form. http://www.bc-multimedia.com/contact.php <?php $YourEmail = Trim(stripslashes($_POST['YourEmail'])); $MyEmail = "dbznss@gmail.com"; $Subject = Trim(stripslashes($_POST['Subject'])); $Name = Trim(stripslashes($_POST['Name'])); $Phone = Trim(stripslashes($_POST['Phone'])); $Message = Trim(stripslashes($_POST['Message'])); $validationOK=true; if (Trim($YourEmail)=="") $validationOK=false; if (Trim($Name)=="") $validationOK=false; if (Trim($Message)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=invalid.html\">"; exit; } $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Phone: "; $Body .= $Phone; $Body .= "\n"; $Body .= "Message: "; $Body .= $Message; $Body .= "\n"; $success = mail($MyEmail, $Subject, $Body, "From: <$YourEmail>"); if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=sent.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=invalid.html\">"; } ?> The form works perfectly but when validating it with W3 I get these errors. Validation Output: 4 Errors 1. Error Line 39, Column 60: document type does not allow element "meta" here <meta http-equiv="refresh" content="0;URL=invalid.html"> ✉ The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error). 2. Error Line 39, Column 61: end tag for "meta" omitted, but OMITTAG NO was specified <meta http-equiv="refresh" content="0;URL=invalid.html"> ✉ You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">". 3. Info Line 39, Column 5: start tag was here <meta http-equiv="refresh" content="0;URL=invalid.html"> 4. Error Line 39, Column 61: end tag for "html" omitted, but OMITTAG NO was specified <meta http-equiv="refresh" content="0;URL=invalid.html"> ✉ You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">". 5. Info Line 2, Column 1: start tag was here <html xmlns="http://www.w3.org/1999/xhtml"> 6. Error Line 39: Premature end of data in tag html line 2 <meta http-equiv="refresh" content="0;URL=invalid.html"> I just can't seem to solve it. I'm fluent in XHTML and CSS, but only have very basic knowledge in PHP and JavaScript.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.