0

I have a website on Wordpress and I developed some theme options in my functions.php file of the theme folder.

Everything it`s fine on my localhost, but on server I get a white page when I save the options and also some url's don't work anymore.

I developed this code from some tutorials and the problem might be the php functions used, might be to old, or to new?

Here it is, not long! http://pastebin.com/mKJYuUE2

OW, and the admin shows my options and saves them in database!

Edit after debug on!

I get an error like this Notice: Undefined index: action in "blabla" on line 63 and 93, 94 same error. I think this $_REQUEST['saved'] is the problem, but I don't even know what this does.

Thank you very much!

Edit after debug the code Now I fixed all my wordpress errors. Everything looks fine in my admin options, but now the problem is that if I try to delete a post, or some submit actions, I will get a white screen. On localhost I dont have this problem.

On my functions.php even if I add an echo line will give me this white page. What can I doo???

4
  • I will cry, I can't add any simple option in my admin panel, it will result a white page if any way I do this Commented Oct 9, 2011 at 20:41
  • And did the error say "blabla" or did you remove part of it? Commented Oct 9, 2011 at 23:54
  • I removed. It was the path to my functions.php file. I fixed that error (erase the functions with the error line) and it`s all fine on my localhost, but on server, any submit button clicked will bring a white page, but the button will get the job done... Commented Oct 10, 2011 at 1:32
  • It sounds more like you are asking us to teach you how to debug code than actually solve a specific problem. The problem has shifted several times now, which makes it harder for new readers to help you. To debug this, step through the code and figure out where it is breaking down. Have it echo statements throughout or write to a log file to find out where it is getting stuck. Commented Oct 10, 2011 at 3:21

2 Answers 2

3

UPDATE:

Since you now know the error message. On line 63 it says "save," but line 93 says "saved." Might this inconsistency be the error?

To show error messages, add the following line to your .htaccess file:

php_flag display_errors on

That way you will see the specific error message so you will know where the problem lies specifically. Alternately you can add the following line to your wp-config.php file:

define('WP_DEBUG', true);

That should also display error messages. This will help pinpoint the problem.

Sign up to request clarification or add additional context in comments.

6 Comments

I sett my wp-debut true and looks like a have a lot more errors now, OMG!!! Ignorance is bliss!
@Florescu Adrian: If you develop something for wordpress on your own, always switch WP_DEBUG on. That's important to find errors early.
Yes, I'm not a programmer, I just design and slice to HTML/CSS. I thought the errors are on :))
I get an error like this Notice: Undefined index: action in "blabla" on line 63 and 93, 94 same error. I think this $_REQUEST['saved'] is the problem, but I don't even know what this does.
If I add php_flag display_errors on it will display a 500 Internal Server Error. I erased the function that gived me that error (blablabla url - to my functions.php file) and now I have this problem with all of my pages and submit buttons from the admin panel. The button will do the job, but as feedback I get a white page. On my localhost now there is no error. I don't know what to do anymore!!!
|
0

My guess is you don't have short_open_tag enabled in your php.ini file on the server. Try changing the <? on the first line to <?php.

It's widely considered best practice to disable short_open_tag and use the longer <?php form instead. One of the main reasons is that it makes outputting XML a lot simpler because XML documents start with <?xml which conflicts with PHP's short opening tag.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.