• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[PHP] Is this code valid?

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jul 11, 2010
Messages
45
Reaction score
2
I've been working on a Flyff website, and I need to know if this code will work:

PHP:
<?php
include ('config.php')
?>
<?php
{
if
(
$user = $admin
)
echo "$adminpanel";
else
    echo "$userpanel";
}
?>

So, could this work?
*If I need to add more info please tell me*

Edit: I am really looking for this; will this function to the point that it could display a UserCP and an AdminCP with variables, that's my biggest concern.
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Dec 10, 2007
Messages
2,194
Reaction score
263
You'd know if it was valid or not by testing it and seeing if an errors appear on the page.

Also, I'd make your code a little more neat. I also modified the code to work.
PHP:
<?php
include('config.php');
if($user == $admin) {
  echo $adminpanel;
}else{
  echo $userpanel;
}
?>
 
Last edited:
[R8]ℓσℓ32
Loyal Member
Joined
Oct 6, 2008
Messages
1,396
Reaction score
198
I've been working on a Flyff website, and I need to know if this code will work:

PHP:
<?php
include ('config.php')
?>
<?php
{
if
(
$user = $admin
)
echo "$adminpanel";
else
    echo "$userpanel";
}
?>

So, could this work?
*If I need to add more info please tell me*

Edit: I am really looking for this; will this function to the point that it could display a UserCP and an AdminCP with variables, that's my biggest concern.

Check the if function. if ($user == $admin) {
echo ".$adminpanel.";}

Btw, If you want to redirect to another page use header("Location: index.php");
 
Last edited:
Newbie Spellweaver
Joined
Jul 11, 2010
Messages
45
Reaction score
2
Check the if function. if ($user == $admin) {
echo ".$adminpanel.";}

Btw, If you want to redirect to another page use header("Location: index.php");

O.O Wow....I need to start getting some PHP based books...x_x
Ty Caja, I will try that.
 
Zzzz...
Loyal Member
Joined
Dec 26, 2008
Messages
781
Reaction score
225
is better than books ;)
 
Newbie Spellweaver
Joined
Jul 11, 2010
Messages
45
Reaction score
2
I've tried there, but only the HTML and CSS part is really understandable to me, I think my mind just cant grasp PHP :/
 
Banned
Banned
Joined
Jan 21, 2009
Messages
318
Reaction score
53
Once you learn PHP. It will be easier to learn other languages in the future because the syntax is very much the same.
 
Joined
Sep 10, 2006
Messages
2,817
Reaction score
1,417
why would he do that and considering that particular include line was the valid thing in his code, I advise you to stop posting, unless you know what are you talking about, before I infract you.

Besides, he already got his answer, locking it.
 
Status
Not open for further replies.
Back
Top