dezkit Posted September 14, 2008 Share Posted September 14, 2008 I have this code, how come it doesn't work? <?php session_start(); if(!isset($_SESSION['myusername'])){ header("location:http://www.mysite.com/home.php?type=609421098494"); } else { $tbl_name="email"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // select record from mysql $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); if(!isset($submit)){ $submit = $_POST["submit"]; $username = $_POST["username"]; $password = $_POST["password"]; $quota = $_POST["quota"]; ?> <form action="" method="post"> <table border="0" class="usial"> <tr><td align="right">Username:</td> <td><input type="text" name="username"></td></tr> <tr><td align="right">Password:</td> <td><input type="text" name="password"></td></tr> <tr><td align="right">Quota:</td> <td><input type="text" name="quota" value="10240"></td></tr> <tr><td> <td><input type="submit" name="submit" value="submit"><input type="reset" name="reset" value="reset"></td></tr> </table> </form> <?php } else { $submit = $_POST["submit"]; $username = $_POST["username"]; $password = $_POST["password"]; $quota = $_POST["quota"]; $createmail = fopen("http://USERNAME:[email protected]:2082/frontend/x3/mail/dopasswdpop.html?email=$username&domain=mysite.com&password=$password"a=$quota","r"); if(!$createmail){ echo "Email has not been created."; } else { echo "[email protected] with a password of $password has been created."; $sql="INSERT INTO $tbl_name(id, username, password, quota)VALUES('$username', '$password', '$quota')"; $result=mysql_query($sql); } } ?> <br><br> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><table width="400%" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" class="usial"> <tr> <td bgcolor="#FFFFFF"> </td> <td colspan="5" bgcolor="#FFFFFF"><strong>Email Wizard</strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"><strong>ID#</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Username</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Password</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Quota</strong></td> <td align="center" bgcolor="#FFFFFF"> </td> <td align="center" bgcolor="#FFFFFF"> </td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['username']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['password']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['quota']; ?>MB</td> <td bgcolor="#FFFFFF"><a href="index.php?page=email&do=update&id=<? echo $rows['id']; ?>" class="oran">update</a></td> <td bgcolor="#FFFFFF"><a href="index.php?page=email&do=delete&id=<? echo $rows['id']; ?>" class="oran">delete</a></td> </tr> <? // close while loop } ?> </table></td> </tr> </table> <?php // close connection; mysql_close(); } ?> basicly it doesn't create an email in cPanel, nor does it store the data in mysql Link to comment https://forums.phpfreaks.com/topic/124239-solved-cpanel-php-email-creator/ Share on other sites More sharing options...
dezkit Posted September 14, 2008 Author Share Posted September 14, 2008 i just fixed it, and now it stores the data in mysql, but it doesn't create an email? any suggestions will be good Link to comment https://forums.phpfreaks.com/topic/124239-solved-cpanel-php-email-creator/#findComment-641555 Share on other sites More sharing options...
dezkit Posted September 14, 2008 Author Share Posted September 14, 2008 problem solved.. Link to comment https://forums.phpfreaks.com/topic/124239-solved-cpanel-php-email-creator/#findComment-641556 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.