Jump to content

[SOLVED] Unexpected '{'


zackcez

Recommended Posts

Well here's the partial of my code:

	} else {
		if ($serverCount == '1') {
			if (!isset($_POST['server_name']) || !isset($_POST['server_ip']) || !isset($_POST['server_features']) { //Line with error
				//eror message stating please complete all required fields
			} else {
				$server_ip = $_POST['server_ip']; 
				$fp        = @fsockopen($server_ip, 43594, $errno, $errstr, 10);
				if ($fp) {
					$updateData = mysql_query("UPDATE server_status SET server_ip='".$_POST['server_ip']."', server_site='".$_POST['server_site']."', up='1', total_uptime='1', total_downtime='0', server_features='".$_POST['server_features']."' WHERE server_id='".$myData['server_id']."'");
				} else {
					//Error saying something like server offline
				}
			}
		} elseif ($serverCount == '0') {
			if (!isset($_POST['server_name']) || !isset($_POST['server_ip']) || !isset($_POST['server_features']) {
				//eror message stating please complete all required fields
			} else {
				$server_ip = $_POST['server_ip']; 
				$fp        = @fsockopen($server_ip, 43594, $errno, $errstr, 10);
				if ($fp) {
					$insertData = mysql_query("INSERT INTO server_status (owner_id, server_ip, server_site, server_features) VALUES('".$userid."', '".$_POST['server_ip']."', '".$_POST['server_site']."', '".$_POST['server_features']."')");
				} else {
					//erorr saying offline
				}
			}
		} else {
			die();
		}
	}

Proabably something stupid i missed, but if anyone can see it, please tell me lol

Link to comment
Share on other sites

Replace:

if (!isset($_POST['server_name']) || !isset($_POST['server_ip']) || !isset($_POST['server_features']) {

 

With:

if (!isset($_POST['server_name']) || !isset($_POST['server_ip']) || !isset($_POST['server_features'])) {

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.