
chocopi
Members-
Posts
551 -
Joined
-
Last visited
Never
Everything posted by chocopi
-
[SOLVED] How do I add a new file to a folder?
chocopi replied to ballhogjoni's topic in PHP Coding Help
'w' = Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. I think you must have missed this bit ~ Chocopi -
[SOLVED] How do I add a new file to a folder?
chocopi replied to ballhogjoni's topic in PHP Coding Help
maybe you should look at THE MANUAL and look at what the "w" does ~ Chocopi -
<?php if(you want '123' and '456') { echo "Use $_GET"; } else if(you want something different) { echo "I did not understand the question"; } ?> do you mean you want to be able to get the 123 and 456 part, if so then use GET or i misunderstood. ~ Chocopi
-
well seeing as it is between /* and */ that means it is a comment, and no you do not have to include it. I am guessing this if from open source code so this line just gives a bit of information about the file. So /* = start of comment $Id: = 'Id' as it is the id of the file abd i guess it has been declared like a variable for indexing ? gtk.php = file name v 1.41 = version of file 2002/04/11 02:19:50 = date and time created andrei = user who created the file Exp $ = ?? */ = end of comment I think thats roughly right, but dont take my word for it ~ Chocopi
-
It happens twice by the way after both . "\n"
-
a cron job will work when ever it is told to. If your server is down the cron job will not be able to work as the server is down. Its like a man can throw a ball at 5 oclock everyday, but if he is asleep at 5 he wont be able to throw it ~ Chocopi
-
Trying to figure out why this login page doesn't work
chocopi replied to simcoweb's topic in PHP Coding Help
where is your $username and $password on your register page ? -
[SOLVED] delimiting timestamp queries to show only date, no time
chocopi replied to greencoin's topic in PHP Coding Help
Im glad it worked But you should try and use Caesar's as its neater and generally better ~ Chocopi -
[SOLVED] delimiting timestamp queries to show only date, no time
chocopi replied to greencoin's topic in PHP Coding Help
instead of using this Print "<td>".$var. " </td></tr>"; //here it is use Print "<td>".$date." </td></tr>"; //here it is as we have split $var into $date and $time and you want $date to be used That should sort it ~ Chocopi -
[SOLVED] delimiting timestamp queries to show only date, no time
chocopi replied to greencoin's topic in PHP Coding Help
Oh sorry i didnt notice, sorry But my code should still work so try the changes from my previous post And hopefully it will be fine ~ Chocopi -
[SOLVED] delimiting timestamp queries to show only date, no time
chocopi replied to greencoin's topic in PHP Coding Help
is it stored in the database at a DATETIME though so it looks like 00/00/0000 00:00:00 ??? If it is then you can use my code by <?php $var = $row['time']; list($date,$time) = explode(' ',$var); echo $date; ?> if not please tell me what it is stored as Hope it helps ~ Chocopi -
replace $db_table with the actual tablename, get rid of the curly braces and add an astrieks, so this line: $query = mysql_query("DELETE FROM $db_table WHERE email = '{$email}'"); looks like $query = mysql_query("DELETE * FROM tablename WHERE email='$email'"); if not replace $query = mysql_query("DELETE * FROM tablename WHERE email='$email'"); with $query = "DELETE * FROM tablename WHERE email='$email'"; mysql_query($query) or die(mysql_error()); Hope one of those works ~ Chocopi
-
[SOLVED] delimiting timestamp queries to show only date, no time
chocopi replied to greencoin's topic in PHP Coding Help
Can you post your code, please ? If your using DATETIME in MySQL then you can just explode the space and then you have your date and time separately Eg: <?php $var = "01/01/2001 12:12:12"; list($date,$time) = explode(' ',$var); echo $date; // should be 01/01/2001 ?> Hope that helps ~ Chocopi -
Trying to figure out why this login page doesn't work
chocopi replied to simcoweb's topic in PHP Coding Help
try this $sql = "SELECT * FROM `users` WHERE username='$username' AND password='$password'"; Hope it helps ~ Chocopi -
you would need $row['user_url'] and $row['user_name']; you need to remember the ' ~ Chocopi
-
Thats what Chigley has posted The only thing you might have to change is list($username, $email) = explode(":", $content) to list($username, $email) = explode(" : ", $content) ~ Chocopi
-
I think you need the % sign so you would have SELECT * FROM new WHERE field1 LIKE 'cep%'
-
i dont think that is right seeing as image/pjpeg does not equal JPEG or jpeg <?php $text1 = "image/pjpeg"; $text2 = "JPEG"; $text3 = "jpeg"; if($text1 != $text2 or $text != $text3) { //redirect } else { // your stuff } ?>
-
I guess that means code like this only works on your own server: <?php $lines = file('http://www.somesite.com/'); foreach ($lines as $line_num => $line) { echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n"; } ?>
-
echo the chktype to see what its giving
-
Cheers That works perfectly ~ Chocopi
-
yea you can, but i just prefer being able to see whats going on step by step, especially as i had to keep swapping stuff around
-
Well i think they could use stuff like SELECT FROM or DELETE FROM in my code i use this on submit <?php $original = $_POST['message']; $original = strip_tags($original); $original = htmlentities($original, ENT_QUOTES); ?> and then to get it back <?php $text = $_POST['original']; $text = mysql_real_escape_string($text); $text = stripslashes($text); ?> That might cause some problems, but it should be fine ~ Chocopi
-
However, that will only stop html tags it wont stop the likes of mysql stuff
-
use $_GET <?php $title = 1; // select statement echo "<a href=\"page.php?title=$title\">$title</a>"; ?> Then on page.php have: <?php $title = $_GET['title']; mysql_query("SELECT fieldname FROM tablename WHERE title='$title'"); ?> Or something like that ~ Chocopi