pcw Posted February 21, 2009 Share Posted February 21, 2009 I am just trying to convert this script from Perl to PHP, but cant seem to get the syntax correct. It doesnt seem to like => but cant work out what this is in PHP if($input{'setcookie'} == 1){ $packed_cookie = $req->cookie( "sbadmin", "$input{'password'}", time()+3600, "/" ); print $req->header(-COOKIE => $packed_cookie); $header_set = 1; } } if($input{'action'} == ""){ if( !(file_exists("$data_dir/status.OK"))) { $input{'action'} = "install"; if($input{'install_post'} == "password"){ use CGI; $req = new CGI; $packed_cookie = $req->cookie( "sbadmin", "$input{'password'}", time()+3600, "/" ); print $req->header(-COOKIE => $packed_cookie); $header_set = 1; } } } Any help is much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/146281-setcookie-help/ Share on other sites More sharing options...
jackpf Posted February 21, 2009 Share Posted February 21, 2009 Whoah...that looks dodgy. What are you trying to get it to do? Quote Link to comment https://forums.phpfreaks.com/topic/146281-setcookie-help/#findComment-767976 Share on other sites More sharing options...
pcw Posted February 21, 2009 Author Share Posted February 21, 2009 Dodgy isnt the word lol. I have been working on it for the past 2 hours and now I cant think anymore. header is a function that is defined in another file. This script is over 5000 lines long, so at the moment I am just trying to get the syntax correct. As for use CGI; and new CGI; I dont know what they do, or if there is a PHP equivalent. I am really new to PHP, but understand it a little better than perl so am really determined to complete this script. Help is always appreciated :-) Quote Link to comment https://forums.phpfreaks.com/topic/146281-setcookie-help/#findComment-767995 Share on other sites More sharing options...
jackpf Posted February 21, 2009 Share Posted February 21, 2009 Ahh well...tbh, im not really sure what it means either. This script doesn't look like any php i've ever seen before... Probably best wait until someone more knowledgeable comes across this thread! Quote Link to comment https://forums.phpfreaks.com/topic/146281-setcookie-help/#findComment-768004 Share on other sites More sharing options...
pcw Posted February 21, 2009 Author Share Posted February 21, 2009 ok, thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/146281-setcookie-help/#findComment-768008 Share on other sites More sharing options...
pcw Posted February 23, 2009 Author Share Posted February 23, 2009 Can anybody help me on this one? Quote Link to comment https://forums.phpfreaks.com/topic/146281-setcookie-help/#findComment-769126 Share on other sites More sharing options...
premiso Posted February 23, 2009 Share Posted February 23, 2009 setcookie PHP Has a function to do this, look into that. Quote Link to comment https://forums.phpfreaks.com/topic/146281-setcookie-help/#findComment-769210 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.