in reply to Get Cookies for Form Input

If I understand correctly: you want the Perl and the PHP to use the same sessions. The good news is what you are trying to do is possible. The bad news is, it won't be super easy for a beginner.

As mentioned, the cookies are in the HTTP headers (not in the HTML at all). So you won't have to put them in pages. You will have to, probably, normalize your Perl to use the PHP session. This should do that for you: PHP::Session.

This isn't hard for an experienced web dev but for a beginner, not so fun. If you can provide a small example of the Perl you need to share the PHP sessions--a working CGI--you'll likely get better help.

Replies are listed 'Best First'.
Re^2: Get Cookies for Form Input
by locked_user sundialsvc4 (Abbot) on Sep 16, 2010 at 00:24 UTC

    Indeed. Expect very high-quality help from this community in particular.   Just give us something to go on... Welcome!

      I'm sorry but I don't know what to give you. Nothing works.
        I'm sorry but I don't know what to give you. Nothing works.

        Sorry, hire somebody who works, who can look at your code and write the missing parts

Re^2: Get Cookies for Form Input
by Anonymous Monk on Sep 16, 2010 at 00:38 UTC
    Oh, no. Please not PHP::Session. That was one of the first things I read about. The generic script that gets the cookies and prints them.
    #!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use CGI; $cgi_query = new CGI; print $cgi_query->header; print $cgi_query->start_html('get-cookie.cgi'); print $cgi_query->h4('My cookies are:'); $myCookie1 = $cgi_query->cookie('c1'); $myCookie2 = $cgi_query->cookie('c2'); $myCookie3 = $cgi_query->cookie('c3'); print "<PRE>\n"; print $myCookie1; print "<br>\n"; print $myCookie2; print "<br>\n"; print $myCookie3; print "</PRE>\n"; print $cgi_query->end_html;
    I just want them to print in the input box and/or become the value of the form input box.

      To what end? Cookies cannot be used that way. Unless you define your problem better, you are unlikely to get any other help. From your description so far, PHP::Session is exactly what you want and by far the easiest way to get there. Giving a cookie that came from Perl code to PHP will gain you nothing without writing a mess of new and fairly hairy PHP. Second guessing developers who know this stuff is also unlikely to help. :)

        The first application is a combination PERL/PHP but the cookie is PERL in origin. The second application is pure PERL.

        PHP/PERL application ==cookie==> PERL application