Jump to content

teynon

Members
  • Posts

    898
  • Joined

  • Last visited

  • Days Won

    1

teynon last won the day on March 3 2013

teynon had the most liked content!

Contact Methods

  • Website URL
    http://www.thomaseynon.com
  • Yahoo
    teynon1

Profile Information

  • Gender
    Male

teynon's Achievements

Member

Member (2/5)

12

Reputation

  1. Using mjdamato's function will work. But you are using the variables before the function is being called. You get an "undefined index" because you have uninitialized array indexes. An example of this would be: $b = 1; $c = $a + $b; What would the result be? We don't know what $a is right? So the compiler throws a warning and initializes it to zero. That may not be correct, which is why you get an warning. The easiest way to get rid of these errors is to initialize it. mjdamato's function initializes it to either blank or the posted value. But you would have to do it in this manner: $v['uri'] = $this->getVar('uri'); // This is the initialization. $html .= ($v['uri']) ? urldecode($_GET[$v['uri']]) : NULL; [code] You should always initialize your variables. Initializing can also help PHP (or at the very least help you) determine what type of variable it is. For example: $b = 0; // Initializes to int. $b = false; // Initializes to bool $b = ""; // Initializes to string
  2. Thats because in HTML if your write \n it is two characters. PHP converts the string \n to an "invisible character" that is that of a new line. Do a test.php with the code I sent, bet it will work. Your other problem is that your str_replace code is using single quotes around the characters... I bet you if you change that to double quotes it will do the conversion. str_replace("\r", "\n", $textareadescription);
  3. I don't see where you doing any conversion with \n... This works fine for me: <?php echo "<textarea>test\ntest</textarea>"; ?>
  4. Try using this: $p = str_replace("\'", "", $player); If not, its fine, just make sure your not confusing yourself somewhere else.
  5. Try something for me: at the very beginning on the code, put this: ob_start(); then at the very end of the code, put this: ob_end_flush();
  6. Did you output the variable? Heh
  7. Quick question, exactly how many files is it doing? The output could be huge? Try just outputting the information and seeing what that does.
  8. If you want a new line in a text area, you need to leave the \n\r there. <br> will only work outside of the textarea.
  9. Yes there's a way.... To bad I can't tell you how without seeing your code... :/
  10. uh oh... connection refused... not a good sign
  11. You can do two things for the header. You can put a buffer on it or just use javascript: <script>document.location.href='newfile.php?page=blah';</script> As for running out of rows: Depending on what your script is doing in MYSQL, you can count how many rows exist: $mysql_rows=mysql_query("SELECT * FROM table"); $totalRows=mysql_num_rows($mysql_rows); if ($start>$totalRows) { // Finished Executing. Dont go to new page. }
  12. You can use variables via the url to keep track of the last page position: for example: file.php?start=0 <?php $start=$_GET['start']; $linesPer=20; $sql="DO SOMETHING LIMIT {$start},{$linesPer}"; $newStart=$start+$linesPer; // When finished: header("Location: file.php?start={$newStart}"); ?>
  13. I had a problem similiar to yours once. My solution was to create an external file with a list of mysql queries that needed to be executed. Then I read that file line by line and as each one was completed, I removed that line and resaved the file. That way, if the script does timeout. The next time it is run, it continues working on the same project without replicating work.
  14. If you're trying to include / execute an uploaded PHP file.... dont. Its a bad idea and you should never do it. Not only that but it wont let you do it unless you mess with a bunch of settings.
  15. // Exactly 30 days in the future: date("Y-m-d", mktime(0,0,0,date("m"), date("d")+30, date("Y"))); // Exactly 1 month in the future: date("Y-m-d", mktime(0,0,0,date("m")+1, date("d"), date("Y"))); // Date in future based on how many days are in the current month: date("Y-m-d", mktime(0,0,0,date("m"), date("d")+cal_days_in_month(CAL_GREGORIAN, date("m"), date("Y")), date("Y")));
×
×
  • 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.