-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
Problem with while loop and html output
cyberRobot replied to saynotojava's topic in PHP Coding Help
Ah, I finally got that...thanks for correcting the typo. -
Problem with while loop and html output
cyberRobot replied to saynotojava's topic in PHP Coding Help
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. -
Problem with while loop and html output
cyberRobot replied to saynotojava's topic in PHP Coding Help
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/ -
Code to print a PDF file instead of downloading it.
cyberRobot replied to abhishekkian's topic in PHP Coding Help
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 -
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
- 17 replies
-
- mysql
- javavscript
-
(and 1 more)
Tagged with:
-
An example of using exit after a header call can be found in the manual: http://php.net/manual/en/function.header.php
-
Selection with Radio Buttons using a Switch statement
cyberRobot replied to dlmagers's topic in PHP Coding Help
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> -
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];
-
For the referral URL, you could try the $_SERVER variable using 'HTTP_REFERER': http://php.net/manual/en/reserved.variables.server.php
-
No problem. When posting the newer code, please surround each code block with tags. They make the code (and your post) easier to read.
- 8 replies
-
- multipart/form-data
- image
-
(and 1 more)
Tagged with:
-
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
- 8 replies
-
- multipart/form-data
- image
-
(and 1 more)
Tagged with:
-
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.
-
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.
- 13 replies
-
- dynamic title
- problem
-
(and 3 more)
Tagged with:
-
I have marked the topic as solved. If you need anything else, please mark it as unsolved...or start a new topic.
-
why the small cms i made is posting its first post double ?
cyberRobot replied to cyber_alchemist's topic in PHP Coding Help
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 /> -
Storing results from a while loop into a variable?
cyberRobot replied to wright67uk's topic in PHP Coding Help
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']; //... } ?> -
how to get data from db page by page
cyberRobot replied to Pradeep_Chinna's topic in PHP Coding Help
I have marked the topic as solved. If you need anything else, please mark it as unsolved...or start a new topic. -
Select checkbox value does not work in search sql statement
cyberRobot replied to HalRau's topic in PHP Coding Help
I have marked the topic as solved. If you need anything else, please mark it as unsolved...or start a new topic. -
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.
- 6 replies
-
- internet explorer
- background image
-
(and 2 more)
Tagged with:
-
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?
-
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?