Page 1 of 1

Problem with redirecting

Posted: Fri Feb 22, 2008 11:57 am
by saftus
Hey!

I got a problem with a MMS/Blog script. Maybe one of you have a solution on it.

My problem is that i get redirect all the time, so nothing is coming up.

Here is the code (2 files): http://www.pastebin.no/3366

Hope someone knows.

Regards.

Re: Problem with redirecting

Posted: Fri Feb 22, 2008 11:59 am
by RobertGonzalez
Comment out the redirect and echo out the error that is being set and passed to the redirect. See what you get.

Re: Problem with redirecting

Posted: Fri Feb 22, 2008 12:19 pm
by saftus
okey. How do i do that?

i'm new into programming php. (thats the reason i use a "finished" script").

Regards.

Re: Problem with redirecting

Posted: Fri Feb 22, 2008 12:31 pm
by RobertGonzalez
The part in the code were you see header() ... comment that out using // in front of the line and then add a new line with something like

Code: Select all

<?php
die('There was an error right here: ' . __LINE__);
?>
 

Re: Problem with redirecting

Posted: Fri Feb 22, 2008 1:04 pm
by saftus
Thanks!

Now i got an error in line 77 in the updated script.
Updated script:
http://www.pastebin.no/3367

What's wrong now?

Regards.

Re: Problem with redirecting

Posted: Fri Feb 22, 2008 1:45 pm
by RobertGonzalez
Your code (which is ok to post here):

Code: Select all

<?php
mkdir("$images_dir") or die('There was an error right here: ' . __LINE__); //or header("location: $url?error=2");
?>
I'd suspect that you do not have permissions to mkdir() on your server. Also, you can do away with the quotes around the $images_dir variable.

Re: Problem with redirecting

Posted: Fri Feb 22, 2008 2:16 pm
by saftus
This is what i did get before i changes the quotes " to '

Warning: mkdir() [function.mkdir]: Permission denied in /store/1/web/mydomain/ny/mms/ny7/mms.class.php on line 77
There was an error right here: 77

This is when it is single '

Warning: mkdir() [function.mkdir]: File exists in /store/1/web/mydomain/ny/mms/ny7/mms.class.php on line 77
There was an error right here: 77

The map "images_dir" have chmod: 777. Is it something else that need chmod-change?

EDIT:
Never mind. I had changed the path in line 16. stupid me.

But now i get another warning message:
Warning: imap_open() [function.imap-open]: Couldn't open stream {localhost:143}INBOX in /store/1/web/mydomain.no/ny/mms/ny7/mms.class.php on line 87
There was an error right here: 88

Regards.

Re: Problem with redirecting

Posted: Fri Feb 22, 2008 3:48 pm
by RobertGonzalez

Code: Select all

<?php
// open mailbox and get all emails from server
if (! $mail = imap_open("{".$pop3_server.":143}INBOX", "$pop3_address", "$password")) {
     die('There was an error right here: ' . __LINE__); //header("location: $url?error=4");
}
?>
Looks there may be something wrong with the connection string that you are passing to imap_open().