problem with a script it works but is to unsecure *newbe*

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tlc
Forum Newbie
Posts: 1
Joined: Tue Dec 16, 2003 7:07 pm

problem with a script it works but is to unsecure *newbe*

Post by tlc »

Firstly thanks for reading,

I have a script that i have written it does what its ment to but i want to make it secure the script is as follows,

<?php
$user = 'USERNAME FOR CPANEL ACCESS';
$pass = 'PASSWORD, FOR CPANEL ACCESS';
?>
<meta http-equiv="refresh" content="0; URL=http://<?=$user?>:<?=$pass?>@www.DOMAIN.COM:2082/frontend/x/subdomain/doadddomain.html?domain=<?=$sub?>&rootdomain=DOMAIN.com">;



I will explain the script it takes the following information from a basic html form $sub

This then creates the subdomain on Cpanel which is great and works a treat bar the following,

This is my first script, it works which is always a bonus.

But, it has flaws which are as follows:

1. it displays the cpanel password & username.
2. i dont know how to get it to check if the subdomain is already created etc
3. once subdomain is created it doesnt log the user out of cpanel

4. i dont like storing the user name and password in a web accessable php file i may move it so its non web accessable


Could someone help me to correct the following problems i would give someone a drink out of it but i think it could be done with sessions and hashs but beyond me :-(


I can be reached here or by email @ nathan@foley1982.fsworld.co.uk


Many thanks in advance
User avatar
aquila125
Forum Commoner
Posts: 96
Joined: Tue Dec 09, 2003 10:39 am
Location: Belgium

Post by aquila125 »

Did you fix this? If not.. explain a bit clearer.. I don't get it :)
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

well tlc, i dont think anyone would email you will a fix, all we can suggest is how to fix it.

there are more tutorials on this subject alone then any other..i think :P

try google for: [google]user authorization with php tutorial[/google].
Post Reply