Jump to content

merylvingien

Members
  • Posts

    267
  • Joined

  • Last visited

Posts posted by merylvingien

  1. With the announcment from google that they will be introducing a ranking score with regards to page speed.

    Has anyone actually bothered to do anything about the speed of thier sites, i.e implement Gzip compression, cache control, image optimisation etc?

     

    I have done what i can (what i know how to) so far to optimise the speed of my site, using the page speed tool combined with firebug and have got my site 95% faster than most sites (according to the tool)

     

    But being on a shared server i have no control over cache control (expires header) etc, in fact i wouldnt even know where to begin, very little instruction on the net about this subject that i have been able to find.

     

    As google have stated that this WILL come into play soon, maybe now is a good time for discussion!

  2. You need to add:

     

    set_time_limit(600);
    ignore_user_abort(1);

     

    set_time_limit(seconds) sets how long the script is allowed to run for without stopping.

    ignore_user_abort(1) sets that the script should not stop parsing if the user closes their browser window.

     

     

    That done the trick  ;D

  3. Hi fellas, i am trying to build a page so that i can email all the users of my site. Sort of a mass mail page.

    Trouble is when i test this on my local machine, the code works ok, and starts trying to send the emails (although i havent setup a mailer on my localhost)

     

    But for some reason it stops and gives me this:

     

    Fatal error: Maximum execution time of 60 seconds exceeded

     

    I am only trying to send 70 or so emails.

     

    Ive actually used some code that i foud on here and just changed it a bit:

     

    $con = mysql_connect("localhost", "root", "");
    if (!$con)
      {
      die('error');
      }
    $db_selected = mysql_select_db("table",$con);
    
    $message= $_POST['message'];
    $from = "example@example.com";
    
    $sql = mysql_query("SELECT email FROM table");
    while($line = mysql_fetch_assoc($sql)){
    
       $email[]  = $line;
    
    }
    
    
    foreach($email as $e){
    
    //Remove whitespace in case there is some.
    $e['email'] = trim($e['email']);
    
    
    mail($e['email'],"Wasp Control UK",$message,"From: $from");
    
    echo "Message sent to {$e['email']}";
    usleep(500000);
    }

     

    Anyone know why this would time out?

  4. You could store the link in one table say A  ( http://www.yoursite.com )

    Put the link text in another table, say B  ( some text for the link )

     

    then in your page populate the links from your database.

     

    $sql = "SELECT * FROM database";
          mysql_query($sql)
          $result = mysql_query($sql);
    $row = mysql_fetch_assoc($result);
    
    echo "<a href='{$row['A']}'>{$row['B']}</a>";

     

    I havent tested this, but that should give you a link that reads  some text for the link and links to www.yoursite.com

  5. Well google has just run through and indexed probably half of my site, you never can tell until about month later, but the spider has been busy.

     

    So if those pages are already indexed, if i remove them, then google gets all annoyed, i dont want manually remove 3000 urls from google. So its a 301 redirect, no?

  6. Blimey i dont know where to begin LOL

     

    Is there a max size limit for the .htaccess file?

     

    I have just started google off crawling my site, and then changed my mind about a folder, i want to rename it, so this would mean near on 3000 (301 redirects)

     

    Thats way to big for .htaccess isnt it?

     

     

  7. Well there is no error, the page just outputs nothing and wont update the database.

     

    What i am trying to achieve, is if someone enters less than 200 characters in their text, then in the control panel, it will flag up saying that their text is too short and is weak. they should consider updating it.

     

    Same sort of thing if the text is between 200 & 400 but its not so bad.

    if the text is between 400 & 600 then its quite good.

    if its above 600 then its exellent.

  8. Well without that piece of code in there the page works fine, if i add that code then the page outputs nothing, not even an error.

     

    if (strlen($adverttext) < 100) {echo 'error'; include("foot.html"); exit;}
     else
     if (strlen($adverttext) > 1000){echo 'error'; include("foot.html"); exit;}
     else
     if (strlen($phone) <  {echo 'error'; include("foot.html"); exit;}
     else
     if (strlen($phone) > 16) {echo 'error'; include("foot.html"); exit;}
     else
     if (strlen($mobile) > 16) {echo 'error'; include("foot.html"); exit;}
     else
     if ($email == $row['email'] && md5($password) == $row['password']){ continue

    that works

     

    if (strlen($adverttext) < 100) {echo 'error'; include("foot.html"); exit;}
     else
     if (strlen($adverttext) > 1000){echo 'error'; include("foot.html"); exit;}
     else
        if (strlen($adverttext) < 200) {$advertstrength = "4";}
     else
     if((strlen($adverttext) >= 200) && (strlen($adverttext) < 400)) {$advertstrength = "3";} 
     else
     if ((strlen($adverttext) >= 400) && (strlen($adverttext) < 600)) {$advertstrength = "2";}
     else
     if (strlen($adverttext) >= 600) {$advertstrength = "1";}
     else
     if (strlen($phone) <  {echo 'error'; include("foot.html"); exit;}
     else
     if (strlen($phone) > 16) {echo 'error'; include("foot.html"); exit;}
     else
     if (strlen($mobile) > 16) {echo 'error'; include("foot.html"); exit;}
     else
     if ($email == $row['email'] && md5($password) == $row['password']){ continue

    that doesnt work!

  9. I know, i am boring you all now  :(

     

    I have tried searching for this answer but i cant find the solution.

     

    There is something wrong with this code and i cant figure it out!

     

    if (strlen($adverttext) < 200) {$advertstrength = "4";}
     else
     if((strlen($adverttext) >= 200) && (strlen($adverttext) < 400)) {$advertstrength = "3";} 
     else
     if ((strlen($adverttext) >= 400) && (strlen($adverttext) < 600)) {$advertstrength = "2";}
     else
     if (strlen($adverttext) >= 600) {$advertstrength = "1";}
     else

  10. else
      {
    
    
             $sql=("SELECT email, ipaddress FROM table");
    	$result = mysql_query($sql);
    $row = mysql_fetch_array($result);
    
    if($row['email'] == $email) {echo 'error message'; include("foot.html"); exit;}
    if($row['ipaddress'] == $ipAddress) {echo 'error meassage'; include("foot.html"); exit;}
    }

     

    For some reason this code is being bypassed and even if the email address and ipaddress is already in the database it still goes forth and registers a user for a second time. Am i missing something?

×
×
  • 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.