-
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
-
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.
-
hmm you want access to my server?
-
somewhere i saw a utility that would convert ASP to PHP. i can't remember what it is called though. I'll look
-
ya its called asp2php i tryed it...It didnt work
-
<?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
-
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>
:D
-
-
Do you have icq or something that we can talk on ?
-
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
-
-
ok. looking into it...
what's the error, btw? some syntax problem or functional error?
-
I think it was a functional:rolleyes: dont remember i deletesd the scritp
-