Problem with redirecting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saftus
Forum Newbie
Posts: 5
Joined: Thu Feb 21, 2008 5:44 pm

Problem with redirecting

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Problem with redirecting

Post by RobertGonzalez »

Comment out the redirect and echo out the error that is being set and passed to the redirect. See what you get.
saftus
Forum Newbie
Posts: 5
Joined: Thu Feb 21, 2008 5:44 pm

Re: Problem with redirecting

Post by saftus »

okey. How do i do that?

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

Regards.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Problem with redirecting

Post 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__);
?>
 
saftus
Forum Newbie
Posts: 5
Joined: Thu Feb 21, 2008 5:44 pm

Re: Problem with redirecting

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Problem with redirecting

Post 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.
saftus
Forum Newbie
Posts: 5
Joined: Thu Feb 21, 2008 5:44 pm

Re: Problem with redirecting

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Problem with redirecting

Post 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().
Post Reply