Jump to content

xshanelarsonx

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

xshanelarsonx's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can someone please answer my question above. I can't figure it out.
  2. This don't work. What I'm trying to do is make it here my code will not give a error when reason has a ' in it. $autoban="INSERT into bans(ip,date,comment,active) VALUES('$ip','$date','$reason','1')"; mysql_query($autoban) or die(mysql_error());
  3. Thanks Jesirose, can you give a example with my code?
  4. Thanks Magic2goodil, but how would I make it add the \ before any ' by its self?
  5. I keep getting this error using this code. -String $Reason = "You don't live in B-Town"; -Function function autoban($date, $reason, $ip){ $autoban="INSERT into bans(ip,date,comment,active) VALUES('$ip','$date','$reason','1')"; mysql_query($autoban) or die(mysql_error()); echo ("<center><h1><font color='White'>You have been banned on the $date</font></h1></center>"); echo ("<center><font color='red'>Reason:</font> <font color='White'>$reason</font></center>"); exit(); } -Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't live in B-Town','1')' at line 1
  6. This will only show the day, and month. Why won't the year show? <?php $date = "22/2/2007"; $splitdate = explode("/", $date); $day = $splitdate[count(splitdate) -1]; $month = $splitdate[count(splitdate) -0]; $year = $splitdate[count(splitdate) -3]; echo "Date: $date<br> Day: $day<br> Month: $month<br> Year: $year"; ?>
  7. Thanks for all the help. I figured out that it must be a combo to work. $fname = stripslashes($fname); $fname = str_replace("'", "", $fname); Not just. $fname = str_replace("'", "", $fname);
  8. That didn't fix it. Thanks for the try.
  9. This keep's giving me this error. "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's','aa's.mp3', '0')' at line 1" $songname = aa's mysql_connect("localhost","root","hs") or die ("Unable to connect to MySQL server."); mysql_select_db("Music") or die ("Unable to select requested database."); $music = array(".mp3"); $fname = $_FILES['file']['name']; $ext = strrchr($fname,'.'); if (!in_array(strtolower($ext),$music)) { echo "~~Wrong file extension -- Music*.mp3* only~~<br /><a href='Music.php'>Back</a>"; }else{ $fname = $songname.".mp3"; $fname = str_replace(' ', '', $fname); $fname = stripslashes($fname); $songname = stripslashes($songname); move_uploaded_file($_FILES["file"]["tmp_name"],"Files/Music/" ."$fname" ); $MuscUpload = "INSERT INTO songs(SongName , File, Seconds) VALUES('$songname','$fname', '0')"; mysql_query($MuscUpload) or die("MySQL ERROR: ".mysql_error());
  10. Thanks Jesirose, that fixed it. Sorry for the long reply I was testing other stuff after that.
  11. I get this error because it replaces "'" with "\". "Warning: move_uploaded_file(Files/Music/afgd\s.mp3) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\AppServ\www\Music_Upload.php on line 45"
  12. I want to make this. "Song's Rock" Into this. "Songs Rock" Can you please help fix this code to do that? $songname2 = str_replace("'", "", $songname);
  13. How do you get the length of a mp3 file using php?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.