When does a cookie expire if you omit the expires parameter? Does it live permanently or just during the current session? I would like to create a permanent cookie and I was wondering if it would be enough to just pass a name and value variable to the setcookie() function. It's not a lie if YOU...
In PHP such a thing is trivial but the Javascript Date object apparently doesn't have a built-in method for it. I need this feature to make a countdown counter which can be used to show how many time there is left between now and a goal date (I want it to countdown in realtime with seconds...
You should use $_SERVER["PHP_SELF"] to access the self variable from now on, all other methods won't work or are deprecated starting from PHP 4.2.0. It's not a lie if YOU believe it ;-)
Don't forget to quote the names inside the brackets. So it should be $_POST["uname"] and $_SESSION["members"].
For additional data use additionial session variables. Or group everything inside an array (it's perfectly legal to have session arrays). It's not a lie if YOU...
The easiest way would be to read the date into an array using the file() function. Then find the row containing 'john' and change it 'joe. Finally write the array back. Only drawback would be that for extremely large files you might run into memory problems when trying to read all the entries to...
Try
$count = ++$number;
instead of
$count = $number++;
In your script $count will be set equal to $number and after that $number will be increased by one. So $count will always be the same as $number. You should increment first before assigning the value to $count (pre-increment instead of...
change the read-from-file lines to:
$Vote1 = trim(fgets($datei, 255));
$Vote2 = trim(fgets($datei, 255));
$Vote3 = trim(fgets($datei, 255));
and your conditions should read:
if($id==1) ...
etc. (notice the doubled equal sign)
and make sure $id is available ;-)
PS: the trim() function...
It's a newline character.
<?php
echo "Line 1\nLine 2";
?>
will show up as:
Line 1
Line 2
in your html source
(instead of "Line1Line2" when omitting the \n)
It's not a lie if YOU believe it ;-)
Hi, does anyone know of a free webspace hosting provider with PHP and sendmail support? The PHP accounts I have right now don't allow use of the mail() function :-( It's not a lie if YOU believe it ;-)
Hmm, by looking closer at your post it see that you're using $tfield[i] to read the values but your variables are called $tfield0, $tfield1, etc right? So you're not accessing those variables at all, that's why you get an empty result. It's not a lie if YOU believe it ;-)
There's nothing wrong. I just checked it and it works without a glitch. Here's the codefragment I used to test it:
<?php
$tfield = array('a', 'b', 'c', 'd', 'e');
$thedata = array();
$tcount = 5;
$i = 0;
while ($tcount != 0) {
$thedata[] = $tfield[$i];
$i++;
$tcount--;
}
$thevar =...
Only after your second post I realized that there was a whole bunch of javascript code on your site so my first post obviously wasn't going to help you. It's not a lie if YOU believe it ;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.