~hazon/hazon/hazon_newest

« back to all changes in this revision

Viewing changes to Administrators/admin_subpages/addschool.php

  • Committer: Liel Fridman
  • Date: 2010-01-13 15:01:18 UTC
  • Revision ID: liel@home-savta-20100113150118-4e9kiwl372dylhf2
Returning to MySQL

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
function secure($in) {
6
6
    return htmlspecialchars(mysql_escape_string($in));
7
7
}
8
 
$link = pg_connect("host=$pgsql_host port=$pgsql_port dbname=$pgsql_database username=$pgsql_username password=$pgsql_password",PGSQL_CONNECT_FORCE_NEW) or die('שגיאת PostgreSQL: לא יכול להתחבר למסד הנתונים. האם אתה בטוח שהוא קיים?');
 
8
$link = pg_connect("host=$pgsql_host port=$pgsql_port dbname=$pgsql_database user=$pgsql_username password=$pgsql_password",PGSQL_CONNECT_FORCE_NEW) or die('שגיאת PostgreSQL: לא יכול להתחבר למסד הנתונים. האם אתה בטוח שהוא קיים?');
 
9
pg_set_client_encoding($link, "UNICODE");
9
10
pg_query($link,'INSERT INTO hazon_schools VALUES ("'.utf8_encode(secure($_POST['code'])).'","'.secure($_POST['name']).'","'.secure($_POST['city']).'","'.secure($_POST['type']).'");') or die ('Error!');
10
11
pg_close($link) or die ('Error!');
11
12
SchoolsDB::CreateSchoolDB($_POST['code']);
12
13
echo "השינויים הוחלו בהצלחה.";
13
 
?>
 
 
b'\\ No newline at end of file'
 
14
?>