Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. There needs to be a space between the WHERE and LIMIT clauses. <?php $query .= "WHERE id=$subject_id "; //<-- added a space here $query .= "LIMIT 1"; ?>
  2. Have you considered jQuery? Here is an example timepicker plugin: http://trentrichardson.com/examples/timepicker/ ...or you could try some other options: https://www.google.com/search?q=jquery+timepicker
  3. Variables don't work in single-quoted string. The quotes can be removed altogether. <?php fwrite($fp, $player_name); ?>
  4. I have marked the thread as solved. If you need anything else, please mark it as unsolved...or start a new thread.
  5. Perhaps the message is being flagged as spam. Has the form been found by spammers yet? Another thing to consider is that your website host may have been flagged as a spammer. With the email solution being flaky, have you considered an alternative? You could, for example, save the RSVPs to a text file or database. It may not be as convenient as email, but it's more reliable. Even if you continue using the e-mail solution, I would recommend that you also save the message to a database/file for backup purposes. Side note: PHP provides a filter for email addresses: http://php.net/manual/en/filter.examples.validation.php
  6. Sorry, I'm a little confused as to what you're asking. It sounds like you already have a upload process up and running. It also sounds like pictures have already been uploaded using this solution. Now it sounds like you're trying to create a separate solution for viewing the uploaded images...is that correct? If so, have you considered using the <select> tag? http://www.tizag.com/htmlT/htmlselect.php The tag could be populated from a database...or a solution like vinny42 suggested.
  7. Try removing the quotes: http://php.net/manual/en/language.types.null.php
  8. Is there any JavaScript associated with the form? There may be some code over-ridding the action attribute.
  9. I marked the topic as solved. If you need anything else, please mark it as unsolved or start a new thread.
  10. Is that the exact code from validering-navn.php? If so, you need to include the open PHP tag. <?php //<-- ADD THIS function validerFornavn($fornavn) { //... ?>
  11. Could you provide a little more information as to why you're trying to call two different scripts? If there isn't a way to merge those scripts, have you considered just calling the first script. Once that script successfully executes, use the header() function to redirect them to the second script. Of course, you would need to pass the form data with the redirect.
  12. If you're looking to display the form when $number1 doesn't match $number2, just put the form in the if portion. <?php $number1 = "01234"; $number2 = "012345"; if($number1 != $number2) { //if they don't match output the following //echo "info do not match. Please try again."; ?> <form method="post" name="change"> <p>Number 1 Info<br /> <input type="text" name="number1" /> </p> <p>Number 2 Info<br /> <input type="text" name="number2" /> </p> <p> <input name="submit" type="submit" value="Check if they match" /> </p> </form> <?php } else { //if they match output the following echo "Info matched Successfully!"; exit(); } ?>
  13. The PHP manual shows how to use mysql_real_escape_string(). It also provides an example SQL Injection Attack which could be used against an unprotected query. http://php.net/manual/en/function.mysql-real-escape-string.php Side note: the mysql_ functions are officially depreciated. If you're not doing so already, you should start considering the alternatives: http://www.php.net/manual/en/mysqlinfo.api.choosing.php
  14. No problem, glad to help. Note that I marked the topic as solved. If you need further assistance, please mark it as unsolved or start a new thread.
  15. Now I didn't look at all the CSS, but the menu seems to work with the following changes: Under ".dropdown-menu li a", add "width:205px;" Under "#menu a", change the text-align property to "left" Add a ".dropdown-menu li a:hover" option and add "width:205px;" Note that I don't know what that does with the rest of the website. You'll have some cleaning up to do...and some testing.
  16. First, radio buttons should have the same name. There's no need for the array format. Also, you wouldn't need to escape all those double quotes, if the input tags are enclosed in single quotes. Double quoted strings are only needed if the string contains things like variables or other special characters (\r). <?php //... foreach($marketingimportance2 as $marketingimportance){ $marketingvalueOutput .= '<input type="radio" class="radio" name="marketingimportance" value="' . $marketingimportance . ' \>' . $marketingimportance . " \r"; } //... ?> With the radio buttons having the same name, you can use a single POST variable to populate the radio buttons. Here's a quick example (note that you'll need to adapt it for your own code): <form method="post" action=""> <?php $marketingimportance2 = array('this', 'that'); foreach($marketingimportance2 as $marketingimportance){ print '<input type="radio" class="radio" name="marketingimportance" value="' . $marketingimportance . '"'; if(isset($_POST['marketingimportance']) && $_POST['marketingimportance']==$marketingimportance) { print ' checked="checked"'; } print ' />' . $marketingimportance . " \r"; } ?> <input type="submit" name="submit" /> </form>
  17. Have you used $_GET variables before? http://php.net/manual/en/reserved.variables.get.php If the GET variable is found, you would display the corresponding article. Otherwise, you would display the list of articles.
  18. For generating the map, have you considered something like jVectorMap: http://jvectormap.com/examples/mall/
  19. Did you see the responses to the same question you asked yesterday? http://forums.phpfreaks.com/topic/281862-passing-a-get-value-with-out-href-links/ If these don't work, it might help if you provide a little more information on what you're trying to accomplish.
  20. Moving to PHP forum. To hide empty cells, you could do something like <?php echo '<tr>'; if(!empty($row['CUST_ID'])) { echo "<td>{$row['CUST_ID']}</td>"; } //... echo '</tr>'; ?>
  21. That would be more of a PHP question then, would you like me to move the topic? Are you trying to remove the entire row if all the cells are empty...or are you just wanting to remove individual cells that is empty?
  22. I marked the topic as solved. If you need further help, you can mark it as unsolved...or start a new topic.
  23. It's actually "empty-cells:hide;" https://developer.mozilla.org/en-US/docs/Web/CSS/empty-cells
  24. No problem, glad to help. Side note: Perhaps you are already aware of this, but the mysql_ functions have been depreciated. More information about the alternatives can be found here: http://www.php.net/manual/en/mysqlinfo.api.choosing.php
  25. @wmeredith - When posting code, please surround it with tags. This places the code in a scrolling box and makes it easier to read.
×
×
  • 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.