Jump to content

joquius

Members
  • Posts

    319
  • Joined

  • Last visited

Everything posted by joquius

  1. Man, where is $getthreads3[postid] defined? (The one in the SQL query) $query = "UPDATE forumtutorial_posts SET forumlock = '$forumlock', title = '$title' WHERE postid='$getthreads3[postid]' "; You need to pass the id of the value you're editing to the code with a hidden input box or something.
  2. Mehh. I'm just about ready to kick the ass of the guy who wrote the python manual. Why is there no obvious list/dictionary method list? Why is there no proper search? Anyone know what the python equivalent of PHP's array_search is? Basically trying to get a key according to a value, rather than value according to a key.
  3. Can you not use regex for it? Then you don't have to be so specific about the delimiters
  4. I have a query which searches a mediawiki database, the problem being the case sensitive nature of the binary collation which is used for text revisions in mediawiki. I know that I could simply compare both lowercase, or ucfirst() the search string but it just lengthens the query. I would use regex, but I'm not to sure if pattern modifiers even exist in the regex that comes with MySQL 5.0. Oh and I'm definitely not changing the collation in the database itself. :-X Any help is appreciated
  5. well first you could close the row, but I think you're talking about a html problem no?
  6. What exactly is it for? Could you just use an array like '$page_vars' or something?
  7. foreach ($file) { } will loop the specific files with their file names well obviously not $file, but the array you're talking about
  8. $a = getimagesize($url); $a[0]; // x dimension $a[1]; // y dimension $a[2]; // file type (numeric, check php for the types http://www.php.net/function.getimagesize )
  9. Hmm $str = preg_replace ("/[^0-9]([0-9]+)/", "$1", $str); // for pounds $str = preg_replace ("/([0-9]{1,2})[^0-9]/", "0.$1", $str); // for pence This is of course assuming the format will be pound(digits) (digits)pence
  10. $text = htmlspecialchars ($text); or $text = str_replace (">", ">", $text); $text = str_replace ("<", "<", $text); and smilies, stuff like: $array = array ("/\: )/", "/\: P/"); $array2 = array ("<img src='smile.jpg' alt='' />", "<img src='blah.jpg' alt='' />"); $text = preg_replace ($array, $array2, $text);
  11. wouldn't it be easier to store the image numbers as an array, considering the fact that they contain no data?
  12. The bottom line with functions/objects/loose code is: If you use it once, it should be loose, if you use it a lot and it's static, use a function, if it's the core of your software it should be an object. The main idea is to keep away from using objects for everything. MediaWiki is a great example of OOP php. Software actually runs faster with no classes and only functions, but it can become impossible to maintain. So you're balancing speed and maintenance.
  13. http://www.php.net/mail lots of solutions here.
  14. you may want to use mysql_fetch_array, what errors, problems are you having with the code?
  15. there's no reason this shouldn't work, perhaps you set them inside/outside a function and haven't set them as globals? Can you send more of the code?
  16. mail ( $_POST['firstName']."<".$_POST['email'].">", "Thank You", "Hello, Hello, Hello", "Content-Type: text/html; lalala" ); http://www.php.net/function.mail
  17. oh, just escape some stuff, should work echo '<a href="index.php?page='.$link.'" '.(($page == $link) ? 'class="active"' : '').'>'.$link.'</a>';
  18. you have register globals on and the server doesn't?
  19. well I don't know, preg_match_all ("/<name>[^<]*<\/name>/", $xml, $names); and if you like foreach ($names[0] as $name) $_names[] = preg_replace ("/<name>([^<]*)<\/name>/", "$1", $name);
  20. document.getElementsByTagName('name')[0].childNodes[0].nodeValue; but thats js
  21. first of all it might be easier to do the following: $links = array ("home", "bios", "platform", "events", "team"); foreach ($links as $link) { echo '<a href="index.php?page=$link" '.(($page == $link) ? 'class="active"' : '').'>$link</a>'; }
  22. Umm... <? // the list $query = mysql_query ("SELECT * FROM `table`"); while ($data = mysql_fetch_array ($query)) { ?><a href="?city=<?=$data['id']?>"><?=$data['name']?>< / a ><? } ?> <? // the page $id = (isset ($_GET['city'])) ? $_GET['city'] : $default; $city = mysql_query ("SELECT * FROM `table` WHERE `id` = '$id'"); ?>html... and if it's a select list; onclick="'window.location='?city=<?=$data['id']?>'"
  23. something like: if (strlen ($url) > 50) { $url = preg_replace ("/([^\\\\]{15}([^\/]{1,10}\/|[^\\\\]{10})).*?([^\\\\]{1,25})$/", "$1.../$2", $url); }
×
×
  • 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.