Results 1 to 14 of 14

Thread: Need help with php

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432

    Need help with php

    im trying to get this asp scritp from brainjar.com to php because my server is linux and only supports php and cgi can some one conver this into php for me please??? ill add thanks or like to you site for your help

    [Cookie]
    <% 'Set scheme cookie.

    Response.Buffer = true
    if Request.QueryString("scheme") <> "" then
    Response.Cookies("scheme") = Request.QueryString("scheme")
    Response.Cookies("scheme").Expires = _
    FormatDateTime(DateAdd("d", 60, Now()))
    else
    Response.Cookies("scheme").Expires = _
    FormatDateTime(DateAdd("d", -1, Now()))
    end if

    'Send back to referring page.

    Response.Redirect(Request.ServerVariables("HTTP_REFERER")) %>
    [/Cookie]

    [Include Style Sheet[
    <link href="/common/main.css" rel="stylesheet" type="text/css">
    <% if Request.Cookies("scheme") <> "" then %>
    <link href="/common//main.css"
    rel="stylesheet" type="text/css">
    <% end if %>
    [/Include Style Sheet]

    Please thank for your help

  2. #2
    Member
    Join Date
    Jan 2002
    Location
    India
    Posts
    50
    Working on it.
    But give me 6 hrs from posting this, since I have other work at office too.
    Will let u know of course.
    And if you can give me access to your remote server so that I can actually run it (right now I am just going to translate the syntax) then I can check it up too.
    Thanks.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    hmm you want access to my server?

  4. #4
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    somewhere i saw a utility that would convert ASP to PHP. i can't remember what it is called though. I'll look

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    ya its called asp2php i tryed it...It didnt work

  6. #6
    Member
    Join Date
    Jan 2002
    Location
    India
    Posts
    50
    <?php

    if ($scheme <> '')
    {
    setcookie ('scheme', $scheme,time()+3600);
    }
    else
    {
    setcookie ('scheme', '',time()-3600);
    }

    header('location:'.$HTTP_REFERER);
    exit;
    ?>

    Now where is the Stylesheet code to go? In another page I suppose, since you are already redirecting the user to the refering page from here.

    Here is code to include the ss:

    <?php
    if ($scheme <> '')
    {
    ?>
    <link href="/common//main.css"
    rel="stylesheet" type="text/css">
    <?php
    }
    ?>

    question: why the // before main.css (typo?)

    note that u do not have to do anything special to use the cookie var: once set, it is available as a global var like other script wide variables. So access it simply by typing $scheme.

    HTH. If there's a syntactical error, though I 've tried to be accurate, it might cropus sinceI am writing this code from memory without executing it(wihich is why i wanted access to your server from my office!). Get back and I'll set it right in case of errors.

    Thanks

  7. #7
    Member
    Join Date
    Jan 2002
    Location
    India
    Posts
    50

    BTW

    Where *are* you using this code? If you like, here's a humble request to put my site link on your site:

    <humblerequest>
    Please put my website's link on your site.

    Lyra Computing

    </humblerequest>


  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    Do you have icq or something that we can talk on ?

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    The code didnt work i dont think i gave all the code my bad
    here is the link for the script

    http://www.brainjar.com/asp/schemes/

    Thanks for helping me

  11. #11
    Member
    Join Date
    Jan 2002
    Location
    India
    Posts
    50
    ok. looking into it...

  12. #12
    Member
    Join Date
    Jan 2002
    Location
    India
    Posts
    50
    ok. looking into it...
    what's the error, btw? some syntax problem or functional error?

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    I think it was a functional dont remember i deletesd the scritp

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432
    Did you get it ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width