Forum: PHP Aug 20th, 2009 |
| Replies: 7 Views: 705 If you want to update the page without reloading it you will have to use client side scripts such as Javascript. (PHP is a server side language and so all the php is executed before the page is sent... |
Forum: PHP Jul 19th, 2009 |
| Replies: 10 Views: 491 Holy Moley, you'll hate your self for this :P You forgot a crucial line: mysql_query($sql); which should go on line 16. As your code stands, it doesn't execute the new SQL command, just sets the $sql... |
Forum: PHP Jul 19th, 2009 |
| Replies: 20 Views: 1,223 The easiest way to do this would be to set a column "lastactivity" to the current time every time the user loads any of your pages (just build it into your authentication script). You can then... |
Forum: PHP Jan 14th, 2009 |
| Replies: 2 Views: 668 Using any program that can use sockets you can do this. If you have php installed on your computer then that's easy. I have done it with Game Maker (using 39dll) before.
What you need to do is... |
Forum: PHP Dec 23rd, 2008 |
| Replies: 4 Views: 1,230 Ok, first off I'd direct my form to a page of my own, say "submit.php", which would store the data passed to it into the database and then (before echoing any data to the page) use header() to... |
Forum: PHP Nov 6th, 2008 |
| Replies: 13 Views: 2,030 In php, if you try to perform an operation on $start_time (assuming that it is a variable in the script containing a string) it will be used as an integer. It works fine if the string is something... |
Forum: PHP Nov 2nd, 2008 |
| Replies: 13 Views: 2,030 This is a great method for the date. If you wanted to you could even return "$year - $month - $day"; if it is a valid date or FALSE if it isn't seeing as you already have the variables set.
As for... |
Forum: PHP Nov 2nd, 2008 |
| Replies: 10 Views: 904 Personally, I would make a few tables like this: (I will refer to email's (eg someone@example.com) as emails and messages between users as Personal Messages (PM's)
table: users
Column: ... |
Forum: PHP Nov 1st, 2008 |
| Replies: 6 Views: 695 You could store the number in either a txt file (if you don't want to do the mysql connection thing just for it) or in a db and also store the date/time for which that number "expires" and it should... |
Forum: PHP Nov 1st, 2008 |
| Replies: 13 Views: 2,030 I have just written a script to do just that. I used ereg() (http://au2.php.net/manual/en/function.ereg.php) to do a search for a regular expression that will verify a valid entry. e.g:
if... |
Forum: PHP Oct 30th, 2008 |
| Replies: 4 Views: 563 echo " </tr>\n";
echo " <tr>\n";
echo " <td class=\"hotelinfotext\">
if ($row[NonSmoking] == 1) {
echo 'Non smoking rooms available, ';
}
if ($row[AirCon] == 1) {
echo 'Air conditioning,... |
Forum: PHP Oct 30th, 2008 |
| Replies: 11 Views: 2,588 I guess that because your printing a receipt and you don't need an images, TEXT would probably be the best option (If it works just as well). Faster printing would indicate it's doing less work which... |
Forum: PHP Oct 30th, 2008 |
| Replies: 11 Views: 2,588 Ok, that makes sense I guess.
What about the other tests? There has to be a character that will mean "new line" and I'm guessing that if "\n" won't work then "\r\n" will. |
Forum: PHP Oct 29th, 2008 |
| Replies: 11 Views: 2,588 Also check that (http://au2.php.net/manual/en/function.printer-set-option.php) out. Someone said that PRINTER_MODE must be set to "RAW" for printing to work... don't quite know what was meant but... |
Forum: PHP Oct 29th, 2008 |
| Replies: 11 Views: 2,588 Check out this (http://www.tizag.com/phpT/files.php) and look into getting the entire file into a variable with "\n\r" (linefeed and carriage return) separating each line of text. Alternatively write... |
Forum: PHP Oct 29th, 2008 |
| Replies: 11 Views: 2,588 So you want to physically print the contents of receipt.txt? What method are you using to print the first line? |
Forum: PHP Oct 26th, 2008 |
| Replies: 6 Views: 957 Sorry, I'm not familiar with that method of MySql interaction. It looks to me like there's something going wrong near the start (maybe with $stmt=mysqli_prepare($cxn, $q);
or even before?) that... |
Forum: PHP Oct 16th, 2008 |
| Replies: 6 Views: 957 This is the first thing I've spotted (as you can see, the whole things inside the quotes):
echo "<tr bgcolor=\"' . $bg . '\">\n";
this will echo:
<tr bgcolor="' . #ffffff . '">\n
(where #ffffff... |