::Multiple Site Creator:: Bug

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Nov 07, 2003 1:13 am    Post subject: ::Multiple Site Creator:: Bug Reply with quote

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:
Code:
$domain


Path:
Code:
$dir


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 View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Nov 07, 2003 2:20 am    Post subject: Re: ::Multiple Site Creator:: Bug Reply with quote

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 View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Nov 07, 2003 2:22 am    Post subject: Reply with quote

Which is the best one to use in my situation , im using Post for the form action
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Nov 07, 2003 4:33 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Nov 07, 2003 10:01 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Nov 09, 2003 3:38 am    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sun Nov 09, 2003 3:46 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group