|
-
Aug 29th, 2002, 09:05 PM
#1
Thread Starter
Lively Member
URL Variables are not working
I am having a BIG problem. URL Variables are not working.
an example of this is:
www.mydomain.com/test.php?myVar=Test
--- test.php ---
<%
echo "The value of myVar is: $myVar";
%>
------------------
outputs: The value of myVar is:
What do I need to do? Is there something in a config file I need to change? This is really putting a hurt on my .php development.
Thanx for the help,
Brandon
Master of Cyber Fu - A Temple of Digital Chi
-
Aug 29th, 2002, 09:21 PM
#2
Fanatic Member
you probably upgraded PHP to 4 and up.
Meaning you can use global variables like that anymore. Try $_REQUEST[MYvar]
-
Aug 29th, 2002, 09:38 PM
#3
Thread Starter
Lively Member
auugghhh
Thanx man.
Auuugghhhh!!!
That means allot of code changing.
I also assume that by changing it, the php code will not be compatible with the older versions. Well... at least my stuff works now.
Thanks again!
brandon
Master of Cyber Fu - A Temple of Digital Chi
-
Aug 30th, 2002, 09:17 AM
#4
PowerPoster
if you just upgraded to PHP 4.2, then register_globals is turned off by default. Simply turn it back on in your php.ini and all your existing code should work as before
-
Aug 30th, 2002, 09:20 AM
#5
Fanatic Member
only do that if your hosting it yourself. If you are getting hosting from some other company, they will of course not turn it off. Its better anyway.
-
Aug 30th, 2002, 09:49 AM
#6
PowerPoster
My host lets me edit my own php.ini.
I don't see how it's better...just means you have to write more code and practically every PHP script in existance has had to have been re-written
Pretty stupid idea turning them off by default if you ask me
-
Aug 30th, 2002, 10:38 AM
#7
Fanatic Member
its helps me know if it is a global or not, I am very forgetful when it comes to that sort of thing.
-
Aug 31st, 2002, 05:05 PM
#8
Frenzied Member
the globals were turned off because it was a security hazard. also brandito that is not php you are doing it is ASP. php is not <% it is <?
oh and jsut a hint, more script will be rewritten in the future because mysql_connect() is going bye bye. mwhahahahahahahah
-
Aug 31st, 2002, 05:44 PM
#9
PowerPoster
Originally posted by phpman
the globals were turned off because it was a security hazard. also brandito that is not php you are doing it is ASP. php is not <% it is <?
oh and jsut a hint, more script will be rewritten in the future because mysql_connect() is going bye bye. mwhahahahahahahah
PHP can be started any number of ways actually
<? ... ?>
<?php ... ?>
<SCRIPT LANGUAGE="php"> ... </SCRIPT>
<% ... %> (that requires asp_tags on in the ini
And I hope you're joking about mysql_connect...show me a link
-
Sep 1st, 2002, 12:35 AM
#10
Frenzied Member
http://www.mysql.com/doc/en/mysql_connect.html
only problem is you are suppose to use mysql_real_connect() but the lastest version of php doesn't even support it.
and if you do it "<%" that way you are confusing the php parser. there is somehting else but it eludes me at the moment.
sure it may work but it will expect to parse it as ASP. plus ASP is weak in a *nix OS.
and I never could get
<SCRIPT LANGUAGE="php"> ... </SCRIPT>
to work, sure it may work but I never got it to work.
-
Sep 1st, 2002, 07:52 AM
#11
Fanatic Member
what will we have to do to connect in the new version?
-
Sep 1st, 2002, 09:59 AM
#12
PowerPoster
It really pisses me off when they change the names of functions for no good reason and call the old one "deprecated" despite the fact it's indentical. They're forever doing it...what is the point?!
and if you do it "<%" that way you are confusing the php parser. there is somehting else but it eludes me at the moment.
sure it may work but it will expect to parse it as ASP. plus ASP is weak in a *nix OS.
and I never could get
<SCRIPT LANGUAGE="php"> ... </SCRIPT>
to work, sure it may work but I never got it to work.
I've never actually tried it, but I know you can. I always use <?php...?>
-
Sep 3rd, 2002, 12:01 AM
#13
Thread Starter
Lively Member
I used the <? I just wrote it wrong on the forum. I must of had an asp relapse. 
mysql_connect... noooo I use that. evil!
It can't go away. I am too lazy
Master of Cyber Fu - A Temple of Digital Chi
-
Sep 5th, 2002, 09:37 AM
#14
Lively Member
well it maybe identical but it is suppose to manage memory better and use less resources.
not much we can do but use the regular one until it finally goes away.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|