Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. the same way you insert single values, except you add more values, separating them by commas.
  2. Okay maybe I'm reading that wrong, but are you saying that if random JoeUser clicks on some "most recent posts" button, and it shows the 10 most recent posts, but if all 10 of them were from say JaneDoe you only want to show 3 of them, skipping the other 7, and displaying the next 7 after that?
  3. are you seriously asking me to go find some 3rd party's documentation for you? You would think after 5600 posts you would have learned how things go around here.
  4. Well I'd suggest you use php for that, seeing as how you want it in a php array.
  5. I think you should probably be looking at msn messenger's documentation....
  6. 1: everything is a potential security hazard 2: same way you would make multiple vars anywhere else. declare/assign them individually or as an array, if it suits you. Cant have that as I am echoing info inside the function, so it will return everything I don't see how that matters...my script declares it inside your function just like you asked. It's declared as a global variable so you can access it outside the function just like you asked. What does it matter what you do inside your function? Do whatever you want to do. Return whatever you want to return. Notice inside my script you aren't returning anything, and yet you can still echo $somevar outside the function.
  7. <?php function blah() { global $somevar; $somevar = "sometext"; } blah(); echo $somevar; ?>
  8. If you want to hire someone to help you, make a post in the freelance forum. Or maybe contact the guy who made your script. If you want to fiddle with it yourself, and you're having trouble figuring something out, make a new thread asking about what specifically you are having issues with, providing relevant info/code. Please do not post the entire contents of your script expecting someone to go through it all; see first suggestion for that. Thread Closed.
  9. how is your form setup? Are there just 24 pairs of name/email fields? It would be easier if you made their names an array to be posted, that way you can loop through them echo "<form action = 'somewhere.php' method = 'post'>"; for ($x = 0;$x <24; $x++) { echo "Name $x <input = 'text' name = 'name[]'> <br />"; echo "Email $x <input = 'text' name = 'email[]'> <br />"; echo "<br />"; } // end for $x echo "<input = 'submit' value = 'submit'>"; echo "</form>"; somewhere.php $name = $_POST['name']; $email = $_POST['email']; $x = 0; while ($name[$x]) { $insertSQL = "INSERT INTO players(name, email, date) VALUES ('{$name[$x]}', '{$email[$x]}', NOW())"; $rs = mysql_query($insertSQL,$conn); $x++; } You should of course sanitize your variables before inserting them into your db. Also, this script assumes that all of your fields will be completely filled out, so you'll probably want to add some conditions to check and do something about that if they aren't.
  10. haha for real, at least an xbox360
  11. I think if I were in your shoes I'd be looking on paypal's FAQ or talking to their CS rather than asking on some random coding board...maybe that's just me. Maybe there's some sort of secret wisdom involved in asking here instead of there that my tiny little mind just can't grasp.
  12. is that the entirety of file2?
  13. $info is an array. You could do it individually by doing $info[0] = ltrim($info[0],'id_'); $info[1] = ltrim($info[1],'id_'); or you can loop through the array positions using a variable.
  14. ha. not that brilliant, but it works.
  15. so..is it working?
  16. okay, this sure as hell isn't the most elegant solution, but here goes: <?php // dummy var to hold the info because I'm not entering it from a form.. $blah=<<<F <tr> <td><input name="id_1523023" type="checkbox" /><a href="index.php?view=1523023"> <span id="label[1523023]"><img src="graphic/dots/blue.png" title="" alt="" /> <span id="labelText[1523023]">test1</span>[/url] <td><input name="id_1522728" type="checkbox" /><a href="index.php?view=1522728"> <span id="label[1522728]"><img src="graphic/dots/blue.png" title="" alt="" /> <span id="labelText[1522728]">test2</span>[/url] F; // regex to grab id_xxxxxxx ... can't figure out how to regex it without the id_, so... preg_match_all("/id_[1-9]?\d+/",$blah,$info); // reverse the array $info = array_reverse($info[0]); // so... trim the id_ off $x = 0; while ($info[$x]) { $info[$x] = ltrim($info[$x],'id_'); $x++; } // example to display it foreach($info as $i) { echo $i . "<br />"; }
  17. did you change your $row['...'] 's to your actual column names? * is inefficient because you are quering for more information than you need. It selects every piece of data from every row and column of your table. That takes more processing time and memory use. It's a waste. It's potentially dangerous because if someone manages to hack your scripts to dump all your variables in memory, well, for instance, your table could have a name and password column and then mr. hacker now has everybody's name and password. Or credit card info, or whatever else your table might contain.
  18. I'm just curious: if you are going to manually cut and paste a big chunk of text...why not just manually cut and paste the numbers instead? Or is that example link just a testing ground for pulling a file from somewhere else? I suck at regex too, otherwise I would have given you an answer by now. I mean, I understand the concept, but there are just like, a ton of things to memorize and I'm lazy. I don't really have nothin' better to do, so I'll try and work out a pattern for you, but hopefully someone will answer before I do.
  19. $result = @mysql_query("select * from test"); but if your column names are "uid" and "first" then $row['table_field1'] and $row['table_field2'] do not exist, because table_field1 and table_field2 are not column names.
  20. haku your script depends on him being in control of that form and then parsing the posted vars. That makes no sense because if he had control over the form, he wouldn't need to be parsing it in the first place. He's probably doing a file_get_contents or fopen or something.
  21. We don't write scripts for people. We help them work out bugs in their scripts. I will point you in the right direction and say that you need to: -Query your db for the info -Make your form tag and your dropdown tag and then right after that, make a loop that echoes your option tags, with the value being the current iteration of your query's result array. Then after the loop, close out your form elements and tags etc.. and you're good to go. Now that you have a plan, get to it. If you have issues with making your code work, post it and ask away.
  22. good old fashioned regex. moving...
  23. pseudo code: // change table, column and variables to yours $rs = mysql_query("select userid from table where userid = '$userid'"); if ($rs) { // update } else { // insert }
  24. How about adding a stat to the main site and/or forum showing how many topics are marked as solved so far? I mean, I know that wouldn't be 100% accurate, because we haven't had the solved feature all that long, and not all solved threads are marked as solved, but still, got to start somewhere...just do a query to find out how many marked right now for starting number, add a little update to a column or file somewhere each time one is marked, and voila! Think it would be kind of cool to see that number climbing Also it would be cool to be able to filter search results to only show topics that are marked as solved, but I doubt that would actually happen. Wishful thinking.
  25. ...are you wanting to know how to linebreak it to the next line at 150px wide? ...are you wanting to only display 150px wide worth, truncating the rest off?
×
×
  • 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.