0


This codes are not working here and i cant find out why is that can you help me on this

(here i gave the database also problem is not in DB)

CREATE TABLE `itinerary` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(1000) NOT NULL,
  `name` varchar(1000) NOT NULL,
  `days` varchar(10) NOT NULL,
  `introduction` longtext NOT NULL,
  `holiday_highlights` mediumtext NOT NULL,
  `deatils` longtext NOT NULL,
  `pic1` varchar(1000) NOT NULL,
  `pic2` varchar(1000) NOT NULL,
  `pic3` varchar(1000) NOT NULL,
  `pic4` varchar(1000) NOT NULL,
  `pic5` varchar(1000) NOT NULL,
  `pic6` varchar(1000) NOT NULL,
  `map` varchar(1000) NOT NULL,
  `pre_accom` varchar(1000) NOT NULL,
  PRIMARY KEY (`id`)
)
<?php
include ("../../init/db.php");
$type =$_POST['type'];
$name =$_POST['name'];
$days = $_POST['days'];
$introduction = $_POST['introduction'];
$holiday_highlights = $_POST['holidayh'];
echo $deatils1 =$_POST["itadetails"]; 
echo strlen($deatils);
$pre_accom = $_POST['pre_accom'];





mkdir('../../itinerary/'.$name, 0777); 

$destination_path = '../../itinerary/'.$name.'/';

 	
    	$lmap= $name.basename( $_FILES['map']['name']);
		$img1= $name.basename( $_FILES['img1']['name']);
		$img2= $name.basename( $_FILES['img2']['name']);
		$img3= $name.basename( $_FILES['img3']['name']);
		$img4= $name.basename( $_FILES['img4']['name']);
		$img5= $name.basename( $_FILES['img5']['name']);
	    $img6= $name.basename( $_FILES['img6']['name']);
	
	
	
		
   
		$target_path_lmap = $destination_path . $lmap;		
		$target_path_img1 = $destination_path .$img1;
		$target_path_img2 = $destination_path .$img2;
		$target_path_img3 = $destination_path .$img3;
		$target_path_img4 = $destination_path .$img4;
		$target_path_img5 = $destination_path .$img5;
		$target_path_img6 = $destination_path .$img6;
	
	
	
		
		
	
	
   if(@move_uploaded_file($_FILES['banner']['tmp_name'], $target_path_banner) 
		&&										
	  @move_uploaded_file($_FILES['lmap']['tmp_name'], $target_path_lmap)&&
	  @move_uploaded_file($_FILES['img1']['tmp_name'], $target_path_img1)&&
	  @move_uploaded_file($_FILES['img2']['tmp_name'], $target_path_img2)&&
	  @move_uploaded_file($_FILES['img3']['tmp_name'], $target_path_img3)&&
	  @move_uploaded_file($_FILES['img4']['tmp_name'],$target_path_img4)&&
	  @move_uploaded_file($_FILES['img5']['tmp_name'], $target_path_img5)&&
	  @move_uploaded_file($_FILES['img6']['tmp_name'], $target_path_img6)
	  		  
	  ) 
   {  

		$resultw = $name." Uploading Success";
	  
  	 }else{
		 
		 $resultw = "not success";
		 }
		 
		 
		
		 
		  


   
		$path_lmap = 'hotels/'.$name.'/' . $lmap;
		
		$path_img1 = 'hotels/'.$name .'/'.$img1;
		$path_img2 = 'hotels/'.$name.'/'.$img2;
		$path_img3 = 'hotels/'.$name .'/'.$img3;
		$path_img4 = 'hotels/'.$name .'/'.$img4;
		$path_img5 = 'hotels/'.$name .'/'.$img5;
		$path_img6 = 'hotels/'.$name.'/'.$img6;
$sql="
INSERT INTO `helikro`.`itinerary` (
`id` ,
`type` ,
`name` ,
`days` ,
`introduction` ,
`holiday_highlights` ,
`deatils` ,
`pic1` ,
`pic2` ,
`pic3` ,
`pic4` ,
`pic5` ,
`pic6` ,
`map` ,
`pre_accom`
)
VALUES (
NULL , '$type',
'$name',
'$days',
'$introduction',
'$holiday_highlights',
'$deatils',
'$path_img1',
'$path_img1',
'$path_img1',
'$path_img1',
'$path_img1',
'$path_img1',
'$path_lmap',
'$pre_accom'
);




";


$result=mysql_query($sql);


?>
2
Contributors
7
Replies
8
Views
6 Years
Discussion Span
Last Post by sunwebsite
0

I thing the problem with you is connecting with data base.
make sure mysql connection with data base is correct.

and use

mysql_select_db('helikro')

and use

INSERT INTO `itinerary` ()

instead of

INSERT INTO `helikro`.`itinerary` ()
0

I thing the problem with you is connecting with data base.
make sure mysql connection with data base is correct.

and use

mysql_select_db('helikro')

and use

INSERT INTO `itinerary` ()

instead of

INSERT INTO `helikro`.`itinerary` ()

Not working friend

i think their is problem with line 8
if i use

echo $deatils =$_POST["itadetails"];

instead of

echo $deatils ="Text here ";

then the codes are working fine

0

I don't know what problem you are getting.
It works fine for me.

If your problem is on line

echo $deatils ="Text here ";

then try this once

$deatils = isset($_POST["itadetails"]) : $_POST["itadetails"] : '';

also check db.php is in correct path in line

include ("../init/db.php");

Also tell me is it not inserting into db?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.