Php Fatal Error Call To Undefined Function Http_redirect
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings call to undefined function redirect() in codeigniter and policies of this site About Us Learn more about Stack Overflow php redirect the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Php Header
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function site_url() in PHP up vote 0 down vote favorite I have a form that that has ACTION="upload.php". This file is present in the same directory as the form is in. Now what I want is to show a message when the form does the operation successfully navigate back to page that has the form. Something like this: This is the page where I upload the file. Then on Upload button click, it goes to 'upload.php': load->helper('url'); $site_path = site_url(); $targetfolder = "doc_libraray/"; $targetfolder = $targetfolder . basename( $_FILES['file']['name']) ; if(move_uploaded_file($_FILES['file']['tmp_name'], $targetfolder)) { echo "The file ". basename( $_FILES['file']['name']). " has been uploaded"; return; } else { echo "Problem uploading file"; }?> The problem here is when I try to use siteURL() to redirect after upload success, it gives me a fatal error message. Not able to understand why? Any suggestions on how to achieve it? OR Is there a way to process the uploaded file on the same page itself? php file-upload url-redirection http-redirect share|improve this question asked May 8 '15 at 1:55 CodeKaro 4163923 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote Yes, you don't need to call a separate file to execute the upload The code can exist in the same file, and then just execute it with something like: if (isset($_POST['submit'])) { ...code here } you can just eithe
Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality. [SOLVED] Redirect to a URL Started by trink, Sep 06 2007 07:32 PM Please log in to reply 10 replies to this topic #1 trink trink Advanced Member Members 35 posts Posted 06 September 2007 - 07:32 PM I've been searching all over for this and for some reason, I can't find anything viable. I found http_redirect on http://us3.php.net/m...tp-redirect.php, and I used it on my page, and it returned this. Fatal error: Call to undefined function: http_redirect(). What would I do to redirect the user to a page AND keep the variables that were set? Back http://stackoverflow.com/questions/30114573/fatal-error-call-to-undefined-function-site-url-in-php to top #2 LiamProductions LiamProductions Advanced Member Members 496 posts Posted 06 September 2007 - 07:36 PM I believe that would work. In this hour, Your going to get your hands dirty with some of the nuts and bolts in the language Back to top #3 trink trink Advanced Member Members 35 posts Posted 06 September 2007 - 07:47 PM It redirected the page, but it didn't keep all the variables. Is there any https://forums.phpfreaks.com/topic/68257-solved-redirect-to-a-url/ way to keep all the variables stored when it redirects? Back to top #4 LiamProductions LiamProductions Advanced Member Members 496 posts Posted 06 September 2007 - 07:48 PM If you Post them to the next page i'm sure its possible or if the page is blank you could include the page In this hour, Your going to get your hands dirty with some of the nuts and bolts in the language Back to top #5 GingerRobot GingerRobot Advanced Member Staff Alumni 4,086 posts LocationUK Posted 06 September 2007 - 07:51 PM The easiest way would be pass all the parameters you need along with the url: You can then retrieve them using from the $_GET array. Back to top #6 trink trink Advanced Member Members 35 posts Posted 06 September 2007 - 11:07 PM If you Post them to the next page i'm sure its possible or if the page is blank you could include the page How would I post them to the next page? $_CONFIG is an array, and I'd like to post it so that I can get it on the next page with $_POST How would I go about doing that? I don't want to use hidden inputs, and I don't want to do it via the URL. Any tips? Thanks Back to top #7 BlueSkyIS BlueSkyIS Advanced Member Members 4,268 posts Po
と言うのも、現在PHPをまったくの0から教えるということを始めていて、フレームワーク等一切使わず、プレーンなPHPでHello WorldやPOSTしてみたり……を順番にやってみてます。で、私自身も試しに動かしてみたりするんですが、「登録して一覧にリダイレクト」みたいなごく基本的なことをやろうとして引っかかりました。 原因は、pecl_httpのバージョンが2になっているからです。 現在の最新は、2.2.0。2.0.0以降はv1系と全く違うものになっているらしく、後方互換性がなくなっています。要するにhttp_redirectという関数はなくなっているのです。これだけじゃなくて他にも沢山使えなくなっています。 call to 解決策としては、v1系をインストールすることなのですが、PHP5.6だとだめな感じです。 # yum list --enablerepo=remi --enablerepo=remi-php56 | grep php-pecl-http php-pecl-http.x86_64 2.2.0-1.el7.remi.5.6 @remi-php56 php-pecl-http-devel.x86_64 2.2.0-1.el7.remi.5.6 remi-php56 call to undefined php-pecl-http1.x86_64 1.7.6-4.el7.remi.5.4 remi php-pecl-http1-devel.x86_64 1.7.6-4.el7.remi.5.4 remi php54-php-pecl-http.x86_64 2.2.0-1.el7.remi remi php54-php-pecl-http-devel.x86_64 2.2.0-1.el7.remi remi php54-php-pecl-http1.x86_64 1.7.6-5.el7.remi remi php54-php-pecl-http1-devel.x86_64 1.7.6-5.el7.remi remi php55-php-pecl-http.x86_64 2.2.0-1.el7.remi remi php55-php-pecl-http-devel.x86_64 2.2.0-1.el7.remi remi php55-php-pecl-http1.x86_64 1.7.6-5.el7.remi remi php55-php-pecl-http1-devel.x86_64 1.7.6-5.el7.remi remi php56-php-pecl-http.x86_64 2.2.0-1.el7.remi remi php56-php-pecl-http-devel.x86_64 2.2.0-1.el7.remi remi とかすると、php-pecl-http1というv1系のものがあるんですが、php5.6はだめみたいです。インストールしようとしても、 パッケージ php-pecl-http1 は php-pecl-http によって不要になりました。代わりに php-pecl-http-2.2.0-1.el7.remi.5.6.x86_64
Parcours Cours Partenaires Forums Premium S'inscrire Se connecter Inscription S'inscrire avec Facebook S'inscrire avec Google Wonder Prénom * Nom * Adresse email * Vous recevrez votre mot de passe sur cette adresse email. J'ai lu et j'accepte les Conditions Générales d'Utilisation. * S'inscrire Connexion Se connecter avec Facebook Se connecter avec Google Adresse email ou nom d'utilisateur * Mot de passe * Se souvenir de moi Mot de passe oublié Se connecter Pas encore membre ? Inscrivez-vous gratuitement en 30s. S'inscrire Se connecter Forums des Zéros Une question ? Pas de panique, on va vous aider ! Fil d'Ariane Accueil Forum Site Web PHP [Http] Comment faire une redirection ? Liste des forums Partage [Http] Comment faire une redirection ? Sujet résolu rstallman 31 août 2014 à 15:49:11 Bonjours, j'ai un fichier php qui analyse un formulaire et qui redirige si les identifiants sont corrects . Le problème vient quand j'essaye de faire la redirection avec la fonction http_redirect j'ai une erreur Fatal error: Call to undefined function http_redirect() in /opt/lampp/htdocs/Exercice/TP : les sessions/analyseSession.php on line 12 Voila mon script l'identifiant ou le mot de passe est incorrect
"; } ?> Amicalement Rstallman Site Web : Draemeo | Draema | Draemin | Draemak | Draem-Sitter Tripel_Karmeliet 31 août 2014 à 15:58:40 En installant ça : http://fr2.php.net/manual/en/http.install.php THE GAME Psychokiller1888 31 août 2014 à 16:55:10 Ou ça: public static functi