Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. When you load the page and look at the links, do they actually pass the number within the URL correctly? If so, you'd be best running some debugging on your variables. For example check each variable one by one, at the right point in the code, by adding an easy to find statement like: die('foo ' . $var_name); My bet is one of your variables isn't what you expect it to be...
  2. Why do you need a button if you already know how to use them?
  3. You're going to need a local copy in order to copy it to another web server. The only solution is as gevans says and point the form action to the right server, otherwise when they click the upload button on your site it will upload it your local server!
  4. Ha good point!
  5. Hah, this then: $str = '344frf4335vev4554g256'; $str = preg_replace('/[^0-9]/', '', $str); $str2 = preg_replace('/$44/', '', $str); if (strlen($str2) != 10 && strlen($str2) != 11) { print 'Invalid phone number...'; }
  6. Ah yes, perhaps this then: $str = '344frf4335vev4554g256'; $str = preg_replace('/[^0-9]/', '', $str); $str2 = str_replace('44', '', $str); if (strlen($str2) != 10 && strlen($str2) != 11) { print 'Invalid phone number...'; }
  7. Or you could use: $str = '344frf4335vev4554g256'; $str = preg_replace('/[^0-9]/', '', $str); if (strlen($str) != 10 && strlen($str) != 11) { print 'Invalid phone number...'; }
  8. Actually the space between the star and SELECT shouldn't cause a problem - or at least it doesn't on my version of MySQL (5.0.45) and being as 1 is an integer that shouldn't case a problem either - although it could be possible with different data types. Try the mysql_error() method shown and see what problems there are for you. Also is that all the code or is it possible there's a query later causing the error?
  9. It may be safer to take the variable out the string, being as $ is a special character in regex. I'm not totally sure on this though I've just always done it to be safe... preg_match("#".$var1."#", $var2, $match); NB This isn't the solution to your problem though - try Ken's suggestion.
  10. Yes. Firstly id does not have the dollar sign on it, so it's not a valid variable - though you couldn't echo that out anyway. If you wish for "id=" to be output as a string it needs quotes around it, or better yet left outside of the PHP like below. You were also missing a ; off the end of the statement by the way... window.location.href = "list.php?id=<?php echo $moj_id; ?>";
  11. Not to mention if you had it linked to the right page, you're trying to return the values like: $_POST[$username_pos] Which would equal to: $_POST[$_SESSION[$username]] Try instead, though baring in mind you should really secure your inputs, something like this: $_POST['username']
  12. Adam

    Mind blank!

    Excellent, thanks ever so much! I shall try this a little later on...
  13. Oops, just realised I showed you the escape function in the wrong place, should be: input = escape(document.getElementById("input").value);
  14. You could try passing the string through JavaScript's escape function: window.location.href = escape(url); I've got little experience with this though so I don't know if it will work...
  15. Actually to do that the user would need to have the font installed on their computer, radi8. You'd need to look into generating the image dynamically with PHP. Perhaps take a look at... http://uk3.php.net/imageloadfont
  16. If you don't already have one, create a "last_activity" kind of field within the "runeweb_forum_sub_categories" table with a DATETIME data type. You can then order by that instead... I imagine though you're going to have to do some extra work in order to update this field every time someone makes a post. Make sure there's not one there already...
  17. Replace: $select_forum_subcata2 = "select * from `runeweb_forum_sub_categories` WHERE `categorie_id` = '$cata_id' ORDER BY `position`"; With: $select_forum_subcata2 = "select * from `runeweb_forum_sub_categories` WHERE `categorie_id` = '$cata_id' ORDER BY `position` DESC";
  18. No within the code base of your forum. That's not the whole SQL though, it's just a part of the query, also note it'll be near the end. If you know PHP/MySQL, try searching through the files for "ASC" (turn off case matching) and trying to find the relevant query. As I said before though can't help you as we can't see the code. If you still have troubles probably best contacting the developer behind it, or someone else who uses the forum, and asking for help off them.
  19. Need to find the SQL that would look something like: ORDER BY whatever ASC and change the 'ASC' to 'DESC'. Without any kind of idea of the code though can't give any more help.
  20. Adam

    Mind blank!

    Pardon me, I was just mainly thinking along the lines of a tutorial. But.. Basically there's two tables, "cats" and "prods". Cats contains 'class_name' and 'mercedes' (amongst a few other things). Prods contains model_id, class_name, etc. So basically for each class returned from cats (that 'mercedes' = 0), I want to perform a count on prods to see how many products are in that class_name. Any better? Thanks
  21. Adam

    Mind blank!

    Hi all. Been trying to work out this query for a while now, but the mind's gone blank and I'm getting stressed! Basically trying to select categories from a table, and also a count of the products that exist in another table, within that category. If that makes sense? Very similar idea to forums showing the title of a post and the count of replies. I've tried allsorts; sub-queries, joins, etc. I just can't think how I could do it. Can anyone help? Thanks
  22. Just try it with something simple like Notepad++ ..
  23. Try adding quotes around the filename as you save, and if you're using Windows make sure known file extensions are not hidden (so you could just right click > rename).
  24. I'm not totally sure how to phrase it but I think the PHP script is the owner? I don't how to change the file permissions to enable the FTP user to own the file though... Oh and waynewex the current images I'm playing with are just some test products, and the file path is built up from several fields in the database. Occasionally the guy who uses the little app makes mistakes with the image and have it uploaded somewhere else, or name it wrongly or something and asks me to just correct it. I want to be able to just open my FTP client and quickly rename, delete or move the image without getting a permission denied message. If you follow me? Do you think the easiest / best solution right now be to just rewrite the code to use FTP to upload the image? Thanks Adam
  25. Try using it in Firefox and checking the error console there, you'll get a much more helpful error message!
×
×
  • 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.