Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Terrible Wordpress Error

    hey guys

    I accidently changed a wordpress setting for the URL of my site to wwww.cpumod.net/dota

    so now all the pages are broken

    at least the login is...

    cpumod.net/dota/wp-admin

    w/e u type, if u try to login it'll go to wwww.cpumod.net which is horrible

    i cant go into the admin panel and edit this, what do i do? where is the setting stored? in the database? or in the actual site settings.php

  • #2
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    The url is stored in the database, in the wp-options table (unless you change the table prefix).

  • #3
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    Uhh that sucks... I don't have phpMyAdmin on 1and1.com hosting...What should I do?

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Nblufire12 View Post
    Uhh that sucks... I don't have phpMyAdmin on 1and1.com hosting...What should I do?
    this is on the same server with your smf forum?

    regards

  • #5
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    Nope, its on a different server

  • #6
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    PHP Code:
    <?php

    // edit these as necessary

    $db_host 'localhost';
    $db_user 'dbuser';
    $db_password 'dbpassword';

    $db_name 'wordpressblog';
    $table_name 'wp-options';

    $wp_url 'http://example.com';

    // end edit


    $link mysql_connect($db_host$db_user$db_password);
    if (
    $link
    {
        
    mysql_select_db($db_name);
        
        
    $sql "UPDATE " $table_name " SET `option_value` = '" $wp_url "' WHERE `option_name` = 'siteurl'";
        
        
    $result mysql_query($sql); 

        if 
    $result     echo 'Updated URL successfully';    
    }

    mysql_close($link);
    ?>
    1. Copy the above code into a new php file.
    2. Edit the variables at the top to reflect the correct values for your site
    3. Save as updateurl.php
    4. Upload to your server.
    5. Browse to the file. You'll see "Updated URL successfully" when it's completed.
    6. Delete the file from your server

  • #7
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    It doesnt work

    www.CPUMod.net/fix.php

  • #8
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    Well, the script I posted does not perform any redirection. So, the error message you're getting is referring to something else - possibly an .htaccess file.

    The only other way I can think of to fix this, would be to access MySQL through the CLI using SSH - assuming you have appropriate access and experience using MySQL through the CLI.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The script posted has some errors in it. The error on the fix.php is not caused by "redirection". Its caused by the if statement on line 26. You need parentheses around the condition. Although just adding in some error checking will suffice. No need for the if statement anymore. If it dies it won't ever get there.
    PHP Code:
    <?php
    $db_host 
    'localhost';
    $db_user 'dbuser';
    $db_password 'dbpassword';
    $db_name 'wordpressblog';
    $table_name 'wp-options';
    $wp_url 'http://example.com';
    $link mysql_connect($db_host$db_user$db_password) or die(mysql_error());
    mysql_select_db($db_name);
    $sql "UPDATE $table_name SET `option_value` = '$wp_url' WHERE `option_name` = 'siteurl'";
    $result mysql_query($sql) or die(mysql_error()); 
    echo 
    'Updated URL successfully';
    mysql_close($link);
    ?>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #10
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    Good catch - missed the parentheses

  • #11
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    Thanks i'll get back to you on how it works when I get home.

  • #12
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    LoL another error

    cpumod.net/fix.php

  • #13
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Its not going to fix the error but we need to know what variables you are using. Change this
    PHP Code:
    <?php
    $db_host 
    'localhost';
    $db_user 'dbuser';
    $db_password 'dbpassword';
    $db_name 'wordpressblog';
    $table_name 'wp-options';
    $wp_url 'http://example.com';
    $link mysql_connect($db_host$db_user$db_password) or die(mysql_error());
    mysql_select_db($db_name);
    $sql "UPDATE $table_name SET `option_value` = '$wp_url' WHERE `option_name` = 'siteurl'";
    $result mysql_query($sql) or die(mysql_error()); 
    echo 
    'Updated URL successfully';
    mysql_close($link);
    ?>
    to this
    PHP Code:
    <?php
    $db_host 
    'localhost';
    $db_user 'dbuser';
    $db_password 'dbpassword';
    $db_name 'wordpressblog';
    $table_name 'wp-options';
    $wp_url 'http://example.com';
    $link mysql_connect($db_host$db_user$db_password) or die(mysql_error());
    mysql_select_db($db_name);
    $sql "UPDATE $table_name SET `option_value` = '$wp_url' WHERE `option_name` = 'siteurl'";
    $result mysql_query($sql) or die(mysql_error().'<br>SQL: '.$sql); 
    echo 
    'Updated URL successfully';
    mysql_close($link);
    ?>
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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