View previous topic :: View next topic |
Author |
Message |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Nov 07, 2003 1:13 am Post subject: ::Multiple Site Creator:: Bug |
|
|
Hello I am the creator of that form thing that inserts domains into Bluedogs PHP script and I need some serious help , I programmed the script with the old varibals , can someone please tell me how to do them with the new varibals.
Here's some example code
-----------------------------------------------------
domain:
Path:
Form input:
Code: | Domain: <input type="text name="domain">
Path: <input type="text" name="dir"> |
Please someone , how do I make it to where people don't need Register Globals = On , I have to write everything all over again :( |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Nov 07, 2003 2:20 am Post subject: Re: ::Multiple Site Creator:: Bug |
|
|
TRUSTPunk,
Instead of using for example $m, use $_GET['m'] or $_POST['m'], or better, use $_REQUEST['m']. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Nov 07, 2003 2:22 am Post subject: |
|
|
Which is the best one to use in my situation , im using Post for the form action |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Nov 07, 2003 4:33 am Post subject: |
|
|
I tried $_POST['name']
and it still will not print !
Here's a small test script that I made , what am I doing wrong ?
PHP Code
Code: | <?php
print "Your Domain is: $_POST['domain']<br>";
print "Your Path is: $_POST['dir']";
?> |
HTML Form
Code: | <form action="test.php" method="post">
Domain: <input type="text" name="domain"><br>
Path: <input type="text" name="dir" value="/"><br>
<input type="submit">
</FORM> |
I saved both files as test.html & test.php
This thing is on hotscripts.com , please help me. |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Nov 07, 2003 10:01 am Post subject: |
|
|
I found a option to fix this problem but the reason why the $_POST[''] did not work is because the '' where in the [ ] so I removed them and it prints out the data without Register Globals turned on , do I need those '' or are they not important ?
Sample of my program , just a taste of it lol !
PHP Code:
Code: | print "//get domain entered in browser<br>
if (\$_SERVER['HTTP_HOST'] == \"<font color=\"blue\">$_POST[domain]<font color=\"black\">\") { <br><br>";
print "//forward to appropriate page<br>
header(\"Location : <font color=\"orange\">$_POST[dir]<font color=\"black\">\"); <br>
exit;<br><br>
}<br>"; |
HTML Form:
Code: |
<form action="test.php" method="post">
Domain: <input type="text" name="domain"><br>
Path: <input type="text" name="dir" value="/"><br>
<input type="submit">
</FORM>
|
Live preview http://os17fan.cjb.net/live/test.html
------------------------------------------------------------------------------------------------------------
Please tell me if I need the '' in between the [ ] 8) |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sun Nov 09, 2003 3:38 am Post subject: |
|
|
You've got the problem because you were embedding the $_POST[] inside a string (between " and ").
It is recommended to not embed these complex variables in strings. For example, instead of:
Code: |
print "hello $_POST[name] !!!";
|
use
Code: |
print "hello " . $_POST['name'] . " !!!";
|
the dot . is the string concatenation operator in PHP. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Sun Nov 09, 2003 3:46 am Post subject: |
|
|
What you said was a little complicated but I think my script works perfect without the ' ' in the [ ] so im just going to leave it as
$_REQUEST[domain]
$_REQUEST[dir]
My friend already tested a contact form I made and it worked perfectly , now one more question id like to ask , does all PHP versions support
$_REQUEST[ ] , If you know the answer please let me know. 8) |
|
Back to top |
|
 |
|