wings@volkan-di
10-21-2007, 10:01 AM
Hi Guys,
I have a URL:
http://mydomain.com/add.cgi?email=me@me.com;M_domain=testdomain.com
But I would like testdomain.com to change with a form. so if someone enters google.com in a form then the URL;
http://mydomain.com/add.cgi?email=me@me.com;M_domain=google.com would be submitted.
Todo this, I have made it so that the when the form is submitted, then domain is added to an SQL database, but I am not sure where togo from this?
Here is what I have so far:
<?php
$db_host = "localhost";
$db_user = ".";
$db_pwd = ".";
$db_name = ".";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
?>
<?php
if (!isset($_POST['submit'])) {
?>
<form action="" method="post">
<input type="text" name="name"><br>
<input type="submit" name="submit" value="Submit!">
</form>
<?php
} else {
$name = $_POST['name'];
mysql_query("INSERT INTO `domain` (name) VALUES ('$name')");
echo "Success!";
}
?>
<?php
$connection = mysql_connect($db_host,$db_user,$db_pwd);
$query = mysql_db_query($db, "SELECT * from table_domain ");
check_mysql($query);
while ($row = mysql_fetch_array($query)) {
$domain = $row["name"];
$workString = "email=me@me.com;M_domain=$domain";
$url = "http://mydomain.com/add.cgi"; ?>
But I just cant seem to get it work, ant ideas?
I have a URL:
http://mydomain.com/add.cgi?email=me@me.com;M_domain=testdomain.com
But I would like testdomain.com to change with a form. so if someone enters google.com in a form then the URL;
http://mydomain.com/add.cgi?email=me@me.com;M_domain=google.com would be submitted.
Todo this, I have made it so that the when the form is submitted, then domain is added to an SQL database, but I am not sure where togo from this?
Here is what I have so far:
<?php
$db_host = "localhost";
$db_user = ".";
$db_pwd = ".";
$db_name = ".";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
?>
<?php
if (!isset($_POST['submit'])) {
?>
<form action="" method="post">
<input type="text" name="name"><br>
<input type="submit" name="submit" value="Submit!">
</form>
<?php
} else {
$name = $_POST['name'];
mysql_query("INSERT INTO `domain` (name) VALUES ('$name')");
echo "Success!";
}
?>
<?php
$connection = mysql_connect($db_host,$db_user,$db_pwd);
$query = mysql_db_query($db, "SELECT * from table_domain ");
check_mysql($query);
while ($row = mysql_fetch_array($query)) {
$domain = $row["name"];
$workString = "email=me@me.com;M_domain=$domain";
$url = "http://mydomain.com/add.cgi"; ?>
But I just cant seem to get it work, ant ideas?