Jump to content

xshanelarsonx

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by xshanelarsonx

  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?
  14. Thank you, this fixed it. Thanks Jesirose for pointing that out. For now on I'll tell what row it is with that code, I was using the whole page when it told me that row. LOL
  15. I'm trying to randomly pick a row from a mysql table and display it's info. I keep getting a error on line 2. $Music="SELECT * from songs ORDER BY RND() LIMIT 1"; $Music_Result=mysql_query($Music); while ($row=mysql_fetch_array($Music_Result)) { $SongNameRandom=$row["SongName"]; $FileRandom=$row["File"]; }
  16. I need to know how to edit this code to make it name the uploaded file $songname with .mp3 at the end. <? if($submit){ $music = array(".mp3"); $file_tmp = $_FILES['file']['tmp_name']; $fname = $_FILES['file']['name']; $ext = strrchr($fname,'.'); if (!in_array(strtolower($ext),$music)) { echo "<center>~~Wrong file extension -- Music*.mp3* only~~<br /><a href='index.php'>Back</a></center>"; }else{ $fname = str_replace(' ', '', $fname); move_uploaded_file($_FILES["file"]["tmp_name"],"Files/Music/" ."$fname" ); echo "<center>File uploaded. <br /><a href='index.php'>Back</a></center>"; } }else{ echo "<center>File failed to upload. <br /><a href='index.php'>Back</a></center>"; } ?>
  17. Don't worry about it obsidian. We all type stuff that seems different to others at times.
  18. Thanks dave, and obsidian I did read ToonMariner's post but I didn't really understand it. I'm really new to CSS.
  19. Heres more code. <html> <head> <title>Shane's Home Server</title> <style type="text/css"> <!-- body { background-color: #000000; background-repeat: repeat-x; } .Music { TOP: 65px; Left: 450px; WIDTH: 350px; HEIGHT: 130px; margin-top: center; margin: auto auto; POSITION: absolute; BACKGROUND-COLOR: #989898; } h1 {color: #FFFFFF} --> </style> </head> <body link="blue" alink="blue" vlink="blue"> <center><h1><u>Welcome to Shane's Home Server</u></h1></center> <div class="Music"><form action="Music_Upload.php" method="post" enctype="multipart/form-data"><center><font color="#D0D0D0" size="4"><u>~~~~Music~~~~</u></font></center> <center><a href="Files/Music/">-View music-</a></center> <br /> <center><font color="#D0D0D0" size="2"><u>Upload Music</u></font></center> <center> Song <input type="file" name="file"> <br /> <input type="submit" name="submit" value="Upload"> </form> </center></div> </body> </html>
  20. The box is in the top right now, and I need it in the center. Can you please explain more how to do this. I'm really new.
  21. I'm new to CSS and I can't figure out how to get the center of this box to line up with the middle of the screen. Like how <center></center> works to center something in HTML. <style type="text/css"> <!-- .Music { TOP: 65px; Left: 50%; WIDTH: 350px; HEIGHT: 130px; POSITION: absolute; BACKGROUND-COLOR: #989898; } --> </style>
  22. I think thats it. How can I fix this? I can edit the php.ini file.
×
×
  • 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.