Carterhost
-
Posts
60 -
Joined
-
Last visited
Never
Posts posted by Carterhost
-
-
Try using Quotes?
$timedate[0] = "00,00,00,05,20,2003"; $timedate[20] = "00,00,00,11,03,2004";
-
I would probably use FTP_BINARY as the mode, unless the only thing you're uploading is Text files.
Text files can be uploaded in binary mode no problem.
Binary files (including JPGs) will not transfer correctly in FTP-ASCII Mode.
-
Create a new file: phpinfo.php
Put this inside it:
<?php echo phpinfo(); ?>
View that in a browser, then look through that for these:
upload_max_filesize
post_max_size
max_input_time
max_execution_time
memory_limit
-
You still haven't asked a question really, though?
-
In answer to the second question: yes.
$Result= mysql_query("SELECT * FROM $Table WHERE Username='$_POST['Username']' AND Gender='$_POST['Gender']'")
Or:
$Result= mysql_query("SELECT * FROM $Table WHERE Username='$_POST['Username']' OR Gender='$_POST['Gender']'")
-
I don't know what database object your using... but does it have a numrows() or simular method? Something like....
Yeah, Couldn't even find matching commands in the php manual.
???? what
the commands is inside the class
Eek, My Bad.
Edit... it's too late for me. Roll on 1am when I can finish work!
-
I don't know what database object your using... but does it have a numrows() or simular method? Something like....
Yeah, Couldn't even find matching commands in the php manual.
-
use this instead:
$sql = "SELECT * FROM ipsr_garage WHERE userid = $userid"; $result = $db->sql_query($sql); $num_rows = mysql_num_rows($result); if ($numrows == 0) { echo "You currently have no cars in your garage."; }else { while ($row = $db->sql_fetchrow($result)) { $year = $row['year']; $make = $row['make']; $model = $row['model']; echo "$year $make $model"; } }
It counts the number of results, instead of pulling the first result for the test.
-
Example from php.net which could be useful:
<?php $lastthurs=strtotime("last Thursday",mktime(0,0,0,date("n")+1,1)); ?>
Returns the last thursday of this month.
<?php $firstthurs=strtotime("next Thursday",mktime(0,0,0,date("n"),1)); ?>
Returns the first thursday of this month.
So if I didn't need more coffee to stay awake, I'd work out the code for you.
1. Test whether you're past the first thursday of the month
2. If yes, get the date of the last thursday. If no, get the date of the first.
3. Convert it to a nice format
4. Echo it
-
Quick and Dirrty:
redirect.php:
<?php $year = $_GET['year']; $month = $_GET['month']; $url = "http://invincible.comics-database.com/database/comicsByReleaseDate/".$month."-".$year; header('Location:'.$url); ?>
Use this as the whole page. You should expand on it to do some input checking on your $_GET variables, but this should basically be it.
Remember, no spaces or HTML before this code or you'll get the dreaded "Headers already sent" Error.
-
It's not foolproof, but if you just specify the height in the image tag (i.e. no width) then the aspect ratio is usually kept...
-
Thanks,
I'll try that.
It seems that this only occurs when it's edited on a mac. PC's are fine (Vista, XP and Kubuntu all tested okay)
Anyone know why??
-
Hi.
I want to be able to store HTML input from a text field, and I wanted to encode it when it went in, so that it didn't break the PHP as it was assigning it to the variable. so I used URLEncode and URLdecode, but thenin text, "you'll" ends up as "you�ll", which is not what I want.
Is there something else I could use? I've looked at a few functions in the man pages, but I don't think they're what I need.
Cheers muchly.
-
while($res = mysql_fetch_array($result)) { if($res['rank'] != "Guest" || $res['rank'] != "Administrator") echo "<option value='"$res['rank']"'.>".$res['rank']."</option>"; }
That will populate your $_POST['rank'] with the rank, as long as it's not Guest or Administrator.
-
Yeah, it works first time, no refresh required.
I say this too much at work but.... Have you tried clearing your local cache and cookies and trying again?
-
Thats funny because I use IE6 6.0 at my work and can't install firefox. It worked fine for me.
Same here. Clanstyles, we can't install FF either. Get the portable version from http://portableapps.com. No installation needed.
-
I just checked it on IE6, and it looks fine from here...
-
You could try something like:
<?php if (!$_FILES['image']['name']=="") { PROCESS IMAGE } else{ DO SOMETHING ELSE } ?>
I used this just the other day and it worked
-
$query = "SELECT * FROM sports s, categories c, sport_catog sc WHERE s.SportId = sc.SportId AND c.CategId = sc.CategId AND c.CategId = ".$_GET['catog'] . " ORDER By s.SportTitle ASC";
If Someone entered 1 OR 2 = 2 into the catog parameter, what would that make your SQL statement?
This:
WHERE s.SportId = sc.SportId AND c.CategId = sc.CategId AND c.CategId = 1 OR 2 = 2 ORDER By s.SportTitle ASC";
Which would nicely return every row in your database, because 2 will always equal 2....?
Just check that your $_GET['catog'] is what you want it to be before you start pumping it into SQL statements
-
$news = mysql_fetch_array(mysql_query("SELECT * FROM news WHERE id='$id' ")) or die(mysql_error());
-
Okay, do you have any other SQL Queries in your code?
-
Not sure how valid this is, but you could try:
<?php mysql_query("DELETE FROM comments WHERE id = '$com' LIMIT 1") or die(mysql_error()); ?>
That looks more right to me. Does it give the same error?
-
Try:
<?php $time = time() + (4*3600); ?>
This adds 4 hours to the current time.
To add 4 hours to the time you specify in mktime():
<?php $time = mktime($hour+4, $minute, $second, $month, $day, $year); ?>
-
the "upgrade your browser" campaign
in Website Critique
Posted
Just an FYI - The site looks clearer and cleaner (even without the CSS3 stuff) in IE6 than it does in chrome.