Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

js issue to php
A currently existing page is handed a value like this :

page.htm?code

in the html of that page :



Report this thread to moderator Post Follow-up to this message
Old Post
Peter Van Hove
06-03-05 08:56 PM


Re: js issue to php
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



Report this thread to moderator Post Follow-up to this message
Old Post
Peter Van Hove
06-03-05 08:56 PM


Re: js issue to php
"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



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
06-03-05 08:56 PM


Re: js issue to php
Peter 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.



Report this thread to moderator Post Follow-up to this message
Old Post
Colin McKinnon
06-03-05 08:56 PM


Re: js issue to php
thx, works.



Report this thread to moderator Post Follow-up to this message
Old Post
Peter Van Hove
06-03-05 08:56 PM


Re: js issue to php
It may not be the most beautiful solution but it stays compatible this way
with the earlier implementation.
Life is hard ... ;-)



Report this thread to moderator Post Follow-up to this message
Old Post
Peter Van Hove
06-03-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:48 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.