Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Ah, thanks for clarifying!
  2. Huh, I guess I learned something new. I've never heard of method="link", but apparently it makes the form act as a link: http://www.htmlgoodies.com/tutorials/buttons/article.php/3478871/So-You-Want-A-Link-Button-Huh.htm I wonder if it validates...
  3. The form method needs to be GET or POST. http://www.w3.org/TR/html4/interact/forms.html#h-17.13.1 Try changing <form method=LINK To <form method="get"
  4. Also, since you're sending out messages to an e-mail address entered by the user you should be careful of e-mail header injection attacks. http://www.google.com/search?q=php+e-mail+header+injection+attacks&sourceid=ie7&rls=com.microsoft:en-us:IE-SearchBox&ie=&oe=&rlz=1I7ADFA_en
  5. You'll need to add the code inside the if() portion which gets activated after the form is submitted. For example, you could insert it here: <?php ... $msg = "From : $name \r\ne-Mail : $email \r\nSubject : $subject \r\n" . "Message : \r\n$message"; mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"); /* REFRESH CODE HERE */ $replymessage = "Hello $name We have recieved your message ... ?> Just keep in mind that header() must be called before an output is displayed.
  6. You could take a look at header(): http://php.net/manual/en/function.header.php The following example was pulled from the user contributions section: <?php header( "refresh:5;url=wherever.php" ); echo 'You\'ll be redirected in about 5 secs. If not, click <a href="wherever.php">here</a>.'; ?>
  7. Is the unknown sender coming from the last mail() functions: ... $message = "name: $name \nQuery: $message"; mail("$replyemail", "$emessage", "From: $email\nReply-To: $email"); mail("$email", "Message: $subject", "$replymessage", "From: $replyemail\nReply-To: $replyemail"); echo $success_sent_msg; I don't see where $replyemail is being set.
  8. Nevermind, it sounds like switching to lowercase will cause problems with other matches: http://www.phpfreaks.com/forums/php-coding-help/pspell-case-insensitive/
  9. The data is in the $value and $key variables
  10. You could make the word lower case before testing with strtolower() http://php.net/manual/en/function.strtolower.php
  11. As the others have suggested, this should get you closer to what you want: <?php ... foreach($products as $key => $value) { echo "<div>$key ($value)</div>"; } ... ?> Modify to fit your needs.
  12. That should probably be stripslashes
  13. Or nl2br() http://php.net/manual/en/function.nl2br.php
  14. So are you wanting the image to change on the same page as the select box changes...or on the next page after the form is submitted? To change on the same page, you'll need to use something like JavaScript. Otherwise if the image changes on the next page, you can use PHP.
  15. I think the issue starts here: <?php ... $this->fees = new fees(); $this->fees->setts = $this->setts; ... ?> When creating an instance of a class, it should be more like: <?php ... fees = new fees(); fees->setts = 'some value'; ... ?> It might be helpful to review the PHP manual section for classes: http://www.php.net/manual/en/language.oop5.basic.php
  16. Looks like your using the variable "$this" where it's not allowed. If you need help fixing the code, could you post the code?
  17. There, just to reiterate . . . For reference, I said "closest" because you can still get around these solutions. You could for example create a tempory e-mail account, fill out the form, confirm the e-mail, and close the e-mail account.
  18. As far as I'm aware, there isn't a way to make sure an e-mail is valid. The closest solution would be to send them an e-mail that they need to respond to. As silkfire mentioned, REGEX is probably what you're looking for. The resource I turn to for help with regular expressions is: http://weblogtoolscollection.com/regex/regex.php Just keep in mind, that if you use a REGEX solution, visitors can still submit e-mail addresses like "NotReal@BiteMe.com"
  19. To make that part optional, you can add a ? ... ftp:\/\/{1})?((\w+\.) ... Note that the regex doesn't work with the trailing slash like "http://www.google.com/". So you may want to add that too. ... {1,})\w{2,}(\/)?$/i', $url ... So the entire regex would look like: <?php ... preg_match('/^(http(s?):\/\/|ftp:\/\/{1})?((\w+\.){1,})\w{2,}(\/)?$/i', $url); ... ?>
  20. It's a little difficult to tell what the issue is, but it seems you would want to merge the two ifs. If it's not 'portfolio' and not 'windscreen-repair-company', redirect to 404: <?php $referer = $_SERVER['HTTP_REFERER']; if ($referer != 'http://digitalpixels.co.uk/portfolio' && $referer != 'http://digitalpixels.co.uk/windscreen-repair-company') { header('Location: http://digitalpixels.co.uk/404/') ; exit(0); } ?>
  21. I haven't used $_REQUEST['URL'] before, but what do you get if you try something like: <?php echo $_REQUEST['URL']; ?> I would image it will display the entire path and not just the file name. So if you adjust the if statement accordingly it might work.
  22. I don't know what $read->fetchRow($sql); does, but you should be able to get a non-array variable by doing something like: <?php ... $school_id = myArray[0]; ?> or maybe: <?php ... $school_id = myArray['school_id']; ?>
  23. There are various sort functions available in PHP. Have you tried something like this: http://php.net/manual/en/function.sort.php
  24. You can try something like this: <?php ... $numRows = mysql_num_rows($result); if($numRows > 0) { echo '<select name="order">'; for($i=1; $i<=$numRows; $i++) { echo "<option value='$i'>$i</option>"; } echo '</select>'; } ?> Note that the code is untested.
  25. I usually don't have a problem with "smart" quotes from Word, but you could try replacing them. For example, you could replace ’ with '.
×
×
  • 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.