Jump to content

JoeyT2007

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JoeyT2007's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [move]Woohoo! Thanks It was that![/move]
  2. Why? I'm only getting that error when i remove the ' from it, i don't get any error the way i have it. Anyway, i did what you said, and i edited a post and put "Test Post..." in the textarea and the mysql error was: 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 'Post...\r\n WHERE postid=' at line 1 Oh, and also, i tried making it remove the post and readd it with the same data but a different message and it failed too. But if i make a new topic or reply it works fine!
  3. That seemed to make stuff worse XD Could not edit post.
  4. I would do: (index.php?search=Search%20Function) $keywords=$_GET['search']; $keywords=trim($keywords); $result=mysql_query("SELECT * FROM $table WHERE words LIKE '$keywords'); $num=mysql_numrows($result); echo "Results: $num"; while($results=mysql_fetch_array($result)) { print "<tr class='alt'><td><a href='URL'>$results[FIELD]</a></td></tr>"; } etc... I'm not very good at PHP so i'm probably wrong, but hope it helps
  5. That would be a cap by your provider. Probably set to 2mb.
  6. Hey, i'm making a forum and am having a little trouble with updating a post. I have an edit button, it gets the post and puts it into a text box, but once finished editing, it will not update the post! I made it echo the message before updating and its the right thing and it doesn't give any errors. $postid=$_POST['postid']; $post=$_POST['post']; mysql_query("UPDATE posts SET post = '$post' WHERE postid = '$postid'") or die("Could not edit post."); Is there anything wrong with the above is it something else in the code?
  7. There we go mudi: <form enctype="multipart/form-data" action="" method="post"> Song Artist: <input type="text" name="artist" /><br> Song Name: <input type="text" name="name" /><br> MP3 File: <input type="file" name="file" /><br> <input type="submit" value="Submit" name="Submit" /> </form> <?php if(strlen($_FILES['file']['name']) > 1) { $file = basename($_FILES['file']['name']); $name = $_POST['name']; $artist = $_POST['artist']; $ext = strtolower(substr(strrchr($file, '.'), 1)); $allowedExt = array('mp3'); $uploadPath = "musics"; if(!is_dir($uploadPath)) { mkdir($uploadPath,"0777"); } $uploadPath = $uploadPath."/".$file; $size = $_FILES['file']['size'] / 1024; // size in kb $maxSize = 10024; //size in kb if(in_array($ext, $allowedExt) and $size < $maxSize) { if (file_exists($uploadPath)) { echo "The file already exists!"; } else { if(move_uploaded_file($_FILES['file']['tmp_name'], $uploadPath)) { echo "The mp3, $file was uploaded successfully and added to the playlist!"; $file = 'config.xml'; $handle = fopen($file, 'r'); $size=filesize($file); $size=$size-21; $contents = fread($handle, $size); $contents = $contents."#".$uploadPath.",".$artist." - ".$name."</play_list></config>"; fclose($handle); $file = 'config.xml'; $handle = fopen($file, 'w'); fwrite($handle, $contents); fclose($handle); } else { echo "An error ocurred during upload. Try again later"; } } } else { echo "File format is unsupported or filesize is too big"; } } ?> I have just started learning PHP so correct the mistakes but it works fine, no problems at all! Name!!! Holy crap, thats gonna take one hell of a script...
×
×
  • 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.