Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. Table looks like this: Code looks like this: $query = "select * from table where id = 7000"; $result = mysql_query($query); while ($list = mysql_fetch_assoc($result)) { foreach ($list as $key => $val) { echo "$key : $val <br />"; } // end foreach echo "<br />"; } // end while Output looks like this:
  2. did you do a lookup on the ip address? Belong to anybody/thing familiar?
  3. right. something to that effect.
  4. I don't really see why those two loops can't be combined... <?php dbConnect('thethrgu_moto'); $query = "SELECT * FROM Racers"; $result = mysql_query($query) or die(mysql_error()); ?> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <select name="choices[]"> <option value="null">---</option> <?php while($row = mysql_fetch_array($result)){ echo "<option value = '{$row['number']}'>{$row['name']}</option>"; } ?> </select> <!-- </form>
  5. well if that's the only code you have for that whole file, then it IS deleting the first time around, but since you have no code to query/display the updated table, it's not showing an updated version until reload. I'm going to assume you have some other file you're running to query/display. It's not going to magically change before your eyes. That's not how php works.
  6. Just add a condition for the part of the content you only wish logged in people to see. If they are logged in, show it, if not, don't. It's the same exact principle/code as the whole login/out thing in general, only you're localizing it to a specific thing. If you managed to do a login system in general, then you should be able to do this no problem.
  7. you should go to your cpanel/siteadmin/whatever your host provides for you and block it from there instead of in your script.
  8. What do you mean by "I tried blocking the ip" what did you do to block it?
  9. ah, do they have books like that now? they didn't have squat when I first learned
  10. 5) Use code tags 6) don't make ambiguous titles like "PLEASEEEE HELP"
  11. umm, well, php is a scripting language. html is a markup "language." PHP is pretty easy to learn if you're already familiar with other languages, especially c++ but you can't really compare html to a language... html is basically throwing some tags around stuff to make it look pretty. It doesn't really have anything to do with logic. Well, computer logic, anyways. What "logically" looks pretty or aesthetic is not really the same thing. I mean, comparing php to html is like comparing a car mechanic to one of those people that clean out your car and make it fresh and new-car smelling... The good news is that I would actually recommend php as a good language to start with, for someone entirely new to programming. The bad news is that it's pretty hard to find php tutorials that assume you have no programming experience whatsoever.
  12. although... something you might want to possibly consider is to just do an insert of "http://www.dailyddl.com/?p=" in your guid column and leave it out altogether, and in your script that actually needs the number added on, simply select id and guid and concat them ex: $link = $guid . $id; only reason I suggest this is it like, makes your db/script more open ended/versatile for changes... even better would be to not have a guid column at all, seeing as how it'd just be repeating the same thing over and over (taking up more space, process time, etc..) and have that address stored as a constant somewhere in your script to be called upon. That way if you need to change it, you just change that one single line.
  13. well I'm sure there's probably a better way, but I think this is what you're going for... $conn = mysql_connect('localhostorhostnamehere','dbusernamehere','dbpasswordhere') or die(mysql_error()); $db = mysql_select_db('dbnamehere') or die(mysql_error()); $query = "select id from wp_posts"; $result = mysql_query($query, $conn) or die(mysql_error()); while($id = mysql_fetch_array($result)) { $query = "update wp_posts set guid = 'http://www.dailyddl.com/?p={$id['id']}' where id = '{$id['id']}'"; $update = mysql_query($query, $conn) or die(mysql_error()); }
  14. The way you worded your OP it seems to me that what you're really saying is "I don't really know anything about php but I wanna do this cool thing for my site or whatever...so I went looking for some prefab script, but I can't seem to find one I can live with/want." If that's not what you are implying, then my apologies, but if that is what you're saying, then I hate to tell you but you're putting the cart before the horse. You need to either put your project on hold and start with the basics or hire someone to do it for you or learn to live with a prefab one not being exactly the way you want it. You're asking for a pretty tall order there. Registration script. Login script. Membership system. All the things that go with those things to make it run smoothly and securely. Then you want to have the whole make dynamic images thing thrown on top of that. None of these things are too terribly hard to do but they aren't 5 liners, either. I think that the example links you provided are very good pointers in the right direction, as far as what you're wanting to do, content-wise. But again, it seems to me that you're kind of putting the cart before the horse. I think the first thing you need to do is focus on is the whole register/login thing. Or if you don't know the proverbial "hello world" basics, then start there.
  15. I didn't know there even was a ff3 I click the update thing everytime it pops up so mine should be the latest..is that a beta? edit: yes, ff3 is not the latest "official" release it's beta.
  16. that's because inside your foreach statement you're reassigning something to $output (that's not an array) this works fine: <?php $file = "sentences.txt"; $fp = fopen($file, "r"); $data = fread($fp, filesize($file)); fclose($fp); $output = explode("\n", $data); sort($output); foreach($output as $var) { if($var == "") { echo "<br>"; } else { echo "INSERT INTO survey SET question='$var';<br>"; } } echo "Done!"; ?> it outputs: INSERT INTO survey SET question='What was the last 11.. just inserting a number here as an example?'; INSERT INTO survey SET question='What was the last book you read?'; INSERT INTO survey SET question='What was the last drink you had?'; INSERT INTO survey SET question='What was the last movie you watched?'; Done!
  17. Oops. I set it up originally to just make a comma separated list. You need to change this: while ($row = mysql_fetch_array($qr)) { // this one make one long string of your emails, separated by commas $tolist .= $row['Test_Info'] . ", "; } to this: while ($row = mysql_fetch_array($qr)) { // this one makes an array of your emails $tolist[] = $row['Test_Info']; // this }
  18. mine looks the same I'm on xp Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 [attachment deleted by admin]
  19. That's because they are integrated. You register here, and the same info works for the main site.
  20. if (mail($currentemail, $subject, $body, $headers)) {
  21. I got a better one for you: why is it legal to do this kind of thing to the "little guys," but all those big companies like walmart.com etc.. got to just take their domain names from the people who held them, without having to pay?
  22. 1) please use a more descriptive topic than "A Few Problems" 2) please do not ask multiple questions at a time like that, as it just adds to the confusion and also makes it look suspiciously close to wanting us to do your work for you. Thread closed. Please try again. p.s.- I edited your post and took out your db info. That's not something you really want to be posting for the world to see.
  23. also if you're wanting a popup that's a clientside script's department, like javascript.
  24. Actually I did pretty much everything. EVERYTHING. Just kidding. I just mostly laughed and bitched and did a little beta testing.
  25. right...as mentioned, if you want to break it down, put it inside a loop. There are many ways to do this, with different things to consider (lookup php bulk emailing), but one example: <?php mysql_connect("localhost","sa","pass"); mysql_select_db("DB"); $qr = mysql_query("select mail_addr FROM Memb_Info"); while ($row = mysql_fetch_array($qr) ) { for ($row['mail_addr'] = 1 + mail_addr) $tolist .= $row['mail_addr'] . ", "; } //Sending email $subject = "hi"; $body = "message"; $headers = "From: [email protected]\r\n" . "X-Mailer: php"; foreach ($tolist as $currentemail) { // loop to cycle through email addresses one at a time if ($currentemail, $subject, $body, $headers)) { echo("<p>Message sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } } // end foreach ?>
×
×
  • 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.