Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. Your terms in the arrays are not regular expressions and you don't reference the matches like that... [code[ $answer = "car bus train rabbit computer"; $search = array('/(rabbit)/', '/(computer)/'); $answer2 = preg_replace($search,'<font color="red">$1<font>',$answer); ?>
  2. You can't do that client side BUT once the info is sent you should validate it in your script anyway - that is standrad practice for good code. If any of the data fails validation simply show teh form once more with the invaldi fields highlighted.
  3. that method or refresh HAS to go in the HEAD section of your html NOT in the body.
  4. if you had used an array as the cookie nam ethen you could do it with just one command if you didn't then I think you'll have to do them all individually.
  5. each tim eyou go through the loop $maxheight gets set again... So first time it is set to 23 then 78 then 416. Look at the logic maxheight only gets reassigned when the current balue is less than image height.
  6. I think you need opener.location = in your js somewhere... This should be in js forum.
  7. That query is open to mysql injection... you should (in cases where update, insert or select could cause a disaterous problem with user inputted data) use mysql_real_escape_string on your parameters in the string... <?php $query = "SELECT * FROM `database` WHERE `username` = '" . mysql_real_escape_string($username) . "' AND `passowrd` = '" . mysql_real_escape_string($password) . "'"; $query = mysql_query($query) or die(mysql_error()); ?> with that code you can also check if users have tried to inject mysql by checking the variables against the escaped counterpart - if they don't match then some one is being naughty.
  8. Sort the array first... <?php $genres = array ( '1' => 'reggae', '2' => 'ska', '3' => 'country', '4' => 'jazz', '5' => 'metal', '6' => 'folk', '7' => 'acoustic', '8' => 'disco' ); sort($genres); foreach ($genres as $key => $val) { echo ($val); }
  9. Support for absolute positioning is patchy depedning on your dtd.
  10. When do I get made into a global moderator btw?
  11. <?php $arr = array(); foreach($array as $key => $add){ $image_height = round($_SESSION['imgheight'.$key]); if($add == "Yes") { $arr[] = $image_height; } } rsort($arr); print_r($arr); ?>
  12. OK mate we will leave you to it... I wish you would give it a try but I fear the dark-side is strong in you and betrayed we will be...
  13. What you need is a barcode scanning system coupled to an AI app running 2 redundant backup servers... and of course ensuring that nobody can pilfer the parts.....
  14. BUt if you use xhtml 1.1 you don't have to hack. There maybe the odd faux column but that is not junk html or junk css - just a little extra, still valid, css thats all. Then you can put the valid css, xhtml1.1 icons on your site for everyone to ignore or just think you are a geek.... Why on earth would you hack for FF though?????? Bizarre
  15. class test{ function fetchsomevalues() { $this->testvalue="1"; } } $fetcobj= new test; $fetcobj->fetchsomevalues(); echo $fetcobj->testvalue; #chocolate fireguard#
  16. Thats great.... But as I can't be bothered to read your code without knowing what the problem is I fear I am a useless pawn in your quest for glory...
  17. mate - there are millions of scripts out there - it depends on what you want to do... In my honest opinion these things are fundamental - if you don't know how to get php to connect to a database, push and pull info from the database and display then you should not be undertaking the project you are dealing with right now. I suggest you FULLY spec up your site requirements (spend a few hours reading www.webstyleguide.com) and then farm it out to someone who can do the work for you. Not getting at you but if time is a factor and you are asking these incredibly general questions then you don't have the time to pick up the skills on-the-job and hit deadlines while maintaining quality (and in this case security).
  18. you need to look at curl library - its in the manual... http://uk2.php.net/manual/en/ref.curl.php or you can set the headers - last one being Loction: 'paypalurl'
  19. foreach ($genres as $key => $val) { echo ($val); }
  20. sorry was looking in the second query string... The ' from $query1 ' will fail because $query1 is a result resource - you must have a string in there (that is a table name), show tables will return a list of all the tables so you have to pick which one you want and set $qruery1 to that value.
  21. yes so put an '@' in there it surpresses warnings alternatively use ini_set('error_reporting', 1); that will only output fatal errors. I think 0 or null switches them all off.
  22. do you want it writing for you? Good luck with that one.... Perhaps if you could be a little more specific about what kind of code you want, i.e. what functionality you need (login script, emailer etc. etc.)
  23. why have you taken the % signs out of the single quotes? He go that bit correct!!!! the problem is here from '$query1' ... switch that to ' from `$query1` ' or just ' from $query1 '
  24. echo out the query to your browser and then copy it into your db app (phpmyadmin or similar) and check the result of the query. The problem clearly lies with the WHERE clause so make sure that is spot on.
×
×
  • 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.