Jump to content

ohdang888

Members
  • Posts

    1,285
  • Joined

  • Last visited

    Never

Everything posted by ohdang888

  1. Once you echo something, you can't go back and delete it without javascript... my suggestion, if the number you want varies (sometimes 1, sometimes 10, etc), put it all into an array, and use array functions to find the value you want
  2. haha sorry, just saw the $date use, thought i'd pop in a trick.. but apparently it was irrelevant
  3. or use the mysql function NOW()
  4. how do i do that? thanks
  5. uh? whats the point in that?
  6. ok i've found the problem, but i don't know how to solve it... i'm use FileZilla to upload files, rather than editing them in the browser, because i hate doing that. So in my notepad++ it displays the code as i write it, in differenet lines. But i looked at the file on the server, and it displays it like this: <?php session_start();$head = false;require_once '../../include.php';$id = mysql_real_escape_string($_GET['id']); so the whole thing is on 1 line...which makes it impossible to solve errors. I've tried re-loading the file to get it into different lines, buts it not working... hm, any ideas how to make that automatically go to seperate lines... i don't have this problem in all my other files i uploaded...
  7. if the file is not found, the script with die and give an error. Theres no need for all that checking you did, php automatically does it... test it out... try to require a file that doesn't exist
  8. nope..connect .php is just fine... here's the link to that: http://socialapps.sclek.com/posters/include/connect.php and heres the link to rate.php http://socialapps.sclek.com/posters/include/rating_system/rate.php this is soooooooooo weird. the contents of rate.php are exactly, character by character, the same as written above. could this be an error of php malfunctioning?
  9. i am getting this error: Parse error: syntax error, unexpected T_VARIABLE in /home/socialap/public_html/posters/include/rating_system/rate.php on line 1 from this code: connect.php has no errors... i've already tested it. Maybe i'm just blind, but i can't seem to find out why i would ever get this error!?!? thanks. <?php include('../../connect.php'); $id = mysql_real_escape_string($_GET['id']); $rating = mysql_real_escape_string($_GET['rating']); if(empty($id) or empty($rating) or $rating > 5){ die("Invalid poster/no rating"); }
  10. i have simple rating system. When the mouse hovers over that star, it and every number star below it turns red, the others stay yellow.... It was working was using the HTML code for stars, but then i turned into images and it got all messed up. hm... any help is appreciated. thanks <center> <div id="rating_div" width="200px"> <center> <div align="center" class="style2" onmouseover="this.style.cursor='default';"> <span id="s1" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover= "overStar(this.id);"><img src="http://socialapps.sclek.com/posters/include/rating_system/images/star.gif"></span> <span id="s2" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover= "overStar(this.id);"><img src="http://socialapps.sclek.com/posters/include/rating_system/images/star.gif"></span> <span id="s3" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover= "overStar(this.id);"><img src="http://socialapps.sclek.com/posters/include/rating_system/images/star.gif"></span> <span id="s4" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover= "overStar(this.id);"><img src="http://socialapps.sclek.com/posters/include/rating_system/images/star.gif"></span> <span id="s5" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover= "overStar(this.id);"><img src="http://socialapps.sclek.com/posters/include/rating_system/images/star.gif"></span> </div> </div> <?php $res = mysql_query("SELECT rating_id FROM ratings WHERE user_id='$user' and poster_id ='$id' LIMIT 1")or die(mysql_error()); if(mysql_num_rows($res) == 0){ ?> <script type="text/javascript"> var color1 = "#faf4a3"; var color2 = "#f1ec5b"; var color3 = "#e1e558"; var color4 = "#c5c32b"; var color5 = "#978d00"; function overStar(starID){ var starNo = starID.charAt(1); for(var i=1; i<=5; i++){ if(i<=starNo) document.getElementById('s'+i).innerHTML = "<img src='http://socialapps.sclek.com/posters/include/rating_system/images/star-ps.gif'>"; if(i>starNo) document.getElementById('s'+i).innerHTML = "<img src='http://socialapps.sclek.com/posters/include/rating_system/images/star.gif'>"; } } function outStar(starID){ var starNo = starID.charAt(1); var rating = document.MyReview.rating.value; for(var i=1; i<=5; i++){ col = "color"+i; if(i<=rating){ document.getElementById('s'+i).innerHTML="<img src='http://socialapps.sclek.com/posters/include/rating_system/images/star.gif'>"; document.getElementById('s'+i).style.color=eval(col); } if(i>rating) document.getElementById('s'+i).innerHTML="<img src='http://socialapps.sclek.com/posters/include/rating_system/images/star-ps.gif'>"; } } function starSelection(starID){ var starNo = starID.charAt(1); var code = '<iframe src="http://socialapps.sclek.com/posters/include/rating_system/rate.php?id=<?php echo $id ?>&rating='+ starNo +'" frameborder="0" scrolling="no" width="200" height="100" >Loading...</iframe>'; document.getElementById('rating_div').innerHTML = code; document.MyReview.rating.value = starNo; for(var i=6; i>0; i--){ col = "color"+i; if(i<=starNo){ document.getElementById('s'+i).innerHTML="&#9733;"; document.getElementById('s'+i).style.color=eval(col); } if(i>rating) document.getElementById('s'+i).innerHTML="&#9734;"; } } </script>
  11. how do i put all the names of the files in a folder into an array without manually entering the name of each file???? thanks. (i have over 100 graphics i need documented, and really don't want to have to do this by manually entering the names in by hand. blah)
  12. hm... mysql time function is confusing.. any other ways? thanks.
  13. i have this timestamp: 2008-12-19 21:26:39 and i want to see how many days ago this was... how would i do that? thanks.
  14. ohhhh haha ya that's what i meant.... typing too fast. thanks,
  15. getting a werid error: Warning: Wrong parameter count for mysql_num_rows() in /home/socialap/public_html/posters/upload.php on line 7 line 6: $rs = mysql_query("SELECT * FROM users WHERE user_id='$user' and key='$key' LIMIT 1")or die(mysql_num_rows()); line 7: if (isset($_POST['submit']) and (mysql_num_rows($rs) > 0)) { the page has already been connected to the DB
  16. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/socialap/public_html/posters/index.php:1) in /home/socialap/public_html/posters/index.php on line 2 These are the first two lines... And session_start() is not called anywhere else. <?php session_start(); ?> Hm.... whats wrong here? Thanks.
  17. OHHHHHH. nvm. permission denied. Must be my server.
  18. thanks. I'm getting this error now: Warning: move_uploaded_file(../images/posters/dog-walk.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/socialap/public_html/posters/upload.php on line 13 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php2K6sRa' to '../images/posters/dog-walk.jpg' in /home/socialap/public_html/posters/upload.php on line 13 the directory is structured like this: the file that upload.php is in also contains images folder, which contains posters folder.. so "images/posters/" would be the correct upload directory, no? Thanks.
  19. sweet. thanks.. already running into problems... and this is what i'm getting from it: Possible file upload attack! Here is some more debugging info:Array ( ) File is not uploaded into the directory. Any ideas? this is upload.php <html> <head> <title>Process Uploaded File</title> </head> <body> <?php $uploaddir = 'images/posters/'; $uploadfile = $uploaddir . basename($_FILES['userFile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userFile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); ?> <br> <form action="upload.php" method="post"><br> Type (or select) Filename: <input type="file" name="userFile"> <input type="submit" value="Upload File"> </form> </body> </html> thanks
  20. i am creating a script to upload a picture. how do i grab the width, height, and extension of the image? Thanks.
  21. i have a div 500px wide... i have 3 columns, and want the left column to hug the left, middle column to align with the center, and the right column to hug the right... i know its something simple i just can't figure it out.. thanks! EDIT: nvm i figured it out. take the 500/3 for the width.. always something simple...
  22. oh. i have gimp2. does anyone know how to do this in gimp2? thanks for helping out
  23. i have an image is a circle. And i want the white background around the circle to blend in with the page's blue background... how do i do that? Thanks. echo' <img src="'.$appcallbackurl.'images/buttons/round_blue.gif" border="0"/>';
  24. maybe they are doing an update right now, but i can't read anything past the first post.... i wait 2 minutes on a page and the ad (the youtube one) won't load, along with everything below that point
  25. that gives you it from the root URL... went i echo that i get this.. /dev/index.php?Sdfg I just want: index.php?Sdfg Thanks
×
×
  • 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.