Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. 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]
  2. This is an HTML question, not PHP [code] <td><a href="URLHERE"><img src="<?php echo $image; ?>" alt="Generating image"></a></td> [/code]
  3. 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.
  4. 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.
  5. pouncer, Submit is empty, it has no value. Perhaps add [code]<input name='Submit' type=\"image\" src=\"../index_images/delete.ico\" value="Submit">[/code]
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. I did a small chat using PHP and Ajax from script.aculo.us
  11. 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/
  12. I think you're looking for pagination. There are a few tutorials here on it.
  13. 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."
  14. You should read the topic on header errors. You can't output before setting the header.
  15. 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.
  16. It depends on what you're doing. For a hit counter, text is fine.
  17. 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]
  18. [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
  19. No, I'm not going to download it and put it on my machine. Try what I posted and change $REMOTE_ADDR to $ip.
  20. [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
  21. if ($num_rows => 0) { => is syntax for assigning array values. You want >=
  22. 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.
  23. 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]
  24. 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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.