Unstoppable Domains

Earn 70NP$ - Rearrange a little Php script

Spaceship Spaceship
Watch

electricbeat

Account Closed
Impact
0
I have the following scripts that need to be re-ordered a little bit.

Basically, where I have:

<h2>404 error</h2>
Page not found - We are unsure on how you reached this page although you could have reached this page for any of the following.<br /><br />
<li>Mispelt URL</li><br />
<li>Page no longer exists</li><br />
<li>Site / link error</li><br /><br />
If you are unsure on how you got it here enquire by the contact form.

wait, i'm confused myself. Basically, on this script, if you are logged and userlevel = 5 which is admin, it displays the above errror, but I don't need that, instead I need the part where it updates the mysql database etc, which I think is this part:

PHP:
$select = mysql_query("SELECT `leftside` FROM `users`") or die(mysql_error()); //gets the data
$query = mysql_fetch_array($select) or die(mysql_error());
//the form below to type your leftside

?><img src="images/rightside.PNG" /><br /><br /><b>RIGHT SIDE</b><BR />
<textarea cols="40" rows="7" name="leftside"><?php echo $query['leftside']; ?></textarea><br />
<input type="submit" name="update" value="Update the rightside">


<?php
if(isset($_POST['update'])) {
$leftside = ($_POST['leftside']); //filter all html

echo "<tr><td colspan='2'>The leftside have been updated.</td></tr>";
$update = mysql_query("UPDATE users SET leftside = '$leftside'"); //update the table
        }
    }
?>
</form>

If anyone understands and can re-arrange my 5 pages of code which are all basically the same as this page apart from the query:

PHP:
<form method="post">
<?php

if($logged[username] && $logged[level] ==5) { //checks or you logged in and have the correct rank
echo "<h2>404 error</h2>
Page not found - We are unsure on how you reached this page although you could have reached this page for any of the following.<br /><br />
<li>Mispelt URL</li><br />
<li>Page no longer exists</li><br />
<li>Site / link error</li><br /><br />
If you are unsure on how you got it here enquire by the contact form.";
}else{
include("config.php");
//gets the config page
$select = mysql_query("SELECT `links` FROM `users`") or die(mysql_error()); //gets the data
$query = mysql_fetch_array($select) or die(mysql_error());
//the form below to type your links

?>
<img src="images/links.PNG" /><br /><br /><b>LINKS</b><BR />
<textarea cols="40" rows="7" name="links"><?php echo $query['links']; ?></textarea><br />
<input type="submit" name="update" value="Update the links">

<?php
if(isset($_POST['update'])) {
$links = ($_POST['links']); //filter all html

echo "<tr><td colspan='2'>The links have been updated.</td></tr>";
$update = mysql_query("UPDATE users SET links = '$links'"); //update the table
        }
    }
?>
</form>

So basically, I need the stuff that shows if your not logged and userlevel 5, to show if you are logged and userlevel 5 and if your not, then the 404 which is displayed if you are userlevel 5.

willing to give 100np to get this working
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
bumpp please :(
 
0
•••
Ok I'm a little confused with your explanation of what you need, but I think this is what you're after. Let me know if this is correct:

PHP:
<form method="post"> 
<?php
//checks or you logged in and have the correct rank
if($logged[username] && $logged[level] ==5) { 
	include("config.php"); //gets the config page 
	$select = mysql_query("SELECT `links` FROM `users`") or die(mysql_error()); //gets the data 
	$query = mysql_fetch_array($select) or die(mysql_error()); 
	//the form below to type your links 
	?> 
	<img src="images/links.PNG" /><br /><br /><b>LINKS</b><BR /> 
	<textarea cols="40" rows="7" name="links"><?php echo $query['links']; ?></textarea><br /> 
	<input type="submit" name="update" value="Update the links"> 
	<?php
	if(isset($_POST['update'])) { 
		$links = ($_POST['links']); //filter all html 
		echo "<tr><td colspan='2'>The links have been updated.</td></tr>"; 
		$update = mysql_query("UPDATE users SET links = '$links'"); //update the table 
	} 
} else {
	echo "<h2>404 error</h2> 
	Page not found - We are unsure on how you reached this page although you could have reached this page for any of the following.<br /><br /> 
	<li>Mispelt URL</li><br /> 
	<li>Page no longer exists</li><br /> 
	<li>Site / link error</li><br /><br /> 
	If you are unsure on how you got it here enquire by the contact form."; 
} 
?> 
</form>
 
0
•••
You have the idea of what I want but even if I am level 5 / admin it shows me the 404.

willing to give 120 to get this working.
 
0
•••
Well I need to see the entire script then because there's an error somewhere else. From the code I posted above, the very first if statement checks if you're logged in and if the level is equal to 5. If this if check is failing, then something is wrong with your $logged[username] and $logged[level] variables. Perhaps where you are assigning them?
 
0
•••
I'll be on 3:30 - 11:00pm GMT tomorrow and hopefully we can sort it out, thanks :)
 
0
•••
PHP:
<form method="post">
<?php

if($logged[username] && $logged[level] ==5) { //checks or you logged in and have the correct rank
$select = mysql_query("SELECT `leftside` FROM `users`") or die(mysql_error()); //gets the data
$query = mysql_fetch_array($select) or die(mysql_error());
//the form below to type your leftside
?>

<img src="images/rightside.PNG" /><br /><br /><b>RIGHT SIDE</b><BR />
<textarea cols="40" rows="7" name="leftside"><?php echo $query['leftside']; ?></textarea><br />
<input type="submit" name="update" value="Update the rightside">


<?php
	if(isset($_POST['update'])) {
	$leftside = ($_POST['leftside']); //filter all html
	
	echo "<tr><td colspan='2'>The leftside have been updated.</td></tr>";
	$update = mysql_query("UPDATE users SET leftside = '$leftside'"); //update the table
	}

}else{
	include("config.php");
	//gets the config page
	$select = mysql_query("SELECT `links` FROM `users`") or die(mysql_error()); //gets the data
	$query = mysql_fetch_array($select) or die(mysql_error());
	//the form below to type your links
?>
	<img src="images/links.PNG" /><br /><br /><b>LINKS</b><BR />
	<textarea cols="40" rows="7" name="links"><?php echo $query['links']; ?></textarea><br />
	<input type="submit" name="update" value="Update the links">

<?php
	if(isset($_POST['update'])) {
		$links = ($_POST['links']); //filter all html
		
		echo "<tr><td colspan='2'>The links have been updated.</td></tr>";
		$update = mysql_query("UPDATE users SET links = '$links'"); //update the table
	}
}
?>
</form>
 
0
•••
creedfeed is a genius guys, thanks man
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back