Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Ah, I finally got that...thanks for correcting the typo.
  2. Hey, I didn't name the function. You can thank the developers of PHP. I am a Goonies fan, however, so "chunk" works for me.
  3. In case you're interested, array_chuck() could be used to break the column groups. This doesn't require a counter. For an example which closely relates to your question, check out http://www.cyberscorpion.com/2013-08/build-html-tables-dynamically-with-php-part-2-simplify-with-array_chunk/
  4. If you're looking to print a PDF (vs opening it), have you looked into JavaScript? You may find something that works here: https://www.google.com/search?q=javascript+print+pdf
  5. Side note: when fetching results, you could use mysql_fetch_assoc() instead of modifying mysql_fetch_array(). http://www.php.net/manual/en/function.mysql-fetch-assoc.php For example: while($row = mysql_fetch_assoc($retval)) Also, you're probably already aware that the mysql_ functions have been depreciated. If not, you should start looking into a different API: http://www.php.net/manual/en/mysqlinfo.api.choosing.php
  6. An example of using exit after a header call can be found in the manual: http://php.net/manual/en/function.header.php
  7. To know which radio was selected, each option needs to have it's own value. The code currently has all the values set as "Average". <p> <label>Average</label> <input name="Average" type="radio" value="Average" checked="checked" /> <br /> <label>Total</label> <input name="Average" type="radio" value="Average" /> <br /> <label>Both</label> <input name="Average" type="radio" value="Average" /> </p>
  8. When the "NEXT PHRASE" button is clicked, you don't actually update the phrase counter until the end of the script. The script, however, needs $nextPhrase to be updated prior to this line: $word = $theText[$nextPhrase];
  9. For the referral URL, you could try the $_SERVER variable using 'HTTP_REFERER': http://php.net/manual/en/reserved.variables.server.php
  10. No problem. When posting the newer code, please surround each code block with tags. They make the code (and your post) easier to read.
  11. When uploading files, you would use the http://php.net/manual/en/reserved.variables.files.php'>$_FILES variable instead of $_POST. Perhaps the following tutorial will help: http://www.tizag.com/phpT/fileupload.php
  12. Are we still talking about a parse error...or is this a new question? Also, please surround your code blocks with tags. It makes the post (and code) easier to read.
  13. As Ch0cu3r suggested, the MySQL query needs to be executed prior to displaying the <title> tag. In the code shown above, the query appears to be after the page title.
  14. I have marked the topic as solved. If you need anything else, please mark it as unsolved...or start a new topic.
  15. Or instead of duplicating variables, you could just use the array. Instead of <span class="overview-heading">$tour_name</span><br /><br /> ...you could use the value from $a: <span class="overview-heading">{$a['tour_name']}</span><br /><br />
  16. It sounds like you're trying to create fixed-width website which is centered on the page. Here's a quick tutorial on how to do that: http://davidwalsh.name/center-website The brown pattern could then be added as a background to the <body> tag.
  17. Side note: the foreach loop isn't necessary. In the following code, the while loop won't execute if there isn't any data: <?php while($row = $result->fetch_array()) { $date = $row['date']; //... } ?>
  18. I have marked the topic as solved. If you need anything else, please mark it as unsolved...or start a new topic.
  19. Congrats!
  20. I have marked the topic as solved. If you need anything else, please mark it as unsolved...or start a new topic.
  21. I don't really use IE anymore (besides for testing), so I would imagine it's using the default settings. As for comparing settings, the following are the same for me: "Check for newer versions of stored pages" is set to "Automatic". "Allow website caches and databases" is checked.
  22. For what it's worth, the following link shows the comparison operators in PHP: http://php.net/manual/en/language.operators.comparison.php Can this topic be marked as solved?
  23. I have marked the topic as solved. If you need anything else, please mark it as unsolved...or start a new topic.
  24. Are you referring to the backticks in the code below? $fields='`'.implode('`, `', $func_get_args).'`'; If so, they're necessary if a column is named "desc"...or one of the other reserved words in MySQL.
  25. I would suggest grabbing both of the new entries at the same time. $sql="SELECT * FROM $tbl_name ORDER BY id DESC LIMIT 2"; You could then use a loop to separate the entries to display the divs. Decrementing the $id variable may work for the most part. But what if one of the row IDs gets removed?
×
×
  • 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.