Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. Please do not create new topics for questions already asked. http://www.phpfreaks.com/forums/index.php/topic,256768.0.html
  2. Read this and make sure you are calling your data right. http://informationideas.com/news/2006/06/14/fatal-error-cannot-use-string-offset-as-an-array-in/ Found via google with "Cannot use string offset as an array".
  3. If I had to take a random guess, it would be the Expires line. I would remove that header and see if it makes a difference.
  4. Yes, once the user posts the form and the data gets entered do a header redirect to a "thank you" page. This will clear the post data, so if they push back it will not re-submit the data.
  5. To elaborate. As of PHP6 ereg is depreciated. Also preg tends to be more universal since it users perl regular expressions. I would avoid using ereg due to the fact it is depreciated.
  6. After you connect to a database you need to use mysql_select_db to select the database you want to use. If you do not do that, MySQL does not know which database it needs to pull the results from.
  7. Google does tend to help cause chances are someone has already done what you want: http://www.cstruter.com/replyblog.php?ContentID=41 Check out that for a script that authenticates to .NET Passport.
  8. How are you determining the file the include? If it is from GET/POST you should check that the file_exists before doing any includes. Also if you do not use file_get_contents to fetch data from a URL you should turn off url_fopen (something like that) to prevent someone executing their own code from a url just incase. If you are not planning on doing a "dynamic" include with GET data, you do not need to worry about security as long as you define any variables that you may be using to include the file you should be fine.
  9. file_get_contents or curl Either should work. If you need more help PHP Download Remote Images plugged into google should pull up some scripts.
  10. $file = file('datafile.txt'); $count = count($file); echo "There are {$count} number of lines.";
  11. $file = file('datafile.txt'); $fh = fopen('datafile.txt', "w+"); // truncate file and open for writing foreach ($file as $line) { $inputs = explode($line); $inputs[0]++; // add1 to the first number $inputs[3]++; // add 1 to the last number fwrite($fh, implode(";", $inputs) . "\n"); // write back to file on a new line } fclose($fh);
  12. Try using the index of the char for those characters. As saving the characters are probably getting saved in your text file as non-smart quotes. Which is causing the issue.
  13. $sql = "SELECT player_id, player_number, forename, surname, games_played, goals, assists, SUM(goals + assists) as points FROM ww_players ORDER BY points DESC LIMIT 0,9"; If the order by does not work, try this: ORDER BY SUM(goals + assists) DESC If it requires a GROUP BY, try this for that: GROUP BY player_id, player_number, forename, surname, games_played Sorry my SQL is shabby. Moving the the MySQL forum.
  14. If you have that many users why not look into a Java/IRC Chat application ? That will be low bandwidth and probably be more responsive than an online php script.
  15. I have never seen an update statement work like that. I am not saying that it cannot or does not. But here are some spots you might want to read over and reform your query: http://dev.mysql.com/doc/refman/5.0/en/update.html and or http://dev.mysql.com/doc/refman/5.1/en/replace.html Not sure if replace is right for you, but it maybe.
  16. Very curious how you are doing this... for ($i=1; $i<=20; $i++){ $varname = "p{$i}"; $defaults[$varname] = ""; } Or even: for ($i=1; $i<=20; $i++){ $defaults["p{$i}"] = ""; } Will do what you are after. You are making it harder then it is. All variables variable does is assign $p1 to equal whatever you put it to: $var = "p1"; $$var = "testing"; echo $p1; Hope that helps you out.
  17. $cmd = isset($_GET['cmd'])?$_GET['cmd']:''; Will fix the undefined index. It was not all "working fine" you just did not have errors reporting out. As far as why it took effect with IE 8, no clue. Could have been a buffering issue with IE 7 or 6 that IE 8 fixed.
  18. Post the entire code please. As it is obvious we need more information. As for the "not getting any errors" do you have the following after the first <?php in your script to make sure errors are turned on? error_reporting(E_ALL); ini_set("display_errors", "on");
  19. if (mysql_num_rows($mainmenuresult) > 0) { while($mainmenurow = mysql_fetch_array($mainmenuresult, MYSQL_ASSOC)) { //print $mainmenurow['bodytext']; $introtext = str_replace('”','_',$mainmenurow['bodytext']); $introtext = str_replace('“','_',$introtext); //$introtext = str_replace('test','_',$introtext); // This is to test that this is working or not. print ' <br> '; print $introtext; print '<hr>'; } }else { print 'The database did not return any rows'; } See if that displays the "The database did not return any rows". And please, if it does not define how it is "not working" Is it returning data and just not replacing the data? Or is it not returning data at all?
  20. I know it works in FF and IE6. Those are about the only ones I tested it on. I do not think it works on Chrome or Opera, unsure about Safari and IE > 6.
  21. set_time_limit to prevent php from timing out the script. To send one character to the screen: $i=0; while (condition is true) { if (($i % 300) == 0) { echo "<>"; flush(); ob_flush(); } $i++; } That will only work in certain browsers, however. flush; ob_flush;
  22. $parent_row = oci_fetch_array($s, OCI_NUM+OCI_RETURN_NULLS); That is why you are coming up a row short. You call it outside the loop so it iterates one before it ever hits the loop.
  23. Learn to ignore him then. You do not have to reply to his threads. I am sure he would be grateful for you to ignore his posts as well. It is a win-win situation. If you cannot say anything nice, then do not say anything at all. Simple.
  24. Stop being a jerk if you want to help. If he bothers you, stop replying to his posts. Simple as that. Thanks.
  25. If oci has a row count feature, similar to mysql_num_rows you can just that and a for loop instead. See if that fixes the issue.
×
×
  • 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.