Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. i'm sorry i am reading the code and trying to workout what you are trying to do.. this is what i have so far you have a form with 3 images (a radom 3 of 14) and 9 radio buttons (3 each) you want to count the votes for each image but why the 3 radio button per image ?
  2. yeah use the long one.. okay heres some new code, if (!empty($row['venue_phone'])) echo $row['venue_phone']."<br />\n"; if(empty($row['logo_image']) && true) //debug { echo "<img src='admin/venue/files/MyNoImageImage.jpg'>"; // no image }else{ echo "<img src='admin/venue/files/{$row['logo_image']}'>"; found image } first update echo "<img src='admin/venue/files/MyNoImageImage.jpg'>"; // no image so it displays an image (during the first test this will always display) once that displays remove "&& true" if(empty($row['logo_image']) && true) //debug and make sure the path on the line below is correct then test again
  3. why not just have 1 vote field then so you have 14 images and 1 field that is the number of times thats been voted for
  4. setting cookies to expire on 0 would mean they die right away! kinda pointless setting them!
  5. it means you can't make it unique. i kinda need more detail could toy export the structor
  6. okay cool let update your script to a expiry of 1 hour setcookie("testtext", $_POST['testtext'],time()+60); to setcookie("testtext", $_POST['testtext'],time()+1*60*60);
  7. Select the table then the Structure tab, on the right of the users field click the 5th icon (one with the U) or run the query ALTER TABLE `table` ADD UNIQUE (`Users`)
  8. in the field is blank AKA empty, then that where this line is usful $img = (empty($row['logo_image']))?$noImage:$row['logo_image']; its a shorthand version of this if(empty($row['logo_image'])) { $img = $noImage; }else{ $img = $row['logo_image']; } so if the $row['logo_image'] is empty then $img = $noImage; otherwise $img = $row['logo_image'];
  9. and how many records (i assumed 3 one for each image) also is this in the design stages still ?
  10. try if($last != $cols[3]) instead its late my brain it shutting down!
  11. WTF.. are you kidding me #1 mysql_query returns a resource not the found set so thats usless! #2 running a mysql_query or a resource from a mysql_query.. you have go to be kidding me in any case i'm happy you have your solution! ???
  12. try a simple test <?php setcookie("test","hello",time()+24*60*60); echo $_COOKIE['test']; ?> oh and Slightly off topic.. create a domain.. which is also local oooow! okay go Start->Run-> %windir%\system32\drivers\etc\hosts select notepad your get afile like this 127.0.0.1 localhost now add 127.0.0.1 www.mylovelysite.com save and close now goto http://www.mylovelysite.com and look its localhost soo now www.mylovelysite.com is your domain
  13. update you voted.php to <?php $images = (int)$_POST['images']; if($images <1 || $images > 3) die("Invalid value passed as a vote."); $update = "UPDATE photos SET votes=votes+1 WHERE id=$images"; mysql_query($query); ?> thats the full script EDIT wait a minute you have different field for votes ? can you give an example of how your table is setup..
  14. yep, localhost is a domain
  15. what Ken2k7 said <?php if (!empty($_POST['postcomment'])){ $postcommentq = "INSERT INTO usercomments (`from`, `to`, `comment`, `date`, `approve`) VALUES ('$cookieid', '$getid', '$postcomment', NOW(), 'N')"; $result = mysql_query($postcommentq) or die(mysql_error()); if ($result == true) { echo "<font color=\"red\">Comment posted. Waiting for approval.</font>"; }else{ echo "<font color=\"red\">There was an issue posting the comment.</font>"; } } ?> EDIT: i'll also like to point out that its NOT inserting anything into the database!
  16. as i said you need to remove echo "<img src='/venue/files/".$row['logo_image']."'>"; and does this MyNoImageImage.jpgimage exist in this admin/venue/files/ path ?
  17. You did, Well we both know now Yeah went from Standard User to GURU to PHP Recommended, i find it helps me to help others, rememeber "smart people learn from their mistakes, really smart people learn from other peoples mistakes" i choose to help others and i learn from it and its nice to help
  18. try this <?php if (!empty($_POST['postcomment'])){ $postcommentq = "INSERT INTO usercomments (`from`, `to`, `comment`, `date`, `approve`) VALUES ('$cookieid', '$getid', '$postcomment', NOW(), 'N')"; if (mysql_query($postcommentq) == true) { echo "<font color=\"red\">Comment posted. Waiting for approval.</font>"; }else{ echo "<font color=\"red\">There was an issue posting the comment.</font>"; } } ?>
  19. You very welcome, I just checked here (done a google for odbc reserved words) and its not listed but i think it probably is reserved. oh well problem solved
  20. view source and paste the outputted html that displays has the image link
  21. lol, thats okay, okay lets try (don't hate me) rename the field in the database let call it mynum and try $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type, mynum, exp, sec) VALUES ('$username', '$name', '$type', '$num', '$ex', '$sec')" ); if it fails try (note the quote) $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type, mynum, exp, sec) VALUES ('$username', '$name', '$type', $num, '$ex', '$sec')" ); I know what its like to be stuck, i don't use ODBC much and this helps me resolve problems if i do them at a later stage.
  22. your going to need to remove this line echo "<img src='admin/venue/files/".$row['logo_image']."'>";
  23. as jackpf says try the including the domain etc.. also (sounds strange) but try another browser (IE and mainly Safari) has issules with cookies
  24. okay cool, well num is probably not a reserved word but in your database it is likely a number, so that doesn't "need" quotes so lets try removing them first $sql = odbc_prepare($conn, "INSERT INTO tblCard (username, name, type, number, exp, sec) VALUES ('$username', '$name', '$type', $num, '$ex', '$sec')" ); EDIT: bug find is basically checking your input then output, then the middle parts, the output we wanted was either an error or a storage, we could of tried this sooner but i wanted the error incase the error said something like database locked etc
  25. location $url="myHome.php" header("Location: $url"); EDIT: as a note it is the one of the first example in the php manual for header
×
×
  • 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.