SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 42
  1. #1
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question "The website declined to show this webpage" error

    Hi,

    I would be really grateful for any help anyone can give me with a error I am getting.

    I have built a fairly simple cms using php, I say this as I am fairly new to php so may be causing an error through the coding of the cms.

    However the site has been functioning fine for several months but the IT company who host the website have recently transferred their servers and since then, when using the cms the site has been throwing up a "The website declined to show this webpage" error.

    This also seems to have the knock on effect of stopping the rest of the website functioning for several minutes, then the rest of the site comes back online.

    I don't know if this is relevant but this error is only caused by loading the php script in the cms on pc it doesn't happen on a mac.

    If anyone has any idea of what could be causing this error i'd be very grateful for any advice?

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Did you ask your host?

  3. #3
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, they've said they're not sure.

    Apparently database, php version and permissions are the same.

    I will double check permissions remain same as this is the only thing I can think would be causing the issue.

    Otherwise I guess it would be something within the code that's causing this?

    Thanks for your response

  4. #4
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Doing a quick search, this thread is the top hit. The next few hits simply say that the extention was missing or wrong. Double check that all files have the correct extension, and where applicable, a DOCTYPE.
    Ryan B | My Blog | Twitter

  5. #5
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as far as I can see - yes

  6. #6
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Check your access and error logs, your answer with be there.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  7. #7
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much for your reply - I am on to the host to give me access to those files.

    Would i be able to post the code of the file that is throwing up this error message here to get an opinon if anything in it may be causing this issue?

  8. #8
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by calicouk View Post
    Would i be able to post the code of the file that is throwing up this error message here to get an opinon if anything in it may be causing this issue?
    Of course
    If you use 'Go advanced' instead of 'Post quick reply', you'll be able to put the correct code tags around your code, which will make it easier to read.

  9. #9
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks - have copied below: i've omitted the header url - the includes are just opening and closing the database connections and are definitely working fine as on all other areas of the site.

    PHP Code:

    <?php // include db connect

    ob_start();
    header("Location:");
    ob_flush();

    ?>

    <?php // include db connect

    include("../includes/config.php"); 

    ?>

    <?php

    // assign news to variables

    $name=$_POST['name'];
    $location=$_POST['location'];
    $property_type=$_POST['property_type'];
    $prices_from=$_POST['prices_from'];
    $prices_to=$_POST['prices_to'];
    $information=$_POST['information'];
    $information_plus=$_POST['information_plus'];
    $information_plus_string str_replace(" ","",$information_plus);
    $info_list=$_POST['info_list'];
    $info_table=$_POST['info_table'];
    $facilities=$_POST['facilities'];
    $display=$_POST['display'];
    $primary_key=$_POST['primary_key'];
    $highlight=$_POST['highlight'];

    $bar=$_POST['bar'];
    $beach=$_POST['beach'];
    $golf=$_POST['golf'];
    $shopping=$_POST['shopping'];
    $restaurant=$_POST['restaurant'];
    $spa=$_POST['spa'];
    $sports=$_POST['sports'];
    $gardens=$_POST['gardens'];
    $watersports=$_POST['watersports'];
    $gym=$_POST['gym'];
    $swimming=$_POST['swimming'];

    $inftab_prop1=$_POST['inftab_prop1'];
    $inftab_prop2=$_POST['inftab_prop2'];
    $inftab_prop3=$_POST['inftab_prop3'];
    $inftab_prop4=$_POST['inftab_prop4'];
    $inftab_prop5=$_POST['inftab_prop5'];
    $inftab_prop6=$_POST['inftab_prop6'];

    $inftab_price1=$_POST['inftab_price1'];
    $inftab_price2=$_POST['inftab_price2'];
    $inftab_price3=$_POST['inftab_price3'];
    $inftab_price4=$_POST['inftab_price4'];
    $inftab_price5=$_POST['inftab_price5'];
    $inftab_price6=$_POST['inftab_price6'];

    // insert news from form

    mysql_query("UPDATE investment_property SET name = '$name'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET location = '$location'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET prices_from = '$prices_from'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET prices_to = '$prices_to'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET information = '$information'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET information_plus = '$information_plus_string'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET info_list = '$info_list'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET info_table = '$info_table'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET facilities = '$facilities'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET display = '$display'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET bar = '$bar'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET beach = '$beach'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET golf = '$golf'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET shopping = '$shopping'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET restaurant = '$restaurant'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET spa = '$spa'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET sports = '$sports'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET gardens = '$gardens'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET watersports = '$watersports'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET gym = '$gym'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET swimming = '$swimming'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET highlight = '$highlight'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property SET property_type = '$property_type'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property 
    SET inftab_prop1 = '
    $inftab_prop1'
    , inftab_prop2 = '
    $inftab_prop2'
    , inftab_prop3 = '
    $inftab_prop3'
    , inftab_prop4 = '
    $inftab_prop4'
    , inftab_prop5 = '
    $inftab_prop5'
    , inftab_prop6 = '
    $inftab_prop6'
    WHERE primary_key = '
    $primary_key'");

    mysql_query("UPDATE investment_property 
    SET inftab_price1 = '
    $inftab_price1
    , inftab_price2 = '
    $inftab_price2'
    , inftab_price3 = '
    $inftab_price3'
    , inftab_price4 = '
    $inftab_price4'
    , inftab_price5 = '
    $inftab_price5'
    , inftab_price6 = '
    $inftab_price6'
    WHERE primary_key = '
    $primary_key'");

    ?>

    <?php // close db connection

    include("close_connect.php"); 

    ?>

  10. #10
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I would suspect the ~25 MySQL queries will have something to do with it.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  11. #11
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply Anthony, I'm sure this code is fairly ineloquent, i'll try and combine these queries and post back - is this the likely cause then do you think?

  12. #12
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It certainly won't be helping.

    For reference, you can update many columns with a single query like so...
    Code:
    UPDATE
      table
    SET
        foo = 1
      , bar = 2
      , anthony = 'tired'
      , coffee = 'empty'
    WHERE
      id = 45
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  13. #13
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for that have revised script below:

    PHP Code:
    <?php // include db connect

    ob_start();
    header("Location: *** ");
    ob_flush();

    ?>

    <?php // include db connect

    include("../includes/config.php"); 

    ?>

    <?php

    // assign news to variables

    $name=$_POST['name'];
    $location=$_POST['location'];
    $property_type=$_POST['property_type'];
    $prices_from=$_POST['prices_from'];
    $prices_to=$_POST['prices_to'];
    $information=$_POST['information'];
    $information_plus=$_POST['information_plus'];
    $information_plus_string str_replace(" ","",$information_plus);
    $info_list=$_POST['info_list'];
    $info_table=$_POST['info_table'];
    $facilities=$_POST['facilities'];
    $display=$_POST['display'];
    $primary_key=$_POST['primary_key'];
    $highlight=$_POST['highlight'];

    $bar=$_POST['bar'];
    $beach=$_POST['beach'];
    $golf=$_POST['golf'];
    $shopping=$_POST['shopping'];
    $restaurant=$_POST['restaurant'];
    $spa=$_POST['spa'];
    $sports=$_POST['sports'];
    $gardens=$_POST['gardens'];
    $watersports=$_POST['watersports'];
    $gym=$_POST['gym'];
    $swimming=$_POST['swimming'];

    $inftab_prop1=$_POST['inftab_prop1'];
    $inftab_prop2=$_POST['inftab_prop2'];
    $inftab_prop3=$_POST['inftab_prop3'];
    $inftab_prop4=$_POST['inftab_prop4'];
    $inftab_prop5=$_POST['inftab_prop5'];
    $inftab_prop6=$_POST['inftab_prop6'];

    $inftab_price1=$_POST['inftab_price1'];
    $inftab_price2=$_POST['inftab_price2'];
    $inftab_price3=$_POST['inftab_price3'];
    $inftab_price4=$_POST['inftab_price4'];
    $inftab_price5=$_POST['inftab_price5'];
    $inftab_price6=$_POST['inftab_price6'];

    // insert news from form

    mysql_query("UPDATE second_homes 
    SET inftab_prop1 = '
    $inftab_prop1'
    , inftab_prop2 = '
    $inftab_prop2'
    , inftab_prop3 = '
    $inftab_prop3'
    , inftab_prop4 = '
    $inftab_prop4'
    , inftab_prop5 = '
    $inftab_prop5'
    , inftab_prop6 = '
    $inftab_prop6'
    , inftab_price1 = '
    $inftab_price1
    , inftab_price2 = '
    $inftab_price2'
    , inftab_price3 = '
    $inftab_price3'
    , inftab_price4 = '
    $inftab_price4'
    , inftab_price5 = '
    $inftab_price5'
    , inftab_price6 = '
    $inftab_price6'
    , property_type = '
    $property_type'
    , highlight = '
    $highlight'
    , swimming = '
    $swimming'
    , gym = '
    $gym'
    , watersports = '
    $watersports'
    , gardens = '
    $gardens'
    , sports = '
    $sports'
    , spa = '
    $spa'
    , restaurant = '
    $restaurant'
    , shopping = '
    $shopping'
    , golf = '
    $golf'
    , beach = '
    $beach'
    , bar = '
    $bar'
    , display = '
    $display'
    , facilities = '
    $facilities'
    , info_table = '
    $info_table'
    , info_list = '
    $info_list'
    , information_plus = '
    $information_plus_string'
    , information = '
    $information'
    , prices_to = '
    $prices_to'
    , prices_from = '
    $prices_from'
    , location = '
    $location'
    , name = '
    $name'
    WHERE primary_key = '
    $primary_key'");


    ?>

    <?php // close db connection

    include("close_connect.php"); 

    ?>

  14. #14
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    So, does it work?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  15. #15
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope still no joy - the IT company dealing with it are saying it may be an issue with their servers/setup and to leave it with them.

    I'm just trying to make sure it's not an issue i've caused though, as long as there's nothing in that script that's unusual i'll wait for them I guess - will update when I know more

  16. #16
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Well, if that code is actually your code (as opposed to a *******ised version), I'm a little confused as to why the header call is there...

    Can you elaborate?

    I'm going to guess you want to update the database then forward the user onto another page?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  17. #17
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes it is mine. But as I say i'm still learning.

    That's right though, the idea is to update the database, then return you to a list of editable properties.

    Is there a more appropriate way of doing this?

    thanks

  18. #18
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Try this...

    PHP Code:
    <?php
    error_reporting
    (-1);
    ini_set('display_errors'true);

    require_once 
    '../includes/config.php';

    $_POST array_map(
      
    'mysql_real_escape_string',
      
    $_POST
    );


    $name=$_POST['name'];
    $location=$_POST['location'];
    $property_type=$_POST['property_type'];
    $prices_from=$_POST['prices_from'];
    $prices_to=$_POST['prices_to'];
    $information=$_POST['information'];
    $information_plus=$_POST['information_plus'];
    $information_plus_string str_replace(" ","",$information_plus);
    $info_list=$_POST['info_list'];
    $info_table=$_POST['info_table'];
    $facilities=$_POST['facilities'];
    $display=$_POST['display'];
    $primary_key=$_POST['primary_key'];
    $highlight=$_POST['highlight'];

    $bar=$_POST['bar'];
    $beach=$_POST['beach'];
    $golf=$_POST['golf'];
    $shopping=$_POST['shopping'];
    $restaurant=$_POST['restaurant'];
    $spa=$_POST['spa'];
    $sports=$_POST['sports'];
    $gardens=$_POST['gardens'];
    $watersports=$_POST['watersports'];
    $gym=$_POST['gym'];
    $swimming=$_POST['swimming'];

    $inftab_prop1=$_POST['inftab_prop1'];
    $inftab_prop2=$_POST['inftab_prop2'];
    $inftab_prop3=$_POST['inftab_prop3'];
    $inftab_prop4=$_POST['inftab_prop4'];
    $inftab_prop5=$_POST['inftab_prop5'];
    $inftab_prop6=$_POST['inftab_prop6'];

    $inftab_price1=$_POST['inftab_price1'];
    $inftab_price2=$_POST['inftab_price2'];
    $inftab_price3=$_POST['inftab_price3'];
    $inftab_price4=$_POST['inftab_price4'];
    $inftab_price5=$_POST['inftab_price5'];
    $inftab_price6=$_POST['inftab_price6'];

    // insert news from form

    $res mysql_query("UPDATE second_homes 
    SET inftab_prop1 = '
    $inftab_prop1'
    , inftab_prop2 = '
    $inftab_prop2'
    , inftab_prop3 = '
    $inftab_prop3'
    , inftab_prop4 = '
    $inftab_prop4'
    , inftab_prop5 = '
    $inftab_prop5'
    , inftab_prop6 = '
    $inftab_prop6'
    , inftab_price1 = '
    $inftab_price1
    , inftab_price2 = '
    $inftab_price2'
    , inftab_price3 = '
    $inftab_price3'
    , inftab_price4 = '
    $inftab_price4'
    , inftab_price5 = '
    $inftab_price5'
    , inftab_price6 = '
    $inftab_price6'
    , property_type = '
    $property_type'
    , highlight = '
    $highlight'
    , swimming = '
    $swimming'
    , gym = '
    $gym'
    , watersports = '
    $watersports'
    , gardens = '
    $gardens'
    , sports = '
    $sports'
    , spa = '
    $spa'
    , restaurant = '
    $restaurant'
    , shopping = '
    $shopping'
    , golf = '
    $golf'
    , beach = '
    $beach'
    , bar = '
    $bar'
    , display = '
    $display'
    , facilities = '
    $facilities'
    , info_table = '
    $info_table'
    , info_list = '
    $info_list'
    , information_plus = '
    $information_plus_string'
    , information = '
    $information'
    , prices_to = '
    $prices_to'
    , prices_from = '
    $prices_from'
    , location = '
    $location'
    , name = '
    $name'
    WHERE primary_key = '
    $primary_key'");

    if(
    false === $res){
      echo 
    'Update query failed: ' mysql_error();
      exit;
    }

    require_once 
    'close_connect.php';

    header('Location: http://www.yahoo.co.uk/');
    exit;
    What do you get?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  19. #19
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does that only perform the query if it contains no errors?

    I have run it, I get the same error:

    Forbidden

    You don't have permission to access /cms/second_homes_edit.php on this server.

    followed by a period of 2-3 minutes where the server will not show any of the site pages or let me connect via ftp.

  20. #20
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Can you post the content of config.php please? Feel free to obscure any credentials, but do try to keep it 'as-is'.



    Also, is second_homes_edit.php the script we've been discussing?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  21. #21
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for taking the time to help with this, yes that is the script we're discussing.

    config and close_connect copied below:


    config:
    PHP Code:
    <?php

    $con 
    mysql_connect("localhost","****","****");
    mysql_select_db("****"$con);

    ?>
    close_connect:
    PHP Code:
    <?php // close connection

    mysql_close(); 

    ?>

  22. #22
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Ok then, lets take this back to basics.

    Edit second_homes_edit.php, add the following code only, upload it and browse to it in your browser.
    PHP Code:
    <?php echo phpversion(); ?>
    Don't use a form, just the via a url.

    What do you get?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  23. #23
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    same error - I can check php version on plesk as have been given access details - could this be linked to php version?

  24. #24
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    No, no.

    We were just testing to see if your server is parsing simple PHP files, and it appears it is not.

    So yeah, it's a server config issue.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  25. #25
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my mistake - didn't upload file properly.

    returns:

    5.2.13


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •