Jump to content

squiblo

Members
  • Posts

    483
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by squiblo

  1. could you post your code? inserting into the database like that should be fine and no need to worry about sql injection
  2. I am making a script to delete images from user albums, each photo has a value to show what place in the album they come, when I delete an image the order will change and may look like this "1, 2, 3, 7, 8...." to I am trying to change this so the order does not change and will always increase by one every time. "1, 2, 3, 4, 5......". Here is what I have tried.... //count how many photos are remaining in the album $query = mysql_query("SELECT recordListingID FROM photos WHERE usr_id='{$uid}' AND album='{$aid}' ORDER BY recordListingID ASC"); $photoCount = mysql_num_rows($query); $row = mysql_fetch_assoc($query); //if there are still images remaining update recordListingID if ($photoCount != 0) { for($i=1;$i>=$photoCount;$i++) { $recordListingID[$i] = $row['recordListingID']; $update_listing = mysql_query("UPDATE photos SET recordListingID='{$i}' WHERE recordListingID='{$recordListingID[$i]}' AND usr_id='{$uid}' AND album='{$aid}'"); } } else exit(); Thanks
  3. solved, for some reason die doesn't work, I used print instead.
  4. <?php session_start(); include('../../connect.php'); //example string....... 6/8/32/54/(*split*)42 $array = explode("(*split*)", $_POST['data']); //photo id's to remove (in array form) $pids_array = $array[0]; //album id to remove from $aid = $array[1]; $pids = explode("/", $pids_array); die(count($pids)); ?> For some reason, nothing is outputted, but if I change the line die(count($pids)); to something like die($pids[3]); I will get an output.
  5. $sting = "bo'''''''b"; if ($string has more than one ') echo "you have more than one '"; How can this be done?
  6. if I do this... $fname = "bob'"; $fname_test = eregi_replace("([A-Z']+)","",$fname); die($fname_test); The output is "\";
  7. The below code is what I currently have, I also want to replace single quotes (inverted commas, apostrophe, whatever you call them) but have no idea how to do this. Thanks. $fname_test = eregi_replace("([A-Z]+)","",$fname);
  8. I am making a register script and I am trying to give an error for passwords that are not recommended, such as "password" or the password being the same as the username. Something like this.. if ($newpass == "password") But the problem with this is, the user might enter "paSSwOrd" and the condition will say they do not equal, so what can I do so the capitals the user inputs does not matter. Sorry if you do not understand, I find it hard to explain. Thanks
  9. The problem that I am having is visible in the file I have attached, it is a response from a php file, any ideas on how I can try and find where the problem is, and what things I should try? If you didn't notice the response "success" is on a different line. Thanks [attachment deleted by admin]
  10. @thorpe, please could you elaborate so I could do some research on google
  11. Hello, I have recently partnered up with a new friend to help design and develop a website, as I live in the UK and he lives in the USA. How can we communicate, work together as a team so we always know what we are both doing in the most effective way possible? Thanks.
  12. Hello, in this post I am not really asking how I can improve the design, I know it's really simple and does not look too great but if you feel like the design should be improved please let me know. My main focus is on the content, how can I improve the content in any way to make the user want to remember the website and come back to it in the future, all ideas and suggestion will be very much appreciated. http://www.squiblo.com Thank you in advance.
  13. try... elseif($locked=="1")
  14. Turned out the problem was else where
  15. For example if $row['surname'] = "I'ts Tuesday" it would mess up because of the inverted comma in "I'ts"
  16. Some of my data in sql have inverted commas in them, and when I try to echo them out, they kind of mess up, this is what I have tried but I am obviously doing something wrong. Thanks htmlspecialchars(stripslashes(mysql_real_escape_string($row['surname'])));
  17. google "javascript style display block none"
  18. Sorry Haku, I have just realised that the string could contain more than one hidden input so I want to get the value depending on which value I want to get by the name. ^^ That sounds confusing sorry, If you don't understand I'll try again.
  19. Lets say I have this variable containing this string.. var hidden_input = "<input type='hidden' name='age' value='10yearsold'>"; How can I get the value of the hidden input from the variable? Thanks.
  20. also single quotes and double quotes are added or removed depending on the browser, how could I get past that?
  21. I have just done a check.. this is a sample of what is in my .txt file (just entering random gibberish) but when i alert what is in the content of the div where the chat is outputted it shows this... here I used google chrome, and in IE it changes tags into capitals
  22. becuase using innerHTML slightly changes code for example in IE <span id='test' style='color:red'> will change to <SPAN id=test STYLE="color:red"> but in firefox innerHTML changes the code differently, so they could be the same in some browsers but maybe not in others, if you get me
  23. I have made a good working chat and these are the steps the chat goes through to output new messages. 1. Count number of words in the chat .txt file 2. Count number of words in the div where the chat is outputted 3. If the word counts are both the same check again 4. If they are different then the div innerHTML will = the chat .txt file the problem is that i want it to me milliseconds faster, and counting words does not seems the most logical way to check if they are different. Any ideas? Thanks
  24. Could somebody please take a look, I've been struggling for a few weeks now.
×
×
  • 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.