premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
I would say you missed the methodology. You can easily handle that with a function instead of a class, why would a class be needed to verify login information? A user class, to me, would take in a userid or username. From that go into the database and retrieve that information and store it in the class for use later on. So you would have a property of username, fullname, email, preference1, preference2 etc.. Then methods that you can "set" those preferences, if this was for a "control panel page". If the preference's have been set you have a "save" method to update the database with the new values. If you want to make sure the user is authenticated so they can save/write to the database add a method to check if the user is valid from when they logged in with a session variable. But honestly I do not think you need to (or should) put a login check inside a class. Make that a function, or I guess make it a method inside the user class and when they login populate that class with their userdata for use. Hope that helps.
-
If you are using PHP 5, make the function static. Without instantiating the class, however, you will not be able to use the $this conext with that method.
-
Need help with PHP/Mysql script installation
premiso replied to dreglo's topic in Third Party Scripts
http://metrodetroitrestaurantguide.com/counter.php?page=1 It is showing that you do not have the right connections in with your database. And please, do not double post. -
while ( $newfname = false ) { Will always be true. You need to use == for a comparison operator. Alternatively, you can just do a break; when the file_exists and it will exit out of the loop.
-
I am sure "Show" is a reserved word: $query = sprintf("UPDATE sites SET `show` = '%s' WHERE url = '%s' AND ip = '%s'" You need to encase it in backticks (`) for it to work or rename it.
-
100 seconds to Report Post to Moderator
premiso replied to revraz's topic in PHPFreaks.com Website Feedback
I think it is a reasonable amount of time. If you are finding that many issues, maybe you need to think, "Is this really an issue that should and needs to be reported?" That is just me though. -
$sql = "UPDATE table_name SET post1 = '" . $_POST['POST1'] . "', post2 = '" . $_POST['POST2'] . "' WHERE x=x"; However, I doubt your column names are post1 etc. I would name your fields the same as what your mysql columns are, that way you can really automate this process if you wanted to and not have to write out each statement like the above. $allowedCols = array("Col1", "col2", "col3", "col4"); $set = array(); foreach ($_POST as $key => $val) { if (in_array($key, $allowedCols)) { $set[] = " {$key} = '{$val}' "; } } $setClause = implode(",", $set); $sql = "UPDATE tablE_name SET {$setClause} WHERE x=x"; Makes it a bit easier than defining them all out one by one
-
To answer your question, no. Most, and I use that term loosely, programmers tend to understand what can happen by clicking on an advertisement. Whether it be spyware infected etc. Or if an AD popsup saying you have a virus etc, most know not to mess with it. Where as other computer users do not understand this too well. They see something big and flashing they assume something has gone wrong. Such as facebook, they have an ad that says "You have 1 new message, Click here to read it". They assume that is a facebook message so they click there and viola they are now at the advertisers site. As for me, if it is a google AD I may click on it if it interests me. If not I tend to just ignore them. The big flashy ADs I do not see cause I have them blocked with FireFox plugins.
-
Why does it need to be a variable? Why not just make it access the element of the array. It will be much faster and easier, as you do not have to do the extra code to make it a variable. But if you are one of those hardheaded guys look into extract and or PHP Variable's variable with a foreach loop.
-
I am just throwing this out there... Are you sure that the path "php/content/includes/members_home/user_images" is correct. It looks a little odd to me. Can you effectively goto http://www.yoursite.com/php/content/includes/members_home/user_images/animage.jpg and pull up an image? If you cannot then you are not using the correct path. The path needs to be the URL path not the File Directory path. Take a look at that and see if that helps solve this. Sorry, it was already discussed and figured out, missed that post.
-
Is 86 the tablename? If not this is how the query should be formed: $query = "SELECT * FROM table_name WHERE column = 86"; Replace the table_name and the column with their respected values. If it is suppose to be 86 for the table name try using backticks around it: $query = "SELECT * FROM `86`";
-
I think advertising makes "some" money. I mean you might as well put ads on your site if you do not care right? Any little bit helps. Where a lot of the money, such as myspace, comes into play is they sell advertisements spots. Because of how "widely" it is used etc, to buy an advertisement spot on their site costs a lot of money. Same with Facebook etc. To put your ad in one of those sites, you have to pay quite a bit. Because you know your ad will be viewed by tons of (unique) people each day. Where as a site like phpFreaks, no one really "wants" to buy a spot because it is extended only to certain individuals and generally it is a 1 shot deal without returning customers persay. If you make a site that is as desirable as myspace or facebook, yea you can make a ton of money by ads, but not by yahoo or google ads, by selling ad space to individual companies. That is where the money really is.
-
[SOLVED] Time limit in main file, or required files?
premiso replied to opalelement's topic in PHP Coding Help
You would have to set the time_limit at the main script. The others will override it, but not reset the time limit. The main processing script is what matters. -
Well a site that I believe requires the script to be free is www.phpclasses.org As far as other sites: PHP Scripts You should find plenty there.
-
PHP Image Gallery You just have to use the right keywords.
-
You are adding them in there on your own... if ($freq == "daily") { // Make the days pull-down menu: echo '<select name="day">'; foreach ($days as $value) if ($day == $value) { echo "<option value=\"'$day'\" selected>$day</option>"; // note the ' around $day } else { echo "<option value=\"'$value'\">$value</option>\n"; // note the ' around $value } echo '</select>'; } Remove the single quotes around $day and $value and then go through your script and do the same anywhere else it may be. And that should solve your problem.
-
Check out our Simple SQL Search tutorial.
-
You cannot divide by zero. $data['PER_PAGE'] must be empty or contain a zero. Simple as that. Echo it out and figure out why it is not passing a value.
-
is about all I can do for a reply...kid.
-
No, but you would like it to make money. Unfortunately for you we live in a world where people do lie and steal. Even ideas. It would be nice to "trust" your word, but come on. If you had a badass awesome idea and some guy came along and said, "I am bored I need an idea, I do not want to make money off of it, do you have any" would you give him your idea? It is always about money, do not kid yourself. You want to make some extra, and if you get an idea from someone to make that extra money all the better for you. You can debate this all you want and try and say you were innocent, which you may have been, but the end goal. You wanted something unique that you could make money off of. Sorry bud but that is the world we live in. The fact that your are so defensive makes me feel even more that your only goal was to steal someone's idea to help you make money. Anyone else would have been, "yea I understand about the money concern, thanks. I figured it was worth a shot." and went on.
-
Nope and I doubt it ever will be. IE8 is actually a pretty decent browser and is the closest to the standards of all the IE versions. As long as your code works in IE8, yea. But most people still use IE 6 which makes everyone's life a hassle.
-
[SOLVED] get message-id header from sent email through mail()??
premiso replied to schilly's topic in PHP Coding Help
Set up an email account you can imap into, add a bcc to the mail you send and put the email you setup that you can imap into as the bcc. Then use imap to read the mail and grab the email you just sent. Complicated issue, but yea. -
[SOLVED] get message-id header from sent email through mail()??
premiso replied to schilly's topic in PHP Coding Help
You will most likely have to go through the mail server. If your server allows for it, you should be able to use IMAP to retrieve the email and headers etc. -
Am I not correct in that your iframe is calling an .asp page ? http://clients.mindbodyonline.com/ws.asp?rand=689598&studioid=5692&stype=-9&sView=week My point is, the problem lies else where. Your .php is fine for all I know. This issue does not lay within php. You may want to google IE iframe cache prevent or something similar as this seems to either be a script error (ASP page is caching) or a software error (Internet Explorer) which has nothing to do with the server/php code unfortunately.
-
I dunno, it could be that the asp file is having a caching problem. I do not think your issue lies on the PHP. You may look how to set no-cache headers in .asp.