Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
Well, I'll look at it this way: On my site, out of the 1.3mil hits in the past month from IE users alone, 37% are still IE 6.0 I'd say that's still a big market.
-
[SOLVED] How to make a variable equal the address bar.
Philip replied to czukoman20's topic in PHP Coding Help
There will be a button on the bottom left (under all the posts) that says "Topic Solved" I thought they moved it to the top right, but I guess not. -
Validating serial product serial numbers.
Philip replied to iconicCreator's topic in PHP Coding Help
change this line: $error = (in_array($_POST['serialNumber'], $serialNumbers))? null : 'A valid Product Serail Number Required!'; to: $error = (in_array($_POST['serialNumber'], $serialNumbers) && !empty($_POST['serialNumber']))? null : 'A valid Product Serail Number Required!'; (Added the !empty to make sure the field was at least filled in) -
I'm really desparate or really stupid - please help
Philip replied to kevinritt's topic in PHP Coding Help
Take a look at: http://www.lynnarts.org/about_us/admin/includes/bbcode.js I think you'll see the problem why (404) -
Agreed, especially for those who got Ultimate, and got screwed basically.
-
I finally downloaded it a few nights ago, haven't had a chance to actually install it on my spare hdd. I'll admit it, vista actually grew on me and I'm kinda looking forward to the final Windows 7... I'm probably going to take back that statement in the not too distant future.
-
[SOLVED] Help with MadTechie's Dynamic DropDown PHP/AJAX code
Philip replied to larsbrimmer's topic in PHP Coding Help
Change: if (!$result = mysql_query("SELECT * FROM RayMusicCategories WHERE PARENT=0")) { echo "Database is down"; } to: $result = mysql_query("SELECT * FROM RayMusicCategories WHERE PARENT=0") or die(mysql_error()); -
[SOLVED] can someone tell me why this conditional isn't working
Philip replied to cluelessnoob's topic in PHP Coding Help
Make sure to use == instead of = in conditional statements. = set's the value, == compares it -
In order for wamp to process it, it must be in the www folder. You are able to specify where it is in one of the settings, but it's been so long since I've had to change that, I'd recommend just googling it.
-
<?php // get the URL variable $pageVar = $_GET['page']; // create an array of acceptable pages the user can load: $acceptable = array('main', 'about', 'news', 'contact'); // let's check to see if the variable in the url is in the array or not: if(!empty($pageVar) && in_array($pageVar, $acceptable)) { // load the page } else { // that page is invalid! // we can show an error page, or redirect the to the // default page } ?> I'm not sure how you want to include the pages, but that's the basic syntax
-
Okay, we're going to use GET variables, which are the ones in the url. So, if I visit foo.com/bar.php?var=value, I can do the following: <?php echo $_GET['var']; // this will show "value" ?> So, in your case we can do a few things... a switch statement or use arrays I'd recommend going with arrays, as it's the easiest to update.... let me get you some code real quick. If you have access to the server, play around with trying the code above
-
Separate your mysql_fetch's and queries, and run or die(mysql_error()); on each of the queries: Example, your check username: $checkUsername = mysql_num_rows(mysql_query("SELECT `id` FROM `users` WHERE `username`='".$username."' LIMIT 1")); Change to: $checkUsernameQ = mysql_query("SELECT `id` FROM `users` WHERE `username`='".$username."' LIMIT 1") or die(mysql_error()); $checkUsername = mysql_num_rows($checkUsernameQ);
-
Make sure you are visiting the page via a browser & http://localhost/ - and not just trying to open the page by double clicking the file.
-
Well, that was just an example. Post your code that you're using now, and 'll try my best to explain how to integrate it & possibly improve your current code.
-
Trouble installing secure image php captcha on form
Philip replied to megany's topic in Third Party Scripts
Looking earlier on your form, I saw the captcha but didn't have time to reply. What I think is happening, is every time you submit the form you are calling to create a new security image, thus creating a new security code & making the one the user saw invalid: $securimage = new Securimage(); When you read through this tutorial, you might understand it better (notice the session key vs post value?): http://www.codewalkers.com/c/a/Miscellaneous/Creating-a-CAPTCHA-with-PHP/ -
So, it won't show the link? echo $_SESSION['message'].' <a href="logout.php">Log out</a>'; is correct. Would display:
-
Ding ding ding! We have a winner!
-
if(!$_GET['page']) $pageToInclude = 'news.html';
-
See my above post. I just noticed you're missing a semicolon on the $connect line. Anyways, you need to move the connect statement above the query statement, and add in the or die() part. It'll tell you all the errors when try to run the query. -- Your new post, change: mysql_fetch_array (db.mySQL,$result, MYSQL_BOTH) to mysql_fetch_array($result) Look at parameters you should pass to the function, you won't need "db.mySQL"
-
Please use the code tags next time Why do you have $connect = mysql_connect('host', '*****', '*****') or die(mysql_error()) // ERROR BELOW, because of look at line above... while ($row = mysql_fetch_array(db.mySQL,$result, MYSQL_BOTH)) Then, at the top: <?php include('dblogin.php'); ?> <?php $mysql="SELECT * FROM products"; $result=mysql_query($mysql); Connecting AFTER you try to run the query? Also, for future debugging its easier to have an 'or die(mysql_error())' statement on the end. $result=mysql_query($mysql) or die(mysql_error()); (removed your user/pass in connect statement)
-
That's handy, thanks! Typically I can get all versions of IE to look the same (except for png transparencies) - but this is a great tool Probably best in misc. talk though - IMO.
-
[SOLVED] SOLVED! THANKS! What is wrong with this code?
Philip replied to affluent980's topic in PHP Coding Help
Are you sure?? The query is executed on the next line! The semicolon is OK, but not needed in this case. There are better ways (IMO) of running multiple queries, but this is getting offtopic. -
Are you wanting to search the whole database, and not just one table?
-
[SOLVED] Hey! I didnt I just kick you out?
Philip replied to NorthWestSimulations's topic in PHP Coding Help
I think you're about to get 50 different answers, lol Web host list, another topic about this very thing. Personally, I do site5. Never had a problem -
[SOLVED] Hey! I didnt I just kick you out?
Philip replied to NorthWestSimulations's topic in PHP Coding Help
Well, it really depends on your hosting. What do you have? (if you have a cPanel backend, take a look here - it's pretty basic)