/    Sign up×
Community /Pin to ProfileBookmark

redirect problem

Any idea why i am getting this error

Fatal error: Call to undefined function: redirect() in /homepages/40/d267348730/htdocs/kenher/check.php on line 20.

This is what the code looks like. in works fine on one server but i get this error when i try to use it on a different server?

[code=php]IF ($pass != md5($_POST[‘password’])){
(“Incorrect password.”);
redirect(‘sorry.php’);
}[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@chazzyFeb 27.2009 — sounds like a php question, but there is no built in "redirect" function in php.
Copy linkTweet thisAlerts:
@zahidrafFeb 27.2009 — There is no redirect funciton in php you have to use this to redirect your page
[CODE]


header('Location: http://www.example.com/');

[/CODE]


However you can write your own funciton like

[CODE]

function redirect($url)
{
header('Location: $url');
exit();
}


[/CODE]
Copy linkTweet thisAlerts:
@civeyauthorFeb 27.2009 — thank you
×

Success!

Help @civey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...