Jump to content

jeremyphphaven

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by jeremyphphaven

  1. sql below to do both delete from table_name alter table table_name auto_increment=1
  2. so dood, peep this. VERY FIRST THING to put into your serving php file... <?php set_magic_quotes_runtime(0); Line 1 and line 2... do this in all your php files on YOUR server... it turns off the server auto-adding the slashes upon http posting. Then you won't have to worry about using stripslashes(). addslashes() are necessary before storing into a database... that's the only time I've ever used it.
  3. may I ask why you're buffering the output? I didn't really dive into it that much after noticing you're buffering the output. If not used correctly, that will cause a shiz load of probs. This is how I suggest your re-do your inline PHP if removing the output buffering doesn't work or is not the problem. <?php // SESSION LOGIC // INCLUDE / STARTUP LOGIC // CODE/MYSQL LOGIC, CODE STORED IN OUTPUT VARIABLE(S) ?> <!-- HTML CODE START --> OUTPUT PHP VARIABLE(S) <!-- HTML CODE END --> <?PHP // FUNCTIONS USED IN CODE LOGIC ?>
  4. using the wrong MYSQL function. Use date_add or date_sub and you can specify how you get it returned to you... See specifics here - http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_datediff
  5. read the whole directory into an session array once (check for it to make sure you don't keep doing it). Then create a page variable that gets sent based on where you are Then pick up the page variable and depending on where what page you are on, you'll get served up the correct files. let me know if you need a quick example... hoping that just suggesting to you to put the thing in an array and use a page number system will suffice.
  6. require(); lol, just kidding. Seriously though, I think the question is, how do you tell when you'll be using PHP or not? If that's possible you can use javascript / ajax to complete, but I may not be understanding the problem.
  7. put your code so we can see what you have... need to see if this is in code, or sql statement, where is the prob bob? =O)
  8. You should just look for if(isset($_REQUEST['submit']))
  9. I've never used either editor, but try taking out the first echo... the second one, should have javascript create the textarea for you? // echo "</td><td><textarea name='NewDescription' id='NewDescription' cols='40' rows='15' style='width:100%; height:50px'></textarea>\n"; echo "</td><td><script language='JavaScript' type='text/javascript'>generate_wysiwyg('NewDescription');</script></td></tr>\n";
  10. IMO it's a matter of preference. I code as your buddy referenced, but like you said, your code works just as well. Having said that, there are certain coding standards overall that you may want to research for PHP
  11. sorry, crossed languages... use escape() in the javascript, not urlencode() echo "<script type='text/javascript'> function popupChat(nick) { win=window.open('chat/chat2.php?nick='+escape(nick), 'WebChat', 'height=420,width=660'); }</script>";
  12. Yo dood, you need a book or tutorial or something bro... =O) My bible (I still buy new versions as they come out to learn new tricks and it's fast and easy for beginners) is this book: GOOD STUFF
  13. Are we sure this will work with the version of you are using? I'm have mad problems with regex on older PHP versions. There is a great changelog for the functionality on the PHP.net site, but it's hard to find, and I didn't bookmark it. So search around on the php.net site for the changelog if that regex code doesn't work on your version of php, they usually have suggestions
  14. totally confused. didn't you just build the array? lol <?php $array = array(); // MYSQL DATABASE LOOP FUNCTIONALITY (assuming you're using MYSQL) while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { array_push($array,$row['id'] => array([item] => $row['item'], [result] => $row['result'])); } ?> Just to note, I didn't test this and just wrote it out here, so may need tweaking but should work just fine.
  15. I don't want to go scuffling through your code without some sort of problem definition. So what's the problem?
  16. You're not sending the chat anything it can use, the way you're calling the popup, the page cannot pick up posted values. You may want to consider appending the nick to the popup... So your code would change to this: echo "<form name='login' method='get' onSubmit='return popupChat(document.login.nick.value);'> and also this: echo "<script type='text/javascript'> function popupChat(nick) { win=window.open('chat/chat2.php?nick='+urlencode(nick), 'WebChat', 'height=420,width=660'); }</script>"; then I just noticed you'll have to urldecode the php in the applet <param name="nick" value="<?php echo urldecode($_POST['nick']); ?>">
  17. Your code is all over the place... here, I figured re-writing it for you is better aid than anything really. <?php $mWinner[1] = $_POST['Matchup_01_Winner']; // returns Team1 or Team2 $mWinner[2] = $_POST['Matchup_02_Winner']; // returns Team3 or Team4 // etc. for ($i=1; $i <= 16; $i++) // loop thru all 16 matchups { // check to see which matchups winners the Admin wants to update if(!empty($mWinner[$i])) { echo '<br>matchup ' .$i. ' Winner = '.$mWinner[$i]; //Insert matchup winner into the database table before moving to next matchup mysql_query("UPDATE `Teams` SET `Matchup_".$i."_Winner` = '" .$mWinner[$i]. "' Where `NFL` = 'Matchup_Winners'") or die(mysql_error()); } } // end of for loop, all 16 matchups ?>
  18. Yah man, this can be a number of things. Your domain may be blacklisted, your bulk settings are picking up that it's PHP sending it and spam marking it, etc. Try changing the header line to this. $headers = 'From: XXX'."\r\n"; This MAY work if yahoo is bulding it because PHP is the identified X-mailer.
  19. Yes, let me interject here as well. A constant is something you want to define that WILL NEVER CHANGE through your entire script/app A good example might be: Take FORUMS for instance... in your preferences you set Date and Time. In the code, a constant... define("USERTIME", "-8"); // GMT-8 for Pacific time ... may be defined for use later. This will never change in your script once defined and the use of constants is definitely a methodical thing.
×
×
  • 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.