Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
Parse error: parse error, unexpected T_STRING in
Jessica replied to griemar's topic in PHP Coding Help
You start your code while still in the comment, so it sees it starting at VALUES [code] // now we insert it into the database $insert = "INSERT INTO users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."')"; $add_member = mysql_query($insert); [/code] -
This is an HTML question, not PHP [code] <td><a href="URLHERE"><img src="<?php echo $image; ?>" alt="Generating image"></a></td> [/code]
-
PHP/HTML methods in Basic mode user authentication
Jessica replied to Richard Bowser's topic in PHP Coding Help
I'm not a moderator, but I know it's easy to change/fake/mask an IPA. People can have dynamic IPAs, and share IPAs, and even if you have a static, it just takes a phone call to change it and a proxy to mask it. -
Ah, because it's an image, you can't just check Submit, you have to check the Submit_x and y. Try that. Ken, jinx :-P You might want to check the other value, instead of submit, or set another hidden or something, because of the image problem.
-
pouncer, Submit is empty, it has no value. Perhaps add [code]<input name='Submit' type=\"image\" src=\"../index_images/delete.ico\" value="Submit">[/code]
-
You want pagination on your content. You'll need to have some sort of CMS to let you add new 'entries' and store them either in a DB or file. then use pagination to show however many on a page.
-
I would store the time they last viewed a page. On every page, update the field to the current time. Then calculate who's been on a page in the past X minutes. Even if they just close the page, it will stay more accurate.
-
You'd need a zip code database, and then some functions to calculate the distance. Here is the database I use: http://www.micahcarrick.com/v2/content/view/4/22/ It looks like they have added a class for working with the distances too, so that should help.
-
deltran, I think it will always be id, so no need to go through the array. [code] $id = $_GET['id']; $spot = strrpos($id, '-'); //use strrpos, not strpos $num = intval(substr($id, $spot, strlen($id)));[/code] Note: I didn't test this, but I think it will work.
-
I did a small chat using PHP and Ajax from script.aculo.us
-
I recently redid an old friend's site, he liked the design, just wanted to see what some other people thought. Design is not my area, so please let me know your thoughts. Harris Brake Retreats: http://harrisbrakeretreats.com/
-
I think you're looking for pagination. There are a few tutorials here on it.
-
I've never seen that on functions. I know you can pass a variable by reference. Normally variables are passed by value, meaning a copy is made, whereas reference points to the actual variable. Edit: http://www.php.net/manual/en/language.references.return.php "Returning by-reference is useful when you want to use a function to find which variable a reference should be bound to."
-
You should read the topic on header errors. You can't output before setting the header.
-
You should read the article linked to in my signature, your post is very demanding and you're not going to get much help. It is possible with Paypal.
-
It depends on what you're doing. For a hit counter, text is fine.
-
No. You might want to read some basics tutorials, you can't assign an if statement to a var. (AFAIK!) [code] if(!isset($_SERVER["HTTP_X_FORWARDED_FOR"])){ $ip=$_SERVER["REMOTE_ADDR"]; }else{ $ip=$_SERVER["HTTP_X_FORWARDED_FOR"]; } // Log visit; $fp = fopen($counter, "a"); $line = $ip . '|' . $mday . $month . $year . "\n"; $size = strlen($line); fputs($fp, $line, $size); fclose($fp); [/code]
-
[quote author=Nelak link=topic=123465.msg510407#msg510407 date=1169466093] while were on the subject is it possible to query 3 tables using like for a search? [/quote] Yep, you just keep adding to it. Here's a simplified example, you'd change it for yours. SELECT * FROM one, two, three, four, five WHERE one.id = two.id AND two.id = three.id AND three.id = four.id AND four.id = five.id
-
No, I'm not going to download it and put it on my machine. Try what I posted and change $REMOTE_ADDR to $ip.
-
[quote author=yogibear link=topic=123684.msg511611#msg511611 date=1169579981] [quote author=jesirose link=topic=123684.msg511609#msg511609 date=1169579762] if ($num_rows => 0) { => is syntax for assigning array values. You want >= [/quote] I'm still getting the same error thanks yogi [/quote] Actually, I think you'd just want > - you don't want it to go if it's 0, just if it's > 0
-
if ($num_rows => 0) { => is syntax for assigning array values. You want >=
-
I believe you can use <input type="image" name="submit"> and then do the src of your image. I think it has to be an image, not an ico.
-
It's not storing any hosts, or there would be something before the | <- Pipe. Here is the code I am talking about [code] $total_hosts = array(); for ($i=0;$i<sizeof($contents);$i++) { $entry = explode("|", $contents[$i]); array_push($total_hosts, $entry[0]); } $total_hosts_size = sizeof(array_unique($total_hosts)); [/code] This explodes the info based on the | - whatever is before the | is the host. None of yours have anything before the | so it is all the same (or none?) host. $REMOTE_ADDR is not working. Where does that var come from? Here is the script I use to get an IP address: [code]if(!isset($_SERVER["HTTP_X_FORWARDED_FOR"])){ $ip=$_SERVER["REMOTE_ADDR"]; }else{ $ip=$_SERVER["HTTP_X_FORWARDED_FOR"]; }[/code]
-
Indeed, you need to select a db - do $result = mysql_query($query) OR die(mysql_error()); This will show you when you have an SQL error. It would tell you something about no database.