Connecting Tech Pros Worldwide Help | Site Map

Why Is The URL Affecting My Variables?

  #1  
Old July 17th, 2005, 02:37 AM
Onideus Mad Hatter
Guest
 
Posts: n/a
Take a look at this:
http://www.backwater-productions.net/npindex/index.php

Click "Nintento", "A", and then click "Adventures In The Magic Kingdom"

o_O

Why does it suddenly lose the system variable?

But then if I make an EXACT copy of the file and put it in my main directory, it works!
http://www.backwater-productions.net/index.php

But now try "Nintendo", "A" and "ADDAMS FAMILY, THE". o_O

It loses it! But now try it on the other one and it works! I've gone through my code
over and over and over again and I can't for the life of me figure out any discernable
pattern nor can I figure out why it's doing it. Here's the source code:
http://www.backwater-productions.net/npindex/source.ph3

The only thing I can think of is that the variables are somehow being passed along in the
url and that's causing it to screw up. I'm not exactly what you would call an expert in
PHP though so I'm not really sure. Does anyone have any ideas on how I can fix this lil
problem?

--

Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
  #2  
Old July 17th, 2005, 02:38 AM
Onideus Mad Hatter
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


On Fri, 12 Dec 2003 22:39:42 -0800, Onideus Mad Hatter
<mad_hatter@backwater-productions.net> wrote:
[color=blue]
>Take a look at this:
>http://www.backwater-productions.net/npindex/index.php
>
>Click "Nintento", "A", and then click "Adventures In The Magic Kingdom"
>
>o_O
>
>Why does it suddenly lose the system variable?
>
>But then if I make an EXACT copy of the file and put it in my main directory, it works!
>http://www.backwater-productions.net/index.php
>
>But now try "Nintendo", "A" and "ADDAMS FAMILY, THE". o_O
>
>It loses it! But now try it on the other one and it works! I've gone through my code
>over and over and over again and I can't for the life of me figure out any discernable
>pattern nor can I figure out why it's doing it. Here's the source code:
>http://www.backwater-productions.net/npindex/source.ph3
>
>The only thing I can think of is that the variables are somehow being passed along in the
>url and that's causing it to screw up. I'm not exactly what you would call an expert in
>PHP though so I'm not really sure. Does anyone have any ideas on how I can fix this lil
>problem?[/color]

Well, I guess nobody knows or nobody cares. *shrugs*

I did find a solution, although I still don't know the cause. I found that if I put in a
faux variable, like $blank and put it before all the other variables then it works fine.
For some reason it's only the first variable being sent in the form that gets screwed up
on occasion. Again though, I have no idea why. If I were to take a random guess I'd say
it might have something to do with global variables and such, but I'm not really sure.

--

Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
  #3  
Old July 17th, 2005, 02:38 AM
Jedi121
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


"Onideus Mad Hatter" a écrit le 13/12/2003 :[color=blue]
> On Fri, 12 Dec 2003 22:39:42 -0800, Onideus Mad Hatter[color=green]
>> Take a look at this:
>> http://www.backwater-productions.net/npindex/index.php[/color]
>
> Well, I guess nobody knows or nobody cares. *shrugs*[/color]

Personnaly I don't really like any post beginning by "Have a look
there", etc.
Just post you code and expose precisely your problem : actual behaviour
and desired behaviour.

--
Have you read the manual?
http://www.php.net/manual/en/

  #4  
Old July 17th, 2005, 02:38 AM
Onideus Mad Hatter
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


On Sun, 14 Dec 2003 00:33:26 +0100, Jedi121 <jedi121news@free.fr.Removethis> wrote:
[color=blue]
>"Onideus Mad Hatter" a écrit le 13/12/2003 :[color=green]
>> On Fri, 12 Dec 2003 22:39:42 -0800, Onideus Mad Hatter[color=darkred]
>>> Take a look at this:
>>> http://www.backwater-productions.net/npindex/index.php[/color]
>>
>> Well, I guess nobody knows or nobody cares. *shrugs*[/color]
>
>Personnaly I don't really like any post beginning by "Have a look
>there", etc.
>Just post you code and expose precisely your problem : actual behaviour
>and desired behaviour.[/color]

Um...that's actually what I did...only in reverse. I posted exactly what the problem was
and then posted the link to the code. Technically you didn't really NEED to go to the
first two links, they were more for demonstration purposes so people could see what I was
refering to in design and function. Also I personally do not like posting code in these
groups, it just looks sloppy, it's much easier to just upload the file with a ph3
extension and point people to it. Much easier to see, much easier to browse through.
*shrugs*

--

Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
  #5  
Old July 17th, 2005, 02:38 AM
Geoff Berrow
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


I noticed that Message-ID: <vtnd10cqlh7499@corp.supernews.com> from
Onideus Mad Hatter contained the following:
[color=blue]
>Also I personally do not like posting code in these
>groups, it just looks sloppy, it's much easier to just upload the file with a ph3
>extension and point people to it. Much easier to see, much easier to browse through.[/color]

You should at least make some attempt to isolate the problem yourself
and then post the relevant bit of code.

I've spent hours stripping away bits of code to try to find a problem.
I wouldn't dream of banging the whole lot up and expect the people here
to look at every bit. Now that /is/ sloppy.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
  #6  
Old July 17th, 2005, 02:38 AM
Onideus Mad Hatter
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


On Sun, 14 Dec 2003 01:00:38 +0000, Geoff Berrow <blthecat@ckdog.co.uk> wrote:
[color=blue]
>I noticed that Message-ID: <vtnd10cqlh7499@corp.supernews.com> from
>Onideus Mad Hatter contained the following:
>[color=green]
>>Also I personally do not like posting code in these
>>groups, it just looks sloppy, it's much easier to just upload the file with a ph3
>>extension and point people to it. Much easier to see, much easier to browse through.[/color][/color]
[color=blue]
>You should at least make some attempt to isolate the problem yourself
>and then post the relevant bit of code.[/color]

I DID attempt to isiolate the problem. I said, specifically, it was the FIRST variable
which was being lost and that it had something to do with the URL and even more
specifically probably with global variables. Trimming the code down wasn't really an
option, cause it's pretty much all relevant to the function and design (if you took the
time to really look at it you'd see it operates like something from an MC Escher piece).
And actually, the version I have up is the 3rd version of the code, I ripped the whole
thing apart twice and rebuilt it, each time refining my code. In fact I might even do a
4th rendition of it and see if I can't trim down the portion where it determines whether
to color the system and letter blue or not.
[color=blue]
>I've spent hours stripping away bits of code to try to find a problem.
>I wouldn't dream of banging the whole lot up and expect the people here
>to look at every bit. Now that /is/ sloppy.[/color]

Technically speaking I doubt anyone would even need to look at my code...if they're
experienced enough with PHP (and forms). I mean, the code itself doesn't really appear to
be the problem, if it was, then why would moving it do a different directory solve one
problem but then create others? Also, if it was the code, how come the code works with
some games and not with others? And why is there no discernable pattern? I already
checked for special characters, string lengths, string patterns, etc, etc, there is no
pattern to it, therefore, the problem seems inherent to the design of PHP and forms, ie a
general question about the functionality of PHP in relation to forms (as well as a bit of
basic jscript). Which many people with more experience than I have, have probably dealt
with before...although that's making the assumption that any of you have any idepth
experience with PHP, much like how you make the assumption that I haven't tried to isolate
and figure out the problem on my own. And in fact, I did SOLVE the problem on my own, at
this point I'm merely asking for an explanation as to the WHY behind it. Granted I am
doing something a little off the wall, using onClick redirects to change drop down boxes
in hidden layers (so I can avoid those nasty unchangable grey drop down boxes). I'm also
having it redirect variables directly into button submits and so forth. So I dunno, maybe
none of you have any experience doing anything like that. *shrugs*

--

Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
  #7  
Old July 17th, 2005, 02:38 AM
Richard T. Cunningham
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


It may or may not make a difference, but I couldn't fine a </FORM> in
your source code.

Richard

On Fri, 12 Dec 2003 22:39:42 -0800, Onideus Mad Hatter
<mad_hatter@backwater-productions.net> wrote:
[color=blue]
>Take a look at this:
>http://www.backwater-productions.net/npindex/index.php
>
>Click "Nintento", "A", and then click "Adventures In The Magic Kingdom"
>
>o_O
>
>Why does it suddenly lose the system variable?
>
>But then if I make an EXACT copy of the file and put it in my main directory, it works!
>http://www.backwater-productions.net/index.php
>
>But now try "Nintendo", "A" and "ADDAMS FAMILY, THE". o_O
>
>It loses it! But now try it on the other one and it works! I've gone through my code
>over and over and over again and I can't for the life of me figure out any discernable
>pattern nor can I figure out why it's doing it. Here's the source code:
>http://www.backwater-productions.net/npindex/source.ph3
>
>The only thing I can think of is that the variables are somehow being passed along in the
>url and that's causing it to screw up. I'm not exactly what you would call an expert in
>PHP though so I'm not really sure. Does anyone have any ideas on how I can fix this lil
>problem?[/color]

  #8  
Old July 17th, 2005, 02:38 AM
Onideus Mad Hatter
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


On Sun, 14 Dec 2003 03:48:19 -0700, Richard T. Cunningham <wanderer@oasiscomm.net> wrote:
[color=blue]
>It may or may not make a difference, but I couldn't fine a </FORM> in
>your source code.[/color]

A good suggestion, I tried it, but it didn't seem to change anything. It seems weird how
it's only with the first variable and how it's completely random. I have made an
alternate version with a faux starting variable called $blank and it seems to work fine
doing that, but it would be kinda interesting to find out why. I searched a whole bunch
of web boards for similar problems and there was this one guy who had a similar problem
but all the people who responded to him just thought he was a total newbie and kinda
mistook his question to mean something it didn't.

Probably it has something to do with using onClick to send variables to drop down boxes on
hidden layers, I think I'm probably one of few people to attempt such blatant
insanity...of course if they made form elements more customizable I wouldn't have to do it
the way that I am. Honestly, why is it that text area boxes get ALL the great CSS options
and drop down boxes don't get jack shit? DISCRIMINATION I SAY! o_O

Here's the current working version (if you're using an 800x600 res it'll redirect to a
nonworking smaller version): http://www.backwater-productions.net/npindex/in.html

Only the Virtual Boy and Nintendo sections are up right now (and boy you do not wanna know
how much fucking time it took to put in all those 524 entries in). The display is still a
lil rough, I need to make a couple of the boxes slightly bigger and make it so that it can
format games with long titles on two lines and so forth.

--

Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
  #9  
Old July 17th, 2005, 02:39 AM
Richard T. Cunningham
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


Keep working on it. You'll be surprised when the solution pops up in
front of you. That's usually how I find my own mistakes.

Richard

On Sun, 14 Dec 2003 05:01:51 -0800, Onideus Mad Hatter
<mad_hatter@backwater-productions.net> wrote:
[color=blue]
>On Sun, 14 Dec 2003 03:48:19 -0700, Richard T. Cunningham <wanderer@oasiscomm.net> wrote:
>[color=green]
>>It may or may not make a difference, but I couldn't fine a </FORM> in
>>your source code.[/color]
>
>A good suggestion, I tried it, but it didn't seem to change anything. It seems weird how
>it's only with the first variable and how it's completely random. I have made an
>alternate version with a faux starting variable called $blank and it seems to work fine
>doing that, but it would be kinda interesting to find out why. I searched a whole bunch
>of web boards for similar problems and there was this one guy who had a similar problem
>but all the people who responded to him just thought he was a total newbie and kinda
>mistook his question to mean something it didn't.
>
>Probably it has something to do with using onClick to send variables to drop down boxes on
>hidden layers, I think I'm probably one of few people to attempt such blatant
>insanity...of course if they made form elements more customizable I wouldn't have to do it
>the way that I am. Honestly, why is it that text area boxes get ALL the great CSS options
>and drop down boxes don't get jack shit? DISCRIMINATION I SAY! o_O
>
>Here's the current working version (if you're using an 800x600 res it'll redirect to a
>nonworking smaller version): http://www.backwater-productions.net/npindex/in.html
>
>Only the Virtual Boy and Nintendo sections are up right now (and boy you do not wanna know
>how much fucking time it took to put in all those 524 entries in). The display is still a
>lil rough, I need to make a couple of the boxes slightly bigger and make it so that it can
>format games with long titles on two lines and so forth.[/color]

  #10  
Old July 17th, 2005, 02:42 AM
Stijn Gabriels
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


First I would like to mention that you don't use </option>.

Second:
Just check each time the source code (HTML) in the browser when the error
occures.
It seems that you doesn't lose the system variable, but it is changed:

<DIV STYLE="position:absolute; visibility:hidden; top:40px; left:40px;
width600px; height:500px">
<select name="ys" size=1>
<option>Nintendo&let=J&game=JACKIE+CHAN%27S+ACTION +KUNG-FU&faq=
</select>
</DIV>
(The error occured when I clicked on Jackie Chan etc.)

Grtz,
Stijn



"Onideus Mad Hatter" <mad_hatter@backwater-productions.net> wrote in message
news:vtli93jtgaod1d@corp.supernews.com...[color=blue]
> Take a look at this:
> http://www.backwater-productions.net/npindex/index.php
>
> Click "Nintento", "A", and then click "Adventures In The Magic Kingdom"
>
> o_O
>
> Why does it suddenly lose the system variable?
>
> But then if I make an EXACT copy of the file and put it in my main[/color]
directory, it works![color=blue]
> http://www.backwater-productions.net/index.php
>
> But now try "Nintendo", "A" and "ADDAMS FAMILY, THE". o_O
>
> It loses it! But now try it on the other one and it works! I've gone[/color]
through my code[color=blue]
> over and over and over again and I can't for the life of me figure out any[/color]
discernable[color=blue]
> pattern nor can I figure out why it's doing it. Here's the source code:
> http://www.backwater-productions.net/npindex/source.ph3
>
> The only thing I can think of is that the variables are somehow being[/color]
passed along in the[color=blue]
> url and that's causing it to screw up. I'm not exactly what you would[/color]
call an expert in[color=blue]
> PHP though so I'm not really sure. Does anyone have any ideas on how I[/color]
can fix this lil[color=blue]
> problem?
>
> --
>
> Onideus Mad Hatter
> mhm ¹ x ¹
> http://www.backwater-productions.net[/color]


  #11  
Old July 17th, 2005, 02:43 AM
Stijn Gabriels
Guest
 
Posts: n/a

re: Why Is The URL Affecting My Variables?


I think that the way you are doing it, is much to difficult.

Why do you (only) use post-variables (with $HTTP_POST_VARS, better: $_POST)
and not get-variables (with $HTTP_GET_VARS, better: $_GET)??

You can use $_GET-variables by putting them behind the URL.
Make a link for each system:
<a href="page.php?ys=nintendo">Nintendo</a>
Or for a letter:
<a href="page.php?ys=nintendo&let=a>A</a>
And for a game:
<a href="page.php?ys=nintento&let=a&game=game_title>g ame_title</a>

In your script you can use ys and let by putting:
$ys=$_GET['ys'] etc.

It is also useful to use ID's for each system or game. So you can select a
game in your database with an ID, or in an array.

For Example:
<?php
$systems[0] = "Nintendo";
$systems[1] = "Playstation";
/* etc. */

if (isset($_GET['ys'])){
$ys = $_GET['ys'];
$system = $systems[$ys];
}

if(isset($_GET['let'])){
$let= $_GET['let'];
mysql_query = "SELECT * FROM $table_titels WHERE system=$system AND
letter = $let";
}

if(isset($_GET['game_id'])){
$game_id = $_GET['game_id'];
mysql_query = "SELECT * FROM $table_games WHERE id = $game_id";
}
?>

"Onideus Mad Hatter" <mad_hatter@backwater-productions.net> wrote in message
news:vtli93jtgaod1d@corp.supernews.com...[color=blue]
> Take a look at this:
> http://www.backwater-productions.net/npindex/index.php
>
> Click "Nintento", "A", and then click "Adventures In The Magic Kingdom"
>
> o_O
>
> Why does it suddenly lose the system variable?
>
> But then if I make an EXACT copy of the file and put it in my main[/color]
directory, it works![color=blue]
> http://www.backwater-productions.net/index.php
>
> But now try "Nintendo", "A" and "ADDAMS FAMILY, THE". o_O
>
> It loses it! But now try it on the other one and it works! I've gone[/color]
through my code[color=blue]
> over and over and over again and I can't for the life of me figure out any[/color]
discernable[color=blue]
> pattern nor can I figure out why it's doing it. Here's the source code:
> http://www.backwater-productions.net/npindex/source.ph3
>
> The only thing I can think of is that the variables are somehow being[/color]
passed along in the[color=blue]
> url and that's causing it to screw up. I'm not exactly what you would[/color]
call an expert in[color=blue]
> PHP though so I'm not really sure. Does anyone have any ideas on how I[/color]
can fix this lil[color=blue]
> problem?
>
> --
>
> Onideus Mad Hatter
> mhm ¹ x ¹
> http://www.backwater-productions.net[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to implement static global variables (in an extension) Jarle Aase answers 1 November 24th, 2006 01:25 AM
Mystery: static variables & performance Mark Shelor answers 115 November 14th, 2005 03:57 AM
Global Variables? Multi-Application Variables? Tony Archer answers 5 July 19th, 2005 09:48 AM
Which is better OOP, and why? Dan answers 14 July 17th, 2005 04:16 AM