Jump to content

newby help! :(


Garloz

Recommended Posts

Hei,

please can anyone help me? I guess it's done with if function - i can be wrong too. :/ I want to get about the same "step by step" stuff.. Look example: http://p6lva.eu/site/realinfo.php

 

I tried by my own, but I failed too much :(:

<?php
$nick = $_GET['nick'];
$server = $_GET['server'];
$teenus = $_GET['teenus'];

if (!empty($nick) && $server === null) {
echo "<center>Choose server:<br><br>\n
<a href='realinfo.php?server=1&nick=$nick' style='text-decoration: none;'><button style='width: 250px; text-align: left;'><center>\n
Server 1</center></button></a>     
</center>";
}
else {
echo "";
}
if (!empty($server) && $teenus === null) {
include "service1.php";
}
else {
        echo "show frontpage";
}

if (!empty($teenus)) {
if ($teenus === vip && $server === 1) {
	include "vip.php";
}	
if ($teenus === admin && $server === 1) {
	include "admin.php";
}
}
else {
echo "You must choose service!!! Or this service doesnt in our database!!!";
}
if (isset($nick) || isset($server) || isset($teenus)) { // if not added one of the values - like $server, $nick or $teenus then show frontpage
echo "";
}
else {
include 'frontpage.php';
}
?>

 

HELP :(

Link to comment
https://forums.phpfreaks.com/topic/254211-newby-help/
Share on other sites

Sorry about that.. Actually the problem is, that the script wont work correctly. If I open in browser: realinfo.php?server=1&nick=&teenus=vip then it shows me "service1.php" page not the frontpage. If i open realinfo.php?server=1&nick=&teenus=NotValidService it shows me blank page. And so on.. :( If i add wrong serverID then it doesnt redirect me to frontpage :/

 

Or is there some possibility to make it easier?

 

// Btw.. sorry for my english.

 

Mhh.. I meant i want to get the same result like is this: http://p6lva.eu/site/realinfo.php  (PS! it's not my site)

Link to comment
https://forums.phpfreaks.com/topic/254211-newby-help/#findComment-1303367
Share on other sites

Since you're checking for specific strings, you need to put what you're looking for in quotes:

 

if ($teenus === "vip" && $server === 1)

 

and

 

if ($teenus === "admin" && $server === 1)

 

otherwise PHP will think they're constants.  Also, put the following lines at the top of your script:

 

ini_set("display errors", 1);
error_reporting(-1);

Link to comment
https://forums.phpfreaks.com/topic/254211-newby-help/#findComment-1303378
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.