Can any one help me with php

dharmil

New Member
Messages
1,656
Reaction score
0
Points
0
PHP:
<?

include "config.php";



function login_form($username) {
	echo '<table border="0" width="90%" cellpadding="0" cellspacing="2">
	<form method="POST" name="login" action="?login">
	<tr>
	<td width="30%">Username:</td>
	<td><input type="text" name="username" value="'.$username.'" size="18"></td>
	</tr>
	<tr>
	<td width="30%">Password:</td>
	<td><input type="password" name="password" size="18"></td>
	</tr>
	<tr>
	<td width="30%"></td>
	<td><input type="submit" value="Login" name="login">
	</td>
	</tr>
	</form></table>';
}




if (isset($_POST[login])) {


if ($admins[$_POST[username]] == $_POST[password]) {

setcookie("newsuser", "$_POST[username]", $time+60*60*24*30 );
setcookie("newspass", "$_POST[password]", $time+60*60*24*30 );
echo 'Logged in<br><a href="admin.php?act=post">Post News</a>';
echo '<br><a href="news.php">Home</a>';

} else {
login_form("$_POST[username]");
}

} else {

login_form("");

}



?>

then i cant put the add code because i can edit it gets a arror
 
B

Brandon

Guest
Here Advanced
PHP:
<?

include "config.php";



function login_form($username) {
	echo '<table border="0" width="90%" cellpadding="0" cellspacing="2">
	<form method="POST" name="login" action="?login">
	<tr>
	<td width="30%">Username:</td>
	<td><input type="text" name="username" value="'.$username.'" size="18"></td>
	</tr>
	<tr>
	<td width="30%">Password:</td>
	<td><input type="password" name="password" size="18"></td>
	</tr>
	<tr>
	<td width="30%"></td>
	<td><input type="submit" value="Login" name="login">
	</td>
	</tr>
	</form></table>';
}




if (isset($_POST[login])) {


if ($admins[$_POST[username]] == $_POST[password]) {

setcookie("newsuser", "$_POST[username]", $time+60*60*24*30 );
setcookie("newspass", "$_POST[password]", $time+60*60*24*30 );
echo 'Logged in<br><a href="admin.php?act=post">Post News</a>';
echo '<br><a href="news.php">Home</a>';

} else {
login_form("$_POST[username]");
}

} else {

login_form("");

}



?> 
<?php include('http://staff.x10hosting.com/adCode.php?ad=advanced'); ?>
Here Corpreate
PHP:
<?

include "config.php";



function login_form($username) {
	echo '<table border="0" width="90%" cellpadding="0" cellspacing="2">
	<form method="POST" name="login" action="?login">
	<tr>
	<td width="30%">Username:</td>
	<td><input type="text" name="username" value="'.$username.'" size="18"></td>
	</tr>
	<tr>
	<td width="30%">Password:</td>
	<td><input type="password" name="password" size="18"></td>
	</tr>
	<tr>
	<td width="30%"></td>
	<td><input type="submit" value="Login" name="login">
	</td>
	</tr>
	</form></table>';
}




if (isset($_POST[login])) {


if ($admins[$_POST[username]] == $_POST[password]) {

setcookie("newsuser", "$_POST[username]", $time+60*60*24*30 );
setcookie("newspass", "$_POST[password]", $time+60*60*24*30 );
echo 'Logged in<br><a href="admin.php?act=post">Post News</a>';
echo '<br><a href="news.php">Home</a>';

} else {
login_form("$_POST[username]");
}

} else {

login_form("");

}



?> 
<?php include('http://staff.x10hosting.com/adCode.php?ad=corporate'); ?>
 
Last edited by a moderator:

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
An easy way to do this is just put:

Advanced:
PHP:
include('http://staff.x10hosting.com/adCode.php?ad=advanced');

Corporate:
PHP:
include('http://staff.x10hosting.com/adCode.php?ad=corporate');

Just a suggestion. It looks as if DesertWar helped you already though. :)
 
B

Brandon

Guest
Thanks Nedren thats what I did just added it at the end of his php code.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Ohhhh I didn't even see that. I'm sorry.. :-( Haha. I'm making myself look like an ass. :-\
 
Top