Forum: PHP Aug 20th, 2009 |
| Replies: 7 Views: 681 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: 486 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,182 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: Database Design Jun 7th, 2009 |
| Replies: 1 Views: 1,007 You can use a for loop to operate on each element of the array. I'm assuming it's a one (meaningful) columned table.
//len is length of array
for (i=0; 0<len; i++){
//create SQL statement
... |
Forum: PHP Jan 14th, 2009 |
| Replies: 2 Views: 643 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,197 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: 1,981 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: 1,981 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: 896 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: 690 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: 1,981 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: 558 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,550 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,550 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,550 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: Game Development Oct 29th, 2008 |
| Replies: 10 Views: 1,788 Unless you are using someone else's stuff in your game you should be fine with copyright. Careful submitting your game to certain sites as you might be giving them copyright permissions that you... |
Forum: PHP Oct 29th, 2008 |
| Replies: 11 Views: 2,550 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,550 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: 933 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: 933 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... |