Jump to content

RTS

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

RTS's Achievements

Member

Member (2/5)

0

Reputation

  1. I am running MYSQL 4.1.21, and my database has five fields: "id","username","from","message","date": id is int with an auto_increment, and the rest are just text.
  2. I have a project due tomorrow, and have been up til late working on this. can anyone tell me what is wrong with this code? This is the error I get for the code <?php session_start(); $text = $_POST['message']; $user = $_SESSION['username']; $user2 = $_GET['user']; $date = date('F j, Y, h:i A'); $con = mysql_connect("localhost","ZackBabtkis",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); mysql_query("INSERT INTO comments (username,from,message,date) VALUES ('$user2','$user','$text','$date')") or die('Error: ' . mysql_error()); mysql_close($con); header("location: /users/$user2"); ?>
  3. they are smaller thann 2mb tho like 500 kb
  4. I have chmoded the folder to 777, and the files that I have tried uploading are swf, and avi files as these are the types my site will be working with.
  5. So I have a simple PHP upload form ( The code below ), that uploads to a folder called files. The problem is that every file that is uploaded doesn't work any more when uploaded in files. How can I fix this? [code]<?PHP $target_path = "files/"; $target_path = $target_path . basename( $_FILES['Filedata']['name']); if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $target_path)) {     echo "The file ". basename( $_FILES['Filedata']['name']). " has been uploaded"; } else {     echo "There was an error uploading the file, please try again!"; } ?> [/code]
  6. so can you recommend any C tutorials for doing this?
  7. So, I want to make a P2P filesharing network with PHP, but dont know how to do this. I need to make it so a person can connect to peoples computers through my PHP script on my webserver the way people do on BitTorrent and LimeWire. Anyn ideas? Thanks in advance by the way.
  8. Hi, I just got a macbook, and am trying to setup PHP on it. I have tried following all the tutorials on google where it says to uncomment all the lines regarding PHP, then press wq: or whatever to save and quit, but then every time I  make a simple php script, it just echos back the text from the php script. for example when the php script says "<?php echo date(Y); ?>" it just prints "<?php echo date(Y); ?>" when I go to my IP. What am I doing wrong?
  9. I am trying to make a live bookmark that retrieves the latest blog entries in my mysql database. my question is, how do I do it? this is my code right now [code]<?xml version="1.0" encoding="UTF-8"?> <rss  version="2.0">     <channel>         <title>Test Blog</title>         <description>The most recent gossip in a live bookmark!</description>         <link>http://www.test.com/</link>         <docs>http://blogs.law.harvard.edu/tech/rss</docs>         <lastBuildDate>Thu, 02 Nov 2006 19:54:18 -0800</lastBuildDate>         <pubDate>Thu, 02 Nov 2006 19:53:55 -0800</pubDate>         <generator>FeedForAll Mac v2.0 (2.0.0.4) unlicensed version; http://www.FeedForAll.com/</generator>         <item>             <title><?php $con = mysql_connect("localhost","ZackBabtkis",""); $user = $_SESSION['username']; if(!$con) {die("could not connect");} mysql_select_db("test",$con)or die("could not connect to database"); $query = mysql_query("SELECT text FROM blogn WHERE id=1"); while ($row = mysql_fetch_array ($query)); echo $row['text']; ?></title>             <link>http://www.test.com/events.php?id=1</link>             <pubDate>Thu, 02 Nov 2006 19:51:34 -0800</pubDate>         </item>     </channel> </rss> [/code]
  10. How do i make it so people can create email addresses for my site. For example if someone went to my site (createemails.com) they could register an email (ex. zack@createemails.com).
  11. can someone tell me whats wrong with this script? [code]<?php $con = mysql_connect('localhost','ZackBabtkis',''); if (!$con)   {   die('Could not connect: ' . mysql_error());   } mysql_select_db('test', $con); $result = mysql_query('SELECT * FROM blogs WHERE Name=sada'); while($row = mysql_fetch_array($result))   {   echo '<table border=10 width=400 cellpadding=0 cellspacing=3> <tr> <td background=table.jpg>';   echo '<div align=left><font size=5><b>From:</b> '. (ucfirst($row['username']));   echo '<br>';   echo '<b>On:</b> ' . (ucfirst($row['Date']));   echo '<br>';   echo '<b>Subject:</b> ' . (ucfirst($row['Subject']));   echo '</font>';   } echo '</table>'; mysql_close($con); ?>[/code] I get [code]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /Library/WebServer/Documents/Blogs/test.php on line 7[/code]
  12. RTS

    PHP checkbox

    thanks, i figured it out. one more question though. I am trying to recieve the message ont eh other end, and if the column 'sig' says yes, I want the message to echo test on the bottom. this is what I have so far, but it is giving me a parse error. [code]<?php $con = mysql_connect("localhost","ZackBabtkis","") or die('Could not connect: ' . mysql_error()); mysql_select_db("test", $con); $result = mysql_query("SELECT * FROM messages WHERE ID=" . $_GET['id']); while($row = mysql_fetch_array($result)) { $sigtest = $row['sig']; $sig = if ($sigtest = "no") echo "test";                 echo $sig ?>[/code] can someone tell me what might be wrong? I appreciate all the quick helpful replies by the way :)
  13. RTS

    PHP checkbox

    when I have [code]$sig = (isset($_POST["sig"])) ? "yes" : "no";[/code] it only echos no, when I change it to [code]$sig = (isset($_POST["sig"])) ? "no" : "yes";[/code] it always inserts yes. it seems to be ignoring the first quotes
×
×
  • 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.