Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 OK, try this:
if (!isset($_POST['dogname']) || ($_POST['dogname'] == '' ) )
{
die( "Oops! You forgot to fill in the name!" );
}
Works for me. I think there was an extra parentheses... |
Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 Try eliminating the opening parentheses in "if ( ( !isset( $_POST['dogname'] ) )". And check to make sure you've got all your braces in there correctly. |
Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 |
Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 |
Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 In any case, your if structure:
<?php
//Make sure the name form is filled out.
if ((isset($_POST['dogname']))
|| ($_POST['dogname'] == "))
die("Oops! You forgot to fill in the name!");
?>
... |
Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 No, no. Sorry for miscommunication: post that here. Put (no space) and then put the code in between there. Then post all that here so we can see it all better.
Or better yet, edit your original... |
Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 Wrap your code around [code=php] tags, and post, and they should have automatic line counts. And highlighting, which is tons easier to read. |
Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 |
Forum: PHP Aug 12th, 2008 |
| Replies: 22 Views: 1,512 Just wondering, where is line 40?
But some errors I spotted:
1. Your "$ownerid = $_SESSION['id']" needs a semicolon.
1. I think that your if ((!isset($_POST['Buy Dog'])) has an extra... |
Forum: PHP Aug 11th, 2008 |
| Replies: 19 Views: 1,918 Again, I think if you just check it using is_numeric, you should be fine. |
Forum: PHP Aug 11th, 2008 |
| Replies: 5 Views: 451 A third option would be not to echo it in PHP at all. Just write it the normal way, and when you need to use PHP variables, just open and close PHP tags where needed. |
Forum: PHP Aug 11th, 2008 |
| Replies: 3 Views: 1,879 Others would be $_GET, $_POST, and $_FILES. For a full list, see here (http://hk2.php.net/manual/en/reserved.variables.php). |
Forum: PHP Aug 11th, 2008 |
| Replies: 5 Views: 451 Javascript and PHP can't go together. So is my information, anyway. |
Forum: PHP Aug 11th, 2008 |
| Replies: 6 Views: 1,084 Ok...
1. When you do "$this->mail_id = $mail_id;", you're referencing the same thing. $this->mail_id is used inside functions to reference the variables in the parent class. So, basically, your... |
Forum: PHP Aug 11th, 2008 |
| Replies: 3 Views: 504 Take a look here (http://snippets.dzone.com/posts/show/2604). Rather simple, really. |
Forum: PHP Aug 11th, 2008 |
| Replies: 5 Views: 563 Don't have such a big page. Seriously, if you have a page needing more than 30 sec. to load, it's just gotta be way too bulky. |
Forum: PHP Aug 11th, 2008 |
| Replies: 19 Views: 1,918 Take a look here (http://www.forum.jaoudestudios.com/viewtopic.php?f=13&t=103) for a couple of small functions that will help you, in terms of handling user input.
Also, if you're passing a... |
Forum: PHP Aug 9th, 2008 |
| Replies: 5 Views: 563 php.ini has a value to set the maximum execution time. In the .ini, it's max_execution_time. For your script, it would be set_time_limit ($seconds).
Although if you have an execution time of over... |
Forum: PHP Aug 9th, 2008 |
| Replies: 4 Views: 463 I would not suggest you publish your password online. Also, can you be be more specific about your problem? |
Forum: PHP Aug 8th, 2008 |
| Replies: 3 Views: 488 Just as an added suggestion, if you have mostly HTML and not a lot of PHP, you can just post the HTML regularly, and then add the php in. For example:
<br />
<a href="activity_list.php?id=<?php... |
Forum: PHP Aug 8th, 2008 |
| Replies: 17 Views: 1,213 What problem exactly would you have by adding the sql query? |
Forum: PHP Aug 8th, 2008 |
| Replies: 5 Views: 555 Have you uncommented the extension in php.ini for mysqli? That may be your problem. |
Forum: PHP Aug 7th, 2008 |
| Replies: 1 Views: 837 1. I'm presuming you're using MySQL?
2. What do you mean by "all the information held within the database"? Does that mean all the tables, or all the rows within the tables?
If you means the... |
Forum: PHP Aug 7th, 2008 |
| Replies: 17 Views: 1,213 In which case, you could change the query. Under the if(!logged_in) part, after the first query:
$names = mysql_query("SELECT name FROM members WHERE id != 'president'");
while ($info =... |
Forum: PHP Aug 7th, 2008 |
| Replies: 2 Views: 564 Just don't use $HTTP_POST_FILES, sinces that's deprecated. You can just use $_FILES instead. |
Forum: PHP Aug 7th, 2008 |
| Replies: 5 Views: 517 I'm also pretty sure that you need single or double quotations for your statements, i.e. $bank['bank_balance']. Also, it would make it a lot easier if you you highlighting for the code (i.e.... |
Forum: PHP Aug 7th, 2008 |
| Replies: 17 Views: 1,213 Well, I don't know all your database, but here's a sample script I would use:
if (!logged_in)
{
$query1 = mysql_query("SELECT * FROM membersinfo WHERE id = 'president'");
while ($row =... |
Forum: PHP Aug 5th, 2008 |
| Replies: 12 Views: 1,095 Yes, is it is free, although that does not automatically mean "open-source". Open-source means that you make your source code available for public viewing. So you can be free but not open-source... |
Forum: PHP Aug 5th, 2008 |
| Replies: 12 Views: 1,095 MySQL is what you would want to use for your database. I would suggest you use PHP to access the MySQL, as is it really use to connect with that. |
Forum: PHP Aug 4th, 2008 |
| Replies: 9 Views: 663 I'm thinking with PHP you can just use str_match. But if you want something a bit more advanced, have you every looked at Sphider (http://www.sphider.eu/about.php)? |
Forum: PHP Aug 4th, 2008 |
| Replies: 4 Views: 971 This should be the solution:
// File: viewmail.php?id=2
<?php
// security
if(!(is_numeric($_GET['id'])))
{
echo 'Error'; |
Forum: PHP Aug 4th, 2008 |
| Replies: 4 Views: 971 SELECT * FROM emails LIMIT (1, 10)
That would be the SQL query for your first page. Then:
SELECT * FROM emails LIMIT (11,10)
For the second page. Repeat, and you have it |
Forum: PHP Aug 4th, 2008 |
| Replies: 5 Views: 2,233 Just asking for a "sample site" in php isn't that easy. What exactly are you looking for? |
Forum: PHP Aug 4th, 2008 |
| Replies: 3 Views: 1,224 First off, I would suggest you delete all that spam from your guestbook.
Second, what is in recaptchalib.php? If there's something wrong, I would suggest you look at the page you included. |
Forum: PHP Aug 4th, 2008 |
| Replies: 2 Views: 2,018 MySQL. Easy, look it up. I would think that if you had been using PHP for a year, you would know about the different SQL languages by now.
Anyway, look up MySQL, and if you need to go get a book... |
Forum: PHP Aug 2nd, 2008 |
| Replies: 16 Views: 4,569 Not at all...not to mention you got it done by yourself, anyway. Good luck going on... |
Forum: PHP Aug 2nd, 2008 |
| Replies: 16 Views: 4,569 I would suggest you put item_id as AUTO_INCREMENT, if you haven't done that already. Beyond that, I don't know if I can help you further, as MySQL is not so much my specialty. |
Forum: PHP Aug 2nd, 2008 |
| Replies: 16 Views: 4,569 Looking around, I think it may be advisable to put item_id as AUTO_INCREMENT. That seems to have fixed the problem before with other people.
And just curious, why are you starting at 8 for your... |
Forum: PHP Aug 2nd, 2008 |
| Replies: 16 Views: 4,569 Not really...
Anyway, "Duplicate entry '0-8' for key 1" tells me you may have a problem with your mysql table. How exactly is that configured? |
Forum: PHP Aug 2nd, 2008 |
| Replies: 5 Views: 977 This is assuming of course, you're guarding against SQL injections, before you send all this stuff... |