elementz
-
Posts
36 -
Joined
-
Last visited
Never
Posts posted by elementz
-
-
Yah remember now, but now I get this :(.
[b]Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/elementz/public_html/create.php on line 36
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/elementz/public_html/create.php on line 105
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/elementz/public_html/create.php on line 175[/b] -
[code]<?
// Admin username and password to reach
// the show user stats found at
// admin.php.
$auser =
$apass =
// Your free hosting site's domain name.
// Don't include the www. or http://.
$udomain = yourdomain.com
// Please don't change this unless you
// know what you are doing.
$host = localhost
// Your WHM username
$user = username
// Your WHM access hash. Look at google
// for what this means.
$accesshash =
// The plan name in WHM that you want
// to give for free hosting.
// Normally this is your whm username
// then _ then the plan found in WHM.
$acctplan = username_plan
// Your email, this will be used as
// a reply for your hosting users.
$aemail = youremail@yourdomain.com
// Your name, this will just be in
// the email sent to your users.
$name = Luke
// The nameservers for your domain.
// These will be used for users
// who register with their own
// domain.
$ns1 = ns1.yourdomain.com
$ns2 = ns2.yourdomain.com
?>[/code]
This is my config code. -
Any forum or comment systems tutorials around? If so then please link them.
Thankyou,
Luke -
[quote author=hackerkts link=topic=101649.msg402431#msg402431 date=1153740371]
Example:
[code]SELECT * FROM members ORDER BY id DESC LIMIT 10[/code]
[/quote]
Does that get the 10 most newest members? also how do I get them by top ten points, say the points row is called points, how do I get the top ten members with the highest points? -
Now I get:
[b]Parse error: syntax error, unexpected T_VARIABLE in /home/elementz/public_html/config.php on line 7[/b] -
[quote author=Orio link=topic=101645.msg402426#msg402426 date=1153739605]
In create.php, change this:
$edmn = $domain
To:
$edmn = $domain[b];[/b]
Orio.
[/quote]
Will the rest work now? -
How do I show the newest ten table rows added to a MySQL database so I can show the 10 newest signed members that have signed up. Also how do I show the top ten points scored out of the members when one of the table rows is points. Please help me :D
Thankyou,
Luke -
This is new.php:
[code]<html>
<head>
<title>New Account :: Index</title>
<link rel="stylesheet" type="text/css"
href="sheet.css" />
</head>
<body>
<table align="center" width="600" bgcolor="#41FBFD" border="2" bordercolor="#0113FC">
<form action="create.php" method="POST">
<tr align="center">
<td width="50%">
<font size="4"><b>Email:</b><br>Please enter a real email address.</font>
</td>
<td width="50%">
<input type="text" name="email" class="form">
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b>Domain:</b><br>Please don't include the http:// or www., For subdomain please enter the domain aspect i.e. yourname would be entered for yourname.<?php echo $udomain ?>.</font>
</td>
<td width="50%">
<input type="text" name="dmn" class="form">
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b> </b></font>
</td>
<td width="50%">
<select name="dmntype" class="form">
<option value ="subd">SubDomain</option>
<option value ="dom">Domain</option>
</select>
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b>Username:</b><br>Maximum of 8 letters, please only use letters and numbers.</font>
</td>
<td width="50%">
<input type="text" name="user" class="form">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="Submit" value="Create" class="form">
</td>
</tr>
</form>
</table>
</body>
</html>[/code]
And this is create.php:
[code]<?
include("config.php");
include("connect.php");
require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
$email=$_POST['email'];
$domain=$_POST['dmn'];
$user=$_POST['user'];
$dmntype = $_POST['dmntype'];
switch($var){
case "subd" :
$edmn= '$domain.$udomain';
break;
case "dom" :
$edmn= '$domain';
break;
}
function randomkeys($length)
{
$pattern = "1234567890abcdefghijklmnopqrstuvwxyz";
for($i=0;$i<$length;$i++)
{
$key .= $pattern{rand(0,35)};
}
return $key;
}
$pass = randomkeys(8);
$sql="SELECT * FROM `email` WHERE email='$email'";
$result=mysql_query($sql);
if(mysql_num_rows($result)==0){
}
else{
?>
<html>
<head>
<title>New Account :: Index</title>
<link rel="stylesheet" type="text/css"
href="sheet.css" />
</head>
<body>
<table align="center" width="600" bgcolor="#41FBFD" border="2" bordercolor="#0113FC">
<form action="create.php" method="POST">
<tr align="center">
<td width="50%">
<font size="4"><b>Email:</b><br>Please enter a real email address.</font><br>
<font size="3" color="red">The email <?php echo $email ?> already exists</font>
</td>
<td width="50%">
<input type="text" name="email" class="form">
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b>Domain:</b><br>Please don't include the http:// or www., For subdomain please enter the domain aspect i.e. yourname would be entered for yourname.<?php echo $udomain ?>.</font>
</td>
<td width="50%">
<input type="text" name="dmn" class="form">
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b> </b></font>
</td>
<td width="50%">
<select name="dmntype" class="form">
<option value ="subd">SubDomain</option>
<option value ="dom">Domain</option>
</select>
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b>Username:</b><br>Maximum of 8 letters, please only use letters and numbers.</font>
</td>
<td width="50%">
<input type="text" name="user" class="form">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="Submit" value="Create" class="form">
</td>
</tr>
</form>
</table>
</body>
</html>
<?
exit;
};
$sql="SELECT * FROM `domain` WHERE domain='$edmn'";
$result=mysql_query($sql);
if(mysql_num_rows($result)==0){
}
else{
?>
<html>
<head>
<title>New Account :: Index</title>
<link rel="stylesheet" type="text/css"
href="sheet.css" />
</head>
<body>
<table align="center" width="600" bgcolor="#41FBFD" border="2" bordercolor="#0113FC">
<form action="create.php" method="POST">
<tr align="center">
<td width="50%">
<font size="4"><b>Email:</b><br>Please enter a real email address.</font>
</td>
<td width="50%">
<input type="text" name="email" class="form">
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b>Domain:</b><br>Please don't include the http:// or www., For subdomain please enter the domain aspect i.e. yourname would be entered for yourname.<?php echo $udomain ?>.</font><br>
<font size="3" color="red">The domain <?php echo $edmn ?> already exists</font>
</td>
<td width="50%">
<input type="text" name="dmn" class="form">
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b> </b></font>
</td>
<td width="50%">
<select name="dmntype" class="form">
<option value ="subd">SubDomain</option>
<option value ="dom">Domain</option>
</select>
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b>Username:</b><br>Maximum of 8 letters, please only use letters and numbers.</font>
</td>
<td width="50%">
<input type="text" name="user" class="form">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="Submit" value="Create" class="form">
</td>
</tr>
</form>
</table>
</body>
</html>
<?
exit;
};
$sql="SELECT * FROM `user` WHERE user='$user'";
$result=mysql_query($sql);
if(mysql_num_rows($result)==0){
}
else{
?>
<html>
<head>
<title>New Account :: Index</title>
<link rel="stylesheet" type="text/css"
href="sheet.css" />
</head>
<body>
<table align="center" width="600" bgcolor="#41FBFD" border="2" bordercolor="#0113FC">
<form action="create.php" method="POST">
<tr align="center">
<td width="50%">
<font size="4"><b>Email:</b><br>Please enter a real email address.</font>
</td>
<td width="50%">
<input type="text" name="email" class="form">
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b>Domain:</b><br>Please don't include the http:// or www., For subdomain please enter the domain aspect i.e. yourname would be entered for yourname.<?php echo $udomain ?>.</font><br>
</td>
<td width="50%">
<input type="text" name="dmn" class="form">
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b> </b></font>
</td>
<td width="50%">
<select name="dmntype" class="form">
<option value ="subd">SubDomain</option>
<option value ="dom">Domain</option>
</select>
</td>
</tr>
<tr align="center">
<td width="50%">
<font size="4"><b>Username:</b><br>Maximum of 8 letters, please only use letters and numbers.</font><br>
<font size="3" color="red">The username <?php echo $user ?> already exists</font>
</td>
<td width="50%">
<input type="text" name="user" class="form">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="Submit" value="Create" class="form">
</td>
</tr>
</form>
</table>
</body>
</html>
<?
exit;
};
$edmn = $domain
$query = INSERT INTO contacts VALUES ('','$email','$domain','$user');
createacct ($host,$user,$accesshash,0,$domain,$user,$pass,$acctplan);
$subject = 'New Free Hosting Account At $udomain.';
$message = 'Welcome to $udomain \n\n Your free hosting account has been automatically created. \n\n Your account info is the following: \n\n Username: $user \n Password: $pass \n Domain/Subdomain: $domain \n Cpanel: $domain/cpanel \n\n If you have your own domain then set the nameservers to the following: \n\n $ns1 \n $ns2 \n\n Thankyou for choosing us as your free host, \n $name';
$headers = 'From: $aemail' . "\r\n" .
'Reply-To: $aemail' . "\r\n" .
mail($email, $subject, $message, $headers);
mysql_query($query);
mysql_close();
?>[/code]
When I try to create a new account via new.php then onto create.php it comes up with the error:
[b]Parse error: syntax error, unexpected T_VARIABLE in /home/elementz/public_html/create.php on line 244[/b]
Can you please fix that and check through the script to see if all is well?
Thankyou,
Luke -
How would I go about making a live chat between 2 registered users. I am making an RPG site and wanted to know how to allow two users to request a chat with each other and then to actually being able to chat. I want them to be able to press close image and the connection closes or when the browser is closed, any ideas on how to do this?
-
what u mean by that?
-
please help someone :D
-
[!--quoteo(post=385967:date=Jun 20 2006, 09:33 PM:name=elementz)--][div class=\'quotetop\']QUOTE(elementz @ Jun 20 2006, 09:33 PM) [snapback]385967[/snapback][/div][div class=\'quotemain\'][!--quotec--]
also can you do more than 1 mysql search at once like:
[code][/code]
$sql="SELECT * FROM `emails` WHERE email='$email'";
"SELECT * FROM `domain` WHERE email='$edmn'";
"SELECT * FROM `user` WHERE email='$user'";
$result=mysql_query($sql);
if(mysql_num_rows($result)==0){
}
else{
};
[/quote]
?? -
also can you do more than 1 mysql search at once like:
[code][/code]
$sql="SELECT * FROM `emails` WHERE email='$email'";
"SELECT * FROM `domain` WHERE email='$edmn'";
"SELECT * FROM `user` WHERE email='$user'";
$result=mysql_query($sql);
if(mysql_num_rows($result)==0){
}
else{
}; -
can i just leave the if part blank and the else part an error in it. will it continue the script if I leave the if part blank?
-
[code]$sql="SELECT * FROM `domain` WHERE email='$edmn'";
$result=mysql_query($sql);
if(mysql_num_rows($result)==0){
}
else{
};[/code]
what could I do to make the script continue if the domain wasnt found in the database?
-
Do I need to end the form and have a submit button?
Also why does this have a *?
[code]SELECT * FROM contacts[/code]
also would this work or are the two variables together wrong?
[code]switch($var){
case subd:
$edmn=$domain.$udomain
break;
case dom:
$edmn=$domain
break;
};[/code] -
Also, how do I carry on variables. Say I had the form on one page and then on the other page I had something, but how do I get the variable on a third page without the use of mysql?
-
How do I delete something from the database?
-
[code]if(mysql_num_rows($result)==0){
"create account"
}
else{
account error
};[/code]
do I need to make this
[code]if(mysql_num_rows($result)==0) then {
"create account"
}
else{
account error
};[/code] -
[code]switch($var){
case 1:
echo("You selected option 1");
break;
case 2:
echo("You selected option 2");
break;
case 3:
echo("You selected option 3");
break;
};[/code]
but how do I define case? example: like say that the drop down has three choice: free, paid, trial would I use the following?
[code]
switch($var){
case free:
echo("You selected free");
break;
case paid:
echo("You selected paid");
break;
case trial:
echo("You selected trial");
break;
};
[/code] -
[code]if(mysql_num_rows($result)==0){
"create account"
}
else{
account error
};[/code]
that would work? but change the create account and account error to PHP language lol
for the select thing, could i do this.
[code]$var = $_POST['something'];
if (var == 1){
you chose car 1
}
else if (var == 2){
you chose car 2
}
else (var == 3){
you chose car 3
}[/code]
Would that work? -
How do you check the MySql database to see if something has already been inputed. For example an email, Check if $email is in the database. Also I want to know how to use select on forms, I know the tags, but don't know how to configure it for what they choose. All help will be appreciated.
Thankyou,
Luke -
How do I create a cPanel account via WHM with php? Can you show me the code, also so that the options like username, domain and pass are variables.
Thankyou,
Luke -
Can you show and example please?
Thankyou,
Luke
testing
in PHP Coding Help
Posted
test