By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,083 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,083 IT Pros & Developers. It's quick & easy.

Why Is The URL Affecting My Variables?

P: 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
Jul 17 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
On Fri, 12 Dec 2003 22:39:42 -0800, Onideus Mad Hatter
<ma********@backwater-productions.net> wrote:
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?


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
Jul 17 '05 #2

P: n/a
"Onideus Mad Hatter" a crit le 13/12/2003 :
On Fri, 12 Dec 2003 22:39:42 -0800, Onideus Mad Hatter
Take a look at this:
http://www.backwater-productions.net/npindex/index.php


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


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/

Jul 17 '05 #3

P: n/a
On Sun, 14 Dec 2003 00:33:26 +0100, Jedi121 <je*********@free.fr.Removethis> wrote:
"Onideus Mad Hatter" a écrit le 13/12/2003 :
On Fri, 12 Dec 2003 22:39:42 -0800, Onideus Mad Hatter
Take a look at this:
http://www.backwater-productions.net/npindex/index.php


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


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.


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
Jul 17 '05 #4

P: n/a
I noticed that Message-ID: <vt************@corp.supernews.com> from
Onideus Mad Hatter contained the following:
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.


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/
Jul 17 '05 #5

P: n/a
On Sun, 14 Dec 2003 01:00:38 +0000, Geoff Berrow <bl******@ckdog.co.uk> wrote:
I noticed that Message-ID: <vt************@corp.supernews.com> from
Onideus Mad Hatter contained the following:
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.
You should at least make some attempt to isolate the problem yourself
and then post the relevant bit of code.
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.
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.


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
Jul 17 '05 #6

P: n/a
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
<ma********@backwater-productions.net> wrote:
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?


Jul 17 '05 #7

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


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
Jul 17 '05 #8

P: n/a
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
<ma********@backwater-productions.net> wrote:
On Sun, 14 Dec 2003 03:48:19 -0700, Richard T. Cunningham <wa******@oasiscomm.net> wrote:
It may or may not make a difference, but I couldn't fine a </FORM> in
your source code.


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.


Jul 17 '05 #9

P: n/a
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" <ma********@backwater-productions.net> wrote in message
news:vt************@corp.supernews.com...
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

Jul 17 '05 #10

P: n/a
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" <ma********@backwater-productions.net> wrote in message
news:vt************@corp.supernews.com...
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

Jul 17 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.