View Full Version : url variables
DerianX
11-13-2006, 04:47 PM
I'm tying to use php with variables in the url, but for some reason the pages aren't reading the variables.
Example:
URL: http://www.fvmangosteen.com/working/test.php?page=1
Script: <?php echo ("Page: ".$page); ?>;
Output: Page:
White I'm trying to get is:
Output: Page: 1
When I use the same script on another host I've been using for years it works fine. I'm not sure what I need to do to get it to work on Hostmonster.
Sorry if this is a newbish question. Everything I know about web design is self-taught (mostly from reading at php.net).
mojojuju
11-13-2006, 08:26 PM
You were most likely getting that result on your old host because register_globals was on. Having that on can cause some security problems.
You're gonna have to change your script to something like this:
<?php
$page = $_GET['page'];
echo ("Page: ".$page);
?>
DerianX
11-16-2006, 06:03 PM
Thanks, I'll try that.
mbsimonds
11-24-2006, 07:56 PM
Is there a way to turn register_globals on? I'm trying to get an auction script going and I think this is also causing me problems.
mojojuju
11-24-2006, 08:36 PM
Is there a way to turn register_globals on? I'm trying to get an auction script going and I think this is also causing me problems.
Yep there is. And that's one of the things that I like about hostmonster.
In your web directory, there is a file called php.ini. In the php.ini file, there is a line which says:
register_globals = Off
That line would need to be changed to the following to turn register globals on
register_globals = On
Aaron
11-25-2006, 10:14 AM
There're security risks in turning register_globals on, which is why it is off by default. Just making sure that you know what you are in for, in case your website gets compromised.
mbsimonds
11-25-2006, 03:57 PM
Thanks. I will try turning globals on in the PHP.ini.
I realize the security risk, but I want to be sure register globals off is what is causing my problem with the script before I go ahead and hack to make it work with globals off.
mbsimonds
11-25-2006, 04:08 PM
Can't find php.ini anywhere.
Can't find php.ini anywhere.
I had the same problem when I were to modify mine. I contacted support and they added it for me right away.
shadmego
11-27-2006, 10:48 AM
I had the same problem when I were to modify mine. I contacted support and they added it for me right away.
I believe you can also create the file yourself with vim. You would need SSH access. You could also use the "Create new file" option through Cpanel's File Manager.
regards,
Shadmego
mbsimonds
11-27-2006, 11:06 AM
In what folder do I place the file? public_html?
shadmego
11-27-2006, 11:14 AM
In what folder do I place the file? public_html?
The php.ini file goes in any folder of your website that contains php scripts or webpages.
lelang
07-24-2007, 01:01 AM
Hi, I seems to have problem with the date settings in my phpAuction, www.lelang3000.com.
Can someone pls help in setting this date issue? All postings are automatically closed once submitted because of the date settings.
Thanks.
mbsimonds
07-24-2007, 08:52 AM
The date problem is common with phpauction. The reason it shows up incorrectly is the fact that the PHP version that most servers are running are no longer compatible with phpauctions code.
You can fix it by going through ALL of phpauctions files and where you see the time settings:
0, 4
4, 2
6, 2
8, 2
10, 2
12, 2
Change them to
0, 4
5, 2
8, 2
11, 2
14, 2
17, 2
Respectively.
For example. Open item.php and find this:
$year = substr($date,0,4);
$month = substr($date,4,2);
$day = substr($date,6,2);
$hours = substr($date,8,2);
$minutes = substr($date,10,2);
$seconds = substr($date,12,2);
Change it to:
$year = substr($date,0,4);
$month = substr($date,5,2);
$day = substr($date,8,2);
$hours = substr($date,11,2);
$minutes = substr($date,14,2);
$seconds = substr($date,17,2);
I believe you can test this theory out buy changing the number combinations in your index.php
I have a site that uses a modified version of PHPauction and if the regular version of PHPauction you have was as messed up as mine, you have a lot of work ahead of you to get it working correctly.
Good luck.
My sites here:
http://www.reefbuzz.com
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.