Hmm...tricky
Perhaps you could use foreach() along with preg_match()/any other thing that looks for stuff ?
Search found 205 matches
- Thu Feb 28, 2013 2:08 pm
- Forum: PHP
- Topic: Check if a string contains an item in an array
- Replies: 3
- Views: 803
- Thu Feb 21, 2013 1:18 pm
- Forum: Tutorials
- Topic: avatar upload problem
- Replies: 3
- Views: 800
Re: avatar upload problem
You need to make sure your form has been submitted, so you need to either: A) Check your post array for your submit button [syntax=php]<?php if(isset($_POST['submit_button_name'])) { // do something } ?> <form method="post"> <!-- Make sure you use name="" or your post array will ...
- Wed Feb 20, 2013 2:17 pm
- Forum: Tutorials
- Topic: PHP Tutorial: Blog(Including commenting)
- Replies: 10
- Views: 3181
Re: PHP Tutorial: Blog(Including commenting)
Ok. Is pid in the URL properly? ex: http://domain.com/blog_read.php?pid=21
If so, does the pid exist in the database?
If so, does the pid exist in the database?
- Wed Feb 20, 2013 1:31 pm
- Forum: Tutorials
- Topic: avatar upload problem
- Replies: 3
- Views: 800
Re: avatar upload problem
This makes it much harder to read without the opening <?php tag so here we go for anyone wondering: [syntax=php]<?php if (isset($_POST["car"],$_POST["first_name"],$_POST["about"])){ $errors = array(); } if (empty($_FILES["avatar"]["tmp_name"]) === fa...
- Wed Feb 20, 2013 12:53 pm
- Forum: Tutorials
- Topic: PHP Tutorial: Blog(Including commenting)
- Replies: 10
- Views: 3181
Re: PHP Tutorial: Blog(Including commenting)
[syntax=php]if (!isset($_GET['pid']) === false[/syntax]
The way you have this now is like saying, if it returns false on $_GET['pid'] being set and is identical to false. Remove the === false as the ! is doing all of that
The way you have this now is like saying, if it returns false on $_GET['pid'] being set and is identical to false. Remove the === false as the ! is doing all of that
- Tue Feb 19, 2013 2:06 pm
- Forum: Tutorials
- Topic: PHP tutorial: Blog (including commenting)
- Replies: 2
- Views: 867
Re: PHP tutorial: Blog (including commenting)
Are you actually going to the page with pid in the url? ex: m If so, does the pid exist in the database? If that doesn't work try making a new page and visit it like you would the blog page. Put the following in it: [syntax=php] <?php include('core2/init.inc.php'); // Test if you are using the url c...
- Mon Feb 11, 2013 1:06 pm
- Forum: PHP
- Topic: content won't display
- Replies: 1
- Views: 490
Re: content won't display
Well anything after the loop is being cancelled by your call of die(); which ends the entire script.
- Thu Feb 07, 2013 2:44 pm
- Forum: General Chat
- Topic: Game of Life
- Replies: 8
- Views: 5023
Re: Game of Life
I think I broke it Whatever it is.
- Thu Feb 07, 2013 2:40 pm
- Forum: PHP
- Topic: Youtube vid Login / Register system tut [ERROR]
- Replies: 6
- Views: 1384
Re: Youtube vid Login / Register system tut [ERROR]
[syntax=php]mysql_query("INSERT INTO `users` (`user_name`, `user_password`) VALUE ('{$user}', '{$pass}')");[/syntax]
That should be VALUES not VALUE. Just a simple spelling mistake
That should be VALUES not VALUE. Just a simple spelling mistake
- Wed Feb 06, 2013 12:53 pm
- Forum: Suggestions
- Topic: Download for a tutorial
- Replies: 2
- Views: 1659
Re: Download for a tutorial
There have been threads made on this in the past. Of which I can't find at the moment sooo.... Basic answer: 1. This site is made for the purpose of improving the programming of users. By giving a download for the code, we are removing that right of letting a user go through and understand how every...
- Thu Jan 31, 2013 6:47 pm
- Forum: Premium Items
- Topic: Advanced PHP Protection errors
- Replies: 1
- Views: 1677
Re: Advanced PHP Protection errors
Generally, your error will result from one of two reasons, and will be fixed once you figure out and fix one of them The errors can result from the file permission not being set high enough for php to access the file, or, the file does not exist. To fix this: For the permission denied error, you nee...
- Thu Jan 31, 2013 6:43 pm
- Forum: PHP
- Topic: cannot edit profile
- Replies: 89
- Views: 10956
Re: cannot edit profile
If there are no errors then check on the condition statements you are using. Check that everything that you are checking with isset() is actually set. Make sure to check spelling and case.
- Mon Jan 28, 2013 7:42 pm
- Forum: Tutorials
- Topic: My delete function doesn't work! (PM System)
- Replies: 2
- Views: 680
Re: My delete function doesn't work! (PM System)
[syntax=php]if(mysql_num_rows($result) === 1[/syntax]
One to many ='s here
One to many ='s here
- Wed Jan 16, 2013 7:42 pm
- Forum: PHP
- Topic: Warning: Missing argument 2 for server_online()
- Replies: 3
- Views: 734
Re: Warning: Missing argument 2 for server_online()
The error message says it all. You are defining the function here: [syntax=php]<?php function server_online($server, $port){ fsockopen($server, $port, $errno, $errstr); return ($errno === 0); } ?>[/syntax] Note that you have two arguments when defining it. $server, and $port. Now, when you are using...
- Wed Jan 16, 2013 1:14 pm
- Forum: PHP
- Topic: photo gallery
- Replies: 46
- Views: 6588
Re: photo gallery
Do an array_merge maybe, use print_r(), then source directly from the merged array.
- Tue Jan 15, 2013 11:36 pm
- Forum: PHP
- Topic: is my query correct?
- Replies: 5
- Views: 899
Re: is my query correct?
I personally would do it something like this: [syntax=php] <?php // to select all columns in a table, do SELECT * FROM table (with an asterisk) if(isset($_POST['filter']) && $_POST['filter'] != "All") { // Do a query with a WHERE clause to handle the filter } else { // Do a query t...
- Tue Jan 15, 2013 7:03 pm
- Forum: PHP
- Topic: is my query correct?
- Replies: 5
- Views: 899
Re: is my query correct?
Well. For starters you have unsecure variables, which will allow sql injection. Second, use [syntax=php]echo mysql_error();[/syntax] to find the error with your query.
- Sun Jan 13, 2013 8:26 pm
- Forum: Tutorials
- Topic: Blog (including commenting) part 04
- Replies: 5
- Views: 1391
Re: Blog (including commenting) part 04
@Cozak, you're missing a comma here. There needs to be 2 parameters.
[syntax=sql]
DATE_FORMAT(`comments`.`last_comment` '%d/%m/%Y %H:%i:%s') AS `last_comment`
[/syntax]
@Kevin check the thread you started.
[syntax=sql]
DATE_FORMAT(`comments`.`last_comment` '%d/%m/%Y %H:%i:%s') AS `last_comment`
[/syntax]
@Kevin check the thread you started.
- Sun Jan 13, 2013 8:21 pm
- Forum: Tutorials
- Topic: Blog(including commenting)
- Replies: 3
- Views: 900
Re: Blog(including commenting)
All I told you to do was add an s on to $comment or it is undefined. All your sql errors will stop once you revert it back to the way you had it and add the s
- Sun Jan 13, 2013 2:34 pm
- Forum: Tutorials
- Topic: Blog(including commenting)
- Replies: 3
- Views: 900
Re: Blog(including commenting)
Your sql errors are because you have an extra comma in your get_post() function which makes sql think you want to select another row from the table. [syntax=php] function get_post($pid){ $pid = (int)$pid; $sql = "SELECT `post_title` AS `title`, `post_body` AS `body`, `post_user` AS `user`, `pos...
- Sun Jan 13, 2013 2:30 pm
- Forum: PHP
- Topic: cannot edit profile
- Replies: 89
- Views: 10956
Re: cannot edit profile
Well, then change your query to match your table
[syntax=sql]WHERE `username` = 'something' AND `password` = 'something'[/syntax]
[syntax=sql]WHERE `username` = 'something' AND `password` = 'something'[/syntax]