[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 03-02-2008, 11:04 AM   #1 (permalink)
NamePros Regular
 
Join Date: Jul 2003
Location: CALIF
Posts: 324
22.00 NP$ (Donate)

crazyd has a spectacular aura aboutcrazyd has a spectacular aura about


Red face Fix for DomainSellerPro script not working

Some of you may have the Domain Seller Pro Script shown here:

www.domainsellerpro.com

If your script WAS working fine, but now it doesn't work (eg, you can't log into admin, links dont work, etc), there is a reason for it. It is because your host has upgraded to PHP5 and now the way global variables are addressed is different.

The hard fix is to replace $a with $_GET['a'] in the admin.php file etc. (I will note here that I tried that, and it still didn't work, so I must have missed something)

Here is the EASY fix:

Instead of rewriting all the code (re: (2) below), what you need is a php.ini file in your directory (only in the www directory where your other domainsellerpro files are).

Open notepad, Save the file as php.ini and upload it.

The php.ini file should read simply:

register_globals = On

______________

Some more reading on all of this:

(1)http://drupal.org/node/210311
(2)http://www.issociate.de/board/post/2...ariables!.html

So it is a 2 minute fix, real simple.

Leave all your original php files the same, no changes required.

Good luck all.
__________________
http://nicster.com
crazyd is offline  
Old 03-02-2008, 11:31 AM   #2 (permalink)
NamePros Regular
 
Palyriot's Avatar
 
Join Date: Jul 2004
Location: Seattle, Wa
Posts: 596
76.25 NP$ (Donate)

Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough


Bad advice. Don't enable register_globals. Just make the easy changes. It should take less than 2 minutes to fix the entire script. Enabling register_globals is a bad workaround.

Make these changes in admin.php:

Only change $a to $_GET["a"] where you see it in an if statement. Such as:
PHP Code:
if($_GET["a"]=="importing" && $loggedin)
You also need to change:

PHP Code:
$pass = (isset($passfromform)) ?substr(md5($passfromform), -10) : $pass;
to
PHP Code:
$pass = (isset($_POST["passfromform"])) ?substr(md5($_POST["passfromform"]), -10) : $_GET["pass"];

You can also download the working admin.php. Just change the filename from admin.txt to admin.php

Last edited by -RJ-; 03-04-2008 at 12:50 AM.
Palyriot is offline  
Old 03-02-2008, 11:44 AM   #3 (permalink)
NamePros Regular
 
Join Date: Jul 2003
Location: CALIF
Posts: 324
22.00 NP$ (Donate)

crazyd has a spectacular aura aboutcrazyd has a spectacular aura about


Thanks very much Palyriot.

Those changes on the script did not work for me. Specifically, I was able to log into admin ok, whereas I couldn't at all before, but none of the links would work in admin or elsewhere.

Are you sure there are not files other than just admin.php that need updating? Such as index.php or others.

I am no expert on php, believe me. I guess the concern is that turning Globals on is a security risk, right? Someone could hack the site easily? That was my impression. If that is true, it seems someone would have to really have some time on their hands, and if you keep a backup of all your files, you should be ok I should think.

So I guess you are saying that even though my fix works, it is not safe to do so.
__________________
http://nicster.com
crazyd is offline  
Old 03-02-2008, 11:52 AM   #4 (permalink)
NamePros Regular
 
Palyriot's Avatar
 
Join Date: Jul 2004
Location: Seattle, Wa
Posts: 596
76.25 NP$ (Donate)

Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough


I fixed your script and everything works. Infact, I just tested it and all of the links worked.
Palyriot is offline  
Old 03-02-2008, 11:57 AM   #5 (permalink)
NamePros Regular
 
Join Date: Jul 2003
Location: CALIF
Posts: 324
22.00 NP$ (Donate)

crazyd has a spectacular aura aboutcrazyd has a spectacular aura about


Quote:
Originally Posted by Palyriot
I fixed your script and everything works. Infact, I just tested it and all of the links worked.
Actually I put the original files back, and turned Register_Globals On, that's why the links are working now. With your fix, I could log into Admin ok, but the links still would not work.

I am convinced there is another file or files that need updating for your method to work. Possibly index.php or something. I got tired looking over so much code, though.
__________________
http://nicster.com
crazyd is offline  
Old 03-04-2008, 12:24 AM   #6 (permalink)
NamePros Regular
 
zoki's Avatar
 
Join Date: Mar 2007
Posts: 888
222.43 NP$ (Donate)

zoki is a splendid one to beholdzoki is a splendid one to beholdzoki is a splendid one to beholdzoki is a splendid one to beholdzoki is a splendid one to beholdzoki is a splendid one to beholdzoki is a splendid one to behold

Ethan Allen Fund
Quote:
Originally Posted by crazyd
Actually I put the original files back, and turned Register_Globals On, that's why the links are working now.
You leave your car open on the street ?

-
__________________
Patience is your best friend in this business! (© by Gene)
zoki is offline  
Old 03-04-2008, 12:40 AM   #7 (permalink)
NamePros Regular
 
Join Date: Jul 2003
Location: CALIF
Posts: 324
22.00 NP$ (Donate)

crazyd has a spectacular aura aboutcrazyd has a spectacular aura about


Quote:
Originally Posted by zoki
You leave your car open on the street ?

-
Actually I do, yes. It's a good neighborhood.

Thanks for taking the time to make your comment.
__________________
http://nicster.com
crazyd is offline  
Old 03-04-2008, 12:49 AM   #8 (permalink)
RJ
NamePros Founder

Administrator

 
Join Date: Feb 2003
Location: Bay Area, CA
Posts: 13,173
104,201.68 NP$ (Donate)

RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness

Find Marrow Donors! Cystic Fibrosis
Don't enable register globals on your entire server. Just add this line to your config_inc.php script in DSP, anywhere before the closing php ?> tag:

extract($_GET);extract($_POST);

Everything will work fine.
RJ is offline  
Old 03-04-2008, 01:46 AM   #9 (permalink)
NamePros Regular
 
Palyriot's Avatar
 
Join Date: Jul 2004
Location: Seattle, Wa
Posts: 596
76.25 NP$ (Donate)

Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough


Quote:
Originally Posted by -RJ-
Don't enable register globals on your entire server. Just add this line to your config_inc.php script in DSP, anywhere before the closing php ?> tag:

extract($_GET);extract($_POST);

Everything will work fine.
That's just as unsafe as enabling register_globals. Practically does the same thing.
Palyriot is offline  
Old 03-04-2008, 04:25 AM   #10 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
Quote:
Originally Posted by Palyriot
That's just as unsafe as enabling register_globals. Practically does the same thing.
register_globals = On, that's server wide (unless you're running PHP 5 and have the ability to add a local php.ini to the public_html or DSP directory).

extract($_GET); extract($_POST); , that's for the current script (in this case, DSP) only. As long as variables are sanitized, etc (which I'm sure RJ took care of - it's his script), everything will be fine.
__________________
Eric is offline  
Old 03-04-2008, 09:00 AM   #11 (permalink)
NamePros Regular
 
Join Date: Jul 2003
Location: CALIF
Posts: 324
22.00 NP$ (Donate)

crazyd has a spectacular aura aboutcrazyd has a spectacular aura about


Quote:
Originally Posted by SecondVersion
register_globals = On, that's server wide (unless you're running PHP 5 and have the ability to add a local php.ini to the public_html or DSP directory).

extract($_GET); extract($_POST); , that's for the current script (in this case, DSP) only. As long as variables are sanitized, etc (which I'm sure RJ took care of - it's his script), everything will be fine.
If you are running anything less than PHP5, then the script should run fine without any adjustment, right? That's the whole issue here.

I have a hostmonster account (multiple domains), running PHP5 (hostmonster has register_globals OFF by default), and so I put the php.ini only with the www directory files for that domain name, not the root account. That's why I thought security was not a big issue. I did not turn register_globals on for my whole server account, just the directory. I was frankly happy that the script worked with this solution.

But, taking RJ's tip, I deleted my 'local' php.ini file and put RJ's line of code in config_inc.php, and everything works fine, as he said.
__________________
http://nicster.com
crazyd is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 02:23 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85