Re: Re: problem with GET

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



there is a big difference between isset and empty....
don't use empty.. . use isset function wherever u have
used empty in the code below... it should work.. 

bye,
Gaurav Rustogi


--- Raj <fmgnt@xxxxxxxxxxxxxx> wrote:

> But still have same problem
>
/////////////////////////////////////////////////////////
>
///////////////////////////////////////////////////////////
>   <?php
> include('./include/header.inc');
> include('./db_connect.php');
> 
> if (isset($_POST['Submit'])) {
> 
>   if (empty($_POST['name1'])) 
>   {
>   echo "Please enter your name!<br>";
>   $named = FALSE;
>   } else
>   {
>    $named = $_POST['name1'];
>   }
>   
>   if (empty($_POST['location'])) 
>   {
>   echo "Please enter your location!<br>";
>   $location = FALSE;
>   } else
>   {
>    $location = $_POST['location'];
>   }
>   
>   if (empty($_POST['address1'])) 
>   {
>   echo "Please enter your first address!<br>";
>   $address1 = FALSE;
>   } else
>   {
>    $address1 = $_POST['address1'];
>   }
> 
> //city
>   if (empty($_POST['city'])) 
>   {
>   echo "Please enter your City!<br>";
>   $city = FALSE;
>   } else
>   {
>    $city = $_POST['city'];
>   }
> 
> //countryID
>   if ($_POST['countryID'] == " ") 
>   {
>   echo "Please select your country!<br>";
>   $country = FALSE;
>   } else
>   {
>    $country = $_POST['countryID'];
>   }
>   
>  //state
>  /* if (empty($_POST['state'])) 
>   {
>   echo "Please enter your City!<br>";
>   $city = FALSE;
>   } else
>   {
>    $city = $_POST['city'];
>   }
>   */
>   
>  //phone
>   if (empty($_POST['phone'])) 
>   {
>   echo "Please enter your phone number!<br>";
>   $phone = FALSE;
>   } else
>   {
>    $phone = $_POST['phone'];
>   }
>   
>   //email
>   if (empty($_POST['email'])) 
>   {
>   echo "Please enter your valid email id!<br>";
>   $email = FALSE;
>   } else
>   {
>    $email = $_POST['email'];
>   }
>   
>     //-----web site------
>   if (empty($_POST['linktosite'])) 
>   {
>   echo "Please enter your valid web site!<br>";
>   $linktosite = FALSE;
>   } else
>   {
>    $linktosite = $_POST['linktosite'];
>   }
>   
>     //------photo-----
>   $uploads = $_FILES['photo']['name'];
>    if ($uploads)
>    {
>      echo "file name is: " . $uploads;
>   $u_path = "./upload/";
>   if
> (!move_uploaded_file($_FILES['photo']['tmp_name'],
> $u_path . $uploads))
> {
> //$file_name_path = $u_path . $uploads;
>  echo "<br>File has not been uploaded";
> } else 
> {
>  echo "<br>File has been uploaded";
> }
> }
> 
> //address2
> $address2 = $_POST['address2'];
> //displaycountry in address
> $displaycountry = $_POST['displaycountry'];
> //stateID
> $stateID = $_POST['stateID'];
> //zip
> $zip = $_POST['zip'];
> //linktomap --> Show Map
> $linktomap = $_POST['linktomap'];
> //map --> map link
> $map = $_POST['map'];
> //phone
> //$phone = $_POST['phone'];
> //email
> //$email = $_POST['email'];
> //web site --> linktosite
> //comments
> $comments = $_POST['comments'];
> //photoalignment
> $photoalignment = $_POST['photoalignment'];
> //picture size --> thumbnailsize
> $thumbnailsize = $_POST['thumbnailsize'];
> //photoborder
> $photoborder = $_POST['photoborder'];
> 
> $updatable_id = $_POST['updatable_id'];
> 
> 
> /////////////sql//////////////////////
> if ($named && $location && $address1 && $city &&
> $country && $phone && $email && $linktosite)
> {
> echo "www";
> ///UPDATE `activity_information` SET
> `ac_info_location` = 'www',
> ///`ac_info_address2` = 'www123' WHERE `ac_info_id`
> =28 LIMIT 1 ;
> 
> 
> 
> $sql_update = "UPDATE activity_information SET
> ac_info_name = '$named', ac_info_location =
> '$location', ac_info_address1 = '$address1',
> ac_info_address2 = '$address2', ac_info_towncity =
> '$city', ac_info_country = '$country',
> ac_info_display_add = '$displaycountry',
> ac_info_state = '$stateID', ac_info_zip = '$zip',
> ac_info_show_map = '$linktomap', ac_info_map_link =
> '$map', ac_info_phone = '$phone', ac_info_email =
> '$email', ac_info_website = '$linktosite',
> ac_info_comments = '$comments', ac_info_picture =
> '$uploads', ac_info_picture_align =
> '$photoalignment', ac_info_picture_size =
> '$thumbnailsize', ac_info_picture_border =
> '$photoborder' where ac_info_id = '$updatable_id'
> limit 1";
> 
> 
> //$sql_insert = "insert into activity_information
> values ('', '$named', '$location', '$address1',
> '$address2', '$city', '$country', '$displaycountry',
> '$stateID', '$zip', '$linktomap', '$map', '$phone',
> '$email', '$linktosite', '$comments', '$uploads',
> '$photoalignment', '$thumbnailsize',
> '$photoborder')";
> 
> $result_update = mysql_query($sql_update);
> if ($result_update) 
> {
> echo "<b>Thing to do updated successfully.</b>";
> include('./local_activities_list.php');
> exit;
> }
> 
> 
> 
> 
> }
> }
> //////////////////problem area ////////////
> /*
> $update_id = $_GET['update_id'];
> 
> if (empty($_GET['update_id']))
> {
> 
=== message truncated ===



		
___________________________________________________________ 
Switch an email account to Yahoo! Mail, you could win FIFA World Cup tickets. http://uk.mail.yahoo.com


PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux