Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
If you're using Firefox, someone has also posted comments about deleting cookies for it. The above example does not look like it will work for deleting a cookie for IE7...it looks like it just extends it, or deletes the value for it. Also, make sure you're using the full domain and all of the parameters. If you set it for domain.com, then delete it for www.domain.com and then you're on domain.com again, the cookie will show. It might not even be the cookie, it might be your code. We'd need to SEE the code to tell.
-
[SOLVED] Any one see whats wrong with my query?
Jessica replied to SirChick's topic in PHP Coding Help
use die(mysql_error()); instead of your "username does not exist" message, as was suggested a few times now. -
from the manual: If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Appendix O, List of Supported Protocols/Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script. I wouldn't ever include files using a URL. You can use the $_SERVER variables to get the path.
-
http://us3.php.net/manual/en/language.operators.logical.php
-
I always want my code to be exciting, who wants uniform, easy to read code? If you really want to break up the dull, try using ASP style tags every now and then, or random indentation!
-
Getting database results and spreading over pages issue. HELP !! :(
Jessica replied to scotchegg78's topic in PHP Coding Help
Ken, he wants to know how many pages he'll need. Look. Do one statement to get the number of rows you would have. Which according to your EXISTING code, is every row in the table. You're not selecting any specific ones, you're selecting all of them. "SELECT COUNT(CompanyID) AS total_entries FROM company"; total_entries will be how many entries are in the table. Then divide it by however many you want per page and you've got your number of pages. Then select the rows you want. There are also a billion pagination tutorials out there for you to read, some of them on phpfreaks.com already. -
Getting database results and spreading over pages issue. HELP !! :(
Jessica replied to scotchegg78's topic in PHP Coding Help
"I am using count already, only its getting the entire table size, and not my sql query size." What? What are you trying to get? The number of rows in the table, yes? If you want the number of rows in a specific query, do it. SELECT COUNT(*) AS numrows FROM company WHERE whatever else you want -
A blank page with no errors could mean you don't have error reporting turned on. Add this to the top of your pages: ini_set('display_errors', 1); error_reporting(E_ALL);
-
Getting database results and spreading over pages issue. HELP !! :(
Jessica replied to scotchegg78's topic in PHP Coding Help
Did you lookup COUNT to see what it was before saying it won't work? -
I didn't quite read all of the above posts, sorry. But for a "family tree" type database I'd do this as a basic design: Person Table ID Name Birthdate, ETC. Relationships Table Person1ID Relationship (EG, how is person1 related to person2: father, mother, sibling). Any other relationships can really be derived from the other relationships given. Person A's mother's brother is their uncle. Person2ID
-
Getting database results and spreading over pages issue. HELP !! :(
Jessica replied to scotchegg78's topic in PHP Coding Help
You'll have to do two select statements, yes. One to get the number: Use COUNT() And then one to get the 50 rows you want. -
If you don't know how many columns are in your table, you have not designed your database well.
-
help needed with changing td background with css and php
Jessica replied to spindriftmed's topic in PHP Coding Help
I don't see a problem with it...what do you mean it is the default everytime? The site looks .. fine. -
You need to use Javascript (and/or AJAX) to do that.
-
help needed with changing td background with css and php
Jessica replied to spindriftmed's topic in PHP Coding Help
It looks fine - do you have a link to the page live, maybe that will help? -
look up add_slashes and strip_slashes. Quotation marks denote strings, so you need to escape them.
-
help needed with changing td background with css and php
Jessica replied to spindriftmed's topic in PHP Coding Help
I'd have to see the new CSS file. Post it within code tags! -
Yes, but it's ONE constant, as opposed to on every page. It will take two seconds to change.
-
help needed with changing td background with css and php
Jessica replied to spindriftmed's topic in PHP Coding Help
I think you need to learn more about CSS -
Hey, at least you were already encrypting them! Good job
-
http://us.php.net/setcookie Look at: Example 1588. setcookie() delete example http://us.php.net/manual/en/features.cookies.php
-
[SOLVED] Simple help with a PHP echo to a confirmation page
Jessica replied to shaunmacie's topic in PHP Coding Help
You need more than one session variable. $_SESSION['from'] and $_SESSION['name']; It's an array. -
So when you need to print "January" you use $months[$month]; When you want 1, you use $month;
-
Making a switch statement is a lot more code than an array
-
Are your passwords encrypted in the database? You shouldn't store plain passwords. Change this code: $sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'"); $login_check = mysql_num_rows($sql); To $sql = "SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'"; $result = mysql_query($sql) OR DIE(mysql_error().' - '.$sql); $login_check = mysql_num_rows($result); print 'Rows: '.$login_check; code]