-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Pagination - First page is great, next pages are blank
Adam replied to ArizonaJohn's topic in PHP Coding Help
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... -
Suggestion: [PHP] [/PHP] Tags
Adam replied to DarkSuperHero's topic in PHPFreaks.com Website Feedback
Why do you need a button if you already know how to use them? -
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!
-
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...'; }
-
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...'; }
-
Or you could use: $str = '344frf4335vev4554g256'; $str = preg_replace('/[^0-9]/', '', $str); if (strlen($str) != 10 && strlen($str) != 11) { print 'Invalid phone number...'; }
-
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?
-
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.
-
[SOLVED] Javascript / PHP Page forwarding not working
Adam replied to kingnutter's topic in Javascript Help
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; ?>"; -
Registration form problem, DB entry empty. Think variable passing prob.
Adam replied to jmcc's topic in PHP Coding Help
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'] -
Excellent, thanks ever so much! I shall try this a little later on...
-
$_GET and $_POST with foreign languages, specifically Hebrew
Adam replied to aooga's topic in PHP Coding Help
Oops, just realised I showed you the escape function in the wrong place, should be: input = escape(document.getElementById("input").value); -
$_GET and $_POST with foreign languages, specifically Hebrew
Adam replied to aooga's topic in PHP Coding Help
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... -
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
-
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...
-
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";
-
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.
-
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.
-
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
-
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
-
Just try it with something simple like Notepad++ ..
-
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).
-
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
-
copying info from textbox 1 & 2 into box 3
Adam replied to M.O.S. Studios's topic in Javascript Help
Try using it in Firefox and checking the error console there, you'll get a much more helpful error message!