php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2005

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 16.03.2005, 22:20  
Gast
 
Beiträge: n/a
Standard

obwohl die Travel Dates in searchnew.php korrekt gegeben sind?
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 16.03.2005, 22:22  
Gast
 
Beiträge: n/a
Standard

dann in file addhotel.php
sind errors beim eingabe in Date Base fur neues country und City, kann nicht die jpeg und svg files upload in bestimmtes phad machen?



PHP:

<?php
session_start();
if (!session_is_registered("valid_user")|| $valid_user!="admin")
{
echo "Only the administrator has permisions to visit this page!</br>";
exit();

}
include ("func.php");

ConectDb();

$flag=true;

if (!$hotel_name || !$hotel_addr || !$hotel_catagory || !$hotel_info || !$hotel_details || !$hotel_room)

{
echo "You didn't fill some field(s)!Please go back and fill all correct!";
$flag=0;
saveForm("hotelForm.php");
exit();

}

if (!(ereg("^[a-zA-Z0-9]+$",$hotel_name)))
{
echo "<tr><td>Notice:</td></tr>";
echo "<tr><td>The name of the hotel is maybe not correct!Please go back and try again!</td></tr></br>";
$flag=0;
saveForm("hotelForm.php");
exit();
}

$query="SELECT city.city_id FROM countries,city WHERE countries.country_name='$hotel_country' and city.city_name='$hotel_city' and city.c_id=countries.c_id;";
$res=mysql_query($query);
if (!$num_rows=@mysql_num_rows($res))
{

$query_country="SELECT countries.c_id FROM countries WHERE countries.country_name='$hotel_country';";
$res_country=mysql_query($query_country);
if (!$num_rows=@mysql_num_rows($res_country))
{
echo "<center>This country doesn't exist in the database!Please go back and enter it first!</center>";
saveForm("hotelForm.php?flag=NECountry");
exit();
/*$relative_url="addcountry.php?name=$hotel_country &kind=country";
header("Location: http://".$_SERVER['HTTP_HOST']
.dirname($_SERVER['PHP_SELF'])
."/".$relative_url);
exit();*/
}


else
{
$temparray=@mysql_fetch_array($res_country);
$c_id=$temparray["c_id"];
$query_city="SELECT city.city_id FROM city WHERE city.city_name='$hotel_city';";
$res_city=mysql_query($query_city);
if (!$num_rows=@mysql_num_rows($res_city))
{
echo "<center>This city doesn't exist in the database!Please go back and enter it first!</center>";
saveForm("hotelForm.php?flag=NECity&c_id=$c_id");
exit(); /*$relative_url="addcountry.php?name=$hotel_city&c_ id=$c_id&kind=city";
header("Location: http://".$_SERVER['HTTP_HOST']
.dirname($_SERVER['PHP_SELF'])
."/".$relative_url);


exit();*/
}
else
{
echo "<center>You have entered wrong city and country!Please go back and try again!</center></br>";
saveForm("hotelForm.php");
exit();
}
}
}

else
{
$temparray=@mysql_fetch_array($res);
$hotel_city_id=$temparray["city_id"];
$flag=1;
}


//PROVERKA NA VHODNITE DANNI OT hotelForm.php

if ((strlen($hotel_addr) < 3) || (strlen($hotel_addr) > 100))
{
echo "The addres of the hotel is maybe not correct!Please go back and try again!</br>";

$flag=0;
saveForm("hotelForm.php");
exit();
}
if (!(ereg("^[0-9]+$",$hotel_catagory)) || ($hotel_catagory > 5))
{
echo "<tr><td>The catagory of the hotel is not correct!Please go back and try again!</td></tr></br>";
$flag=0;
saveForm("hotelForm.php");
exit();
}
if (!empty($userfile))
{
if($userfile_size==0)
{
echo "Uploaded file is zero length";
$flag=0;
saveForm("hotelForm.php");
exit();
}
if(($userfile_type!="image/jpg") && ($userfile_type!="image/png") && ($userfile_type!="image/gif"))
{
echo "The type of the file is not correct!It must be with extension .jpg ,.png or .gif!Please go back and upload correct file!";
echo "$userfile_type";
$flag=0;
saveForm("hotelForm.php");
exit();
}
}
//echo "<form><input type='button' name='Back' value='Back' onclick='history.back();'></form>";
//KRAI NA PROVERKATA NA VHODNITE DANNI
if ($flag)
{
$hotel_name=trim($hotel_name);
$hotel_catagory=trim($hotel_catagory);
if (!empty($userfile))
{
$uploaddir = "\\home\\localhost\\www\\";
$uploadfile = $uploaddir.$userfile_name;
if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
{
echo "Could not move file into directory!";
saveForm("hotelForm.php");
exit();
}
}
//$data=addslashes(fread(fopen($hotel_view, "rb"), filesize($hotel_view)));
$query_ins="INSERT INTO hotels (city_id,name,addr,stars,info,hoteldetails,roomama nity,h_pic) VALUES ('$hotel_city_id','$hotel_name','$hotel_addr','$ho tel_catagory','$hotel_info','$hotel_details','$hot el_room','$userfile_name')";
$res_ins=mysql_query($query_ins);
if (!$res_ins)
{
echo "The operation failed! Please try again later!";
exit();

}
else
{
//PREDAVANE KYM SCRIPT ZA VYVEJDANE NA TIPOVE STAI
//$query_sel="SELECT h_id FROM hotels WHERE name='$hotel_name';";
//$res_sel=mysql_query($query_sel);
//$temparray=@mysql_fetch_array($res_sel);
//$hotel_id=$temparray["h_id"];
$hotel_id=mysql_insert_id();


$relative_url="addroom.php?hotel_id=$hotel_id";
header("Location: http://".$_SERVER['HTTP_HOST']
.dirname($_SERVER['PHP_SELF'])
."/".$relative_url);
exit();
//echo "The information for the hotel was entered successful";



}

}
echo "<html>";
echo "<body link='#4040FF' vlink='#463FA3' bgcolor='#eeeeee' >";
TableAdmin();

?>

</body>

</html>
 
Alt 16.03.2005, 22:30  
Gast
 
Beiträge: n/a
Standard

also ich finde es schlimm einem user im netz den "SVG Viwer" aufzuzwingen.
ist nicht besonders kundenfreundlich...
 
Alt 16.03.2005, 22:35  
Waq
Erfahrener Benutzer
 
Registriert seit: 15.08.2004
Beiträge: 2.473
Waq
Standard

Der Beitrag wurde geschlossen, wegen...
... Doppelpostings.

closed
__________________
mod = master of disaster
Waq ist offline  
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
hotel form php

Alle Zeitangaben in WEZ +2. Es ist jetzt 07:16 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.