Enjoy an ad free experience by logging in. Not a member yet?
Register .
12-09-2008, 08:45 PM
PM User |
#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
12-09-2008, 10:32 PM
PM User |
#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).
12-09-2008, 10:38 PM
PM User |
#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?
12-09-2008, 10:40 PM
PM User |
#4
Master Coder
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
Quote:
Originally Posted by
Nblufire12
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
12-09-2008, 10:43 PM
PM User |
#5
Regular Coder
Join Date: Apr 2008
Posts: 257
Thanks: 15
Thanked 0 Times in 0 Posts
Nope, its on a different server
12-09-2008, 10:56 PM
PM User |
#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
12-09-2008, 11:38 PM
PM User |
#7
Regular Coder
Join Date: Apr 2008
Posts: 257
Thanks: 15
Thanked 0 Times in 0 Posts
12-10-2008, 12:41 AM
PM User |
#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.
12-10-2008, 06:16 AM
PM User |
#9
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 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! ||||
12-10-2008, 06:22 AM
PM User |
#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
12-10-2008, 12:33 PM
PM User |
#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-10-2008, 10:33 PM
PM User |
#12
Regular Coder
Join Date: Apr 2008
Posts: 257
Thanks: 15
Thanked 0 Times in 0 Posts
LoL another error
cpumod.net/fix.php
12-11-2008, 04:00 AM
PM User |
#13
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 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! ||||
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 10:21 AM .
Advertisement
Log in to turn off these ads.