Code Comments
Programming Forum and web based access to our favorite programming groups.A currently existing page is handed a value like this : page.htm?code in the html of that page :
Post Follow-up to this messageA currently existing page is handed a value like this:
page.htm?code_value
in the html of that page :
<script type="text/javascript">
code = (self.location.search) ? self.location.search.substring(1) :
"none";
if (code == "code_value")
{
// build url ...
}
</script>
I want to change the js to php ... but how do I get the code value ?
because, if I understand correctly, php would expect ?code=value
Post Follow-up to this message"Peter Van Hove" <Will_Bounce_So_Use_My_First_Name@Smart-Projects.net> wrote
in message news:AeYne.109259$KF7.6591578@phobos.telenet-ops.be...
>A currently existing page is handed a value like this:
> page.htm?code_value
>
>
> in the html of that page :
>
> <script type="text/javascript">
>
> code = (self.location.search) ? self.location.search.substring(1) :
> "none";
>
> if (code == "code_value")
> {
> // build url ...
> }
>
> </script>
>
>
>
> I want to change the js to php ... but how do I get the code value ?
> because, if I understand correctly, php would expect ?code=value
Elementary, dear Watson.
<?php
$code = $_SERVER['QUERY_STRING'];
if($code=="code_value"){
// build code
}
?>
--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com
Post Follow-up to this messagePeter Van Hove wrote: > A currently existing page is handed a value like this: > page.htm?code_value > Although the part of a URL you have shown may be correct, I've never seend this format being used before and you may be storing up problems by keeping the format (instead of, say, page.html?code_value=1). Running as a module PHP should have full view of the requested URI. Try phpinfo() for the right variable to use. It wont automatically aassign/create a variable wrt 'code_value'. HTH C.
Post Follow-up to this messageIt may not be the most beautiful solution but it stays compatible this way with the earlier implementation. Life is hard ... ;-)
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.