Jump to content

tome

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by tome

  1. anyone has an idea how to remove the forward slash and create line breaks?
  2. Hi there I've got a form setup to pass variables from flash to a sql table using php, the php sends the varaibles to the table and sends me and the user notification email. Everything works great but in the email I get forward slashes appearing where the line should break, anyone knows how to strip the html tags in php? Here's the email part of my php script: <?php if ($REMOTE_ADDR == "") $ip = "no ip"; else $ip = getHostByAddr($REMOTE_ADDR); mail("$adminaddress","Info Request", "A visitor at $sitename has left the following information name: $name address: $address phone: $phone email: $email vemail: $vemail Logged Info : ------------------------------ Using: $HTTP_USER_AGENT Hostname: $ip IP address: $REMOTE_ADDR Date/Time: $date","FROM:$adminaddress"); mail("$email","Video Contest Submission Confirmation", "Dear $name, Thank you for your submission. Upon approval it will be available on $siteaddress for viewing and voting. Good Luck, $sitename $siteaddress","FROM:$adminaddress"); ?> thanks in advance
  3. hi there i've got a guestbook setup it's: flash->php->sql->php->flash i'd like to have a different background color for each comment, i guess it is done in php? anyone has any ideas?
  4. well i'm testing but it seems fine to me yet i still get the ? after my titleID number at the flash output window. this is my flash code: myEntries = new LoadVars(); myEntries.sendAndLoad("GuestBook.php?action=read&r="+random(999)+"&NumLow="+_parent.NumLow+"&videoID="+videoID,myEntries,"GET"); and this is how it looks in the output window: "/GuestBook.php?action=read&r=634&NumLow=0&videoID=00000000?" how do i get rid of the ? after the id number...???
  5. u can see it here: http://jewishtvnetwork.com/guestbook1/
  6. ok it's working now thank you, however i fetch zero entries even though i've got comments for the video playing stored in the database. i added this php print code: print '<PRE style="text-align:left;">'; print_r($sql); die("<P>Script Halted...</P>"); print '</PRE>'; and when i test it online i get this sql quary: SELECT * FROM guestbook WHERE titleID = '000000000?videoID=000000000' ORDER BY `time` DESC LIMIT 0, 10Script Halted... while the sql quary that will yield results should be: SELECT * FROM guestbook WHERE titleID = '000000000' ORDER BY `time` DESC LIMIT 0, 10 somehow i pass my variable twice??? this is my flash request: myEntries = new LoadVars(); myEntries.ref = this myEntries.videoID = videoID myEntries.sendAndLoad("GuestBook.php?action=read&r="+random(999)+"&NumLow="+_parent.NumLow+"&videoID="+videoID,myEntries,"GET"); and again my php code: $id=mysql_escape_string($_GET['videoID']); $sql = "SELECT * FROM $table WHERE titleID = '$id'"; any ideas?
  7. Hi there, i've got a flash based video site, i'm working on integrating a guestbook so users can leave comments about the videos. this is my communication scheme: flash->php->sql->php->flash my write function works great and the user can leave a comment based on unique titleID (video number) but i'm having a hard time fetching entries related to the current playing video, in my flash output window i can see that my videoID variable (video number) is passed from flash to php using loadVars so i assume that i've got a problem with my php script. This is the code I'm using in php to fetch data from sql: $id=mysql_escape_string($_GET['videoID']); $sql = "SELECT * FROM $table WHERE titleID = $id"; any ideas?
  8. ok some progress guys, bubblegum.anarchy or anyone else who's willing to help, sorry for being so slow but like i said i'm a newbie ???. So i added the line u gave me bubblegum.anarchy and here is the print: SELECT * FROM guestbook WHERE titleID = titleID ORDER BY `time` DESC LIMIT 20, 10Script Halted... also it only retrieves the first comment from each group of ten. I understand now that the titleID varaible in php is empty hence the undefined message, so it needs to be defined and passed from my flash MC to the php form via loadVars, however i'm not sure how to do this?
  9. ok i must be really ignorant but i've got no idea what you mean, i take your code add it to my php file put the file on my ftp and get undefined in my test site. if i post a comment through the test site i get the following varaibles stored to my db: titleID ID name email comments time if i use myPHPadmin choose SQL and run my php code as quary i get syntax errors... ???
  10. thx man this code works fine $sql = "SELECT * FROM $table WHERE titleID = $videoID "; when i set up this varaible: $videoID = "titleID"; however i still get all the comments from my database instead of the ones related to the current playing video. if I change the varaible name with a titleID number like this: $sql = "SELECT * FROM $table WHERE titleID = 123456789"; i'm able to get only titles associated with this titleID number, however this way i will have to create a php form for each video....i've got tons my logic tells me that I'm doing something wrong in defining the titleID varaible for the flash/php connection, any ideas? I've been stuck on this for days...
  11. hi there bubblegum.anarchy thank you for your help so far, i'm just a beginner in SQL and PHP, well today i made some progress if i add this quary line: $sql = 'SELECT * FROM `guestbook` WHERE ' . ' `titleID` = 123456789'; to my case 'read' i get only entries associated with this titleID number but i would like to have a variable instead of a number, i've got a variable that stores the titleID number in SQL, but how do i use the same varaible to fetch unique titleID entries from SQL, any ideas how i should proceed? cheers
  12. i'm fairly new to all this so forgive my ignorance, is this it: CREATE TABLE guestbook ( titleID text NOT NULL, ID int(5) NOT NULL auto_increment, name text NOT NULL, email text NOT NULL, comments text NOT NULL, time datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (ID) )
  13. here goes, any ideas appreciated ??? <? /* ----- ----- */ $DBhost = ""; $DBuser = ""; $DBpass = ""; $DBName = ""; $table = ""; $numComments = 10; $DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error in GuestBook Application: " . mysql_error()); mysql_select_db($DBName, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); $action = $_GET['action']; switch($action) { case 'read' : $sql = "SELECT * FROM '$table' where titleID = '$titleID'"; $allComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); $numallComments = mysql_num_rows($allComments); $sql .= ' ORDER BY `time` DESC LIMIT ' . $_GET['NumLow'] . ', ' . $numComments; $fewComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); $numfewComments = mysql_num_rows($fewComments); print '&totalEntries=' . $numallComments . '&'; print "<br>&entries="; if($numallComments == 0) { print "No entries in the guestbook, as yet.."; } else { while ($array = mysql_fetch_array($fewComments)) { $name = mysql_result($fewComments, $i, 'name'); $email = mysql_result($fewComments, $i, 'email'); $comments = mysql_result($fewComments, $i, 'comments'); $time = mysql_result($fewComments, $i, 'time'); print '<b>Name: </b>' . $name . '<br><b>Comments: </b>' . $comments . '<br><i>Date: ' . $time . '</i><br><br>'; $i++; } } if($_GET['NumLow'] > $numallComments) { print 'No More Entries!&'; } break; case 'write' : $titleID = ereg_replace("&", "%26", $_POST['videoID']); $name = ereg_replace("&", "%26", $_POST['yourname']); $email = ereg_replace("&", "%26", $_POST['youremail']); $comments = ereg_replace("&", "%26", $_POST['yourcomments']); $submit = $_POST['submit']; $submitted_on = date ("Y-m-d H:i:s",time()); if($submit == 'Yes'){ $sql = 'INSERT INTO ' . $table . ' (`ID`, `titleID`, `name`, `email`, `comments`, `time` ) VALUES (\'\',' . '\'' . $titleID . '\',' . '\'' . $name . '\',' . '\'' . $email . '\',' . '\'' . $comments . '\',' . '\'' . $submitted_on . '\' )'; $insert = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); print "&gb_status=Thank you for posting a comment.&done=yes&"; return; } print "&_root.write.gb_status=Error!&"; break; } ?>
  14. Hi there, I've got a a guestbook setup for my flash based video site and I'd like to fetch and print to flash only the entries related to the current playing video. Each video has a unique titleID number. I print the ID number to a text field in flash and send it via php to mySQL database where it is stored under my titleID column. this all works great now i'm trying to fetch back to my read area the related comments using the unique titleID. this is my query line $sql = "SELECT * FROM '$table' where titleID = '$titleID'"; but I keep getting undefined message in my entries text field in flash, any ideas what am i doing wrong?
×
×
  • 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.