Jump to content

[SOLVED] Disable / and <>


daveoffy

Recommended Posts

I want it to clean out the $sitename I have.

 

$sitename = $_POST['sitename'];

 

I will change $str to $sitename?

 

I have this so tell me where to add that code, or what to modify

 

<?php
session_start();
include 'config.php';
$errmsg_arr = array();
$errflag = false;
$sitename = $_POST['sitename'];
$username = $_COOKIE['username'];
if($sitename == ''){
	$errmsg_arr[] = 'Please enter a site name!';
	$errflag = true;
}
if($errflag) {
	$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
	session_write_close();
	header("location: ../editor.php");
	exit();
}
$sql = "SELECT * FROM users WHERE username = '$username'";
$sqlresult = mysql_query ($sql);
while ($row = mysql_fetch_array($sqlresult))
$id = $row['id'];
$qry = "INSERT INTO site (id, site) VALUES('$id', '$sitename')";
$result = @mysql_query($qry);
if($result) {
mkdir('../sites/'.$username.'/'.$sitename);
header("location: ../editor.php");
	$errmsg_arr[] = 'New site added!';
	$errflag = true;
}else {
echo mysql_error();
die("Query failed");
}
if($errflag) {
	$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
	session_write_close();
	header("location: ../editor.php");
	exit();
}
?>

Link to comment
https://forums.phpfreaks.com/topic/147363-solved-disable-and/#findComment-773546
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.