
techrahul87
Members-
Posts
16 -
Joined
-
Last visited
Never
Everything posted by techrahul87
-
fetch id of first table store it in any variable and then insert this variable in your second table...........is this you want to do....
-
yes it is upload.php..try it on server......i was getting error.........
-
hello i am uploading a file in a folder. the code is working fine on localhost. but oon server it is generating error. Parse error: syntax error, unexpected '}' in /home/content/v/i/b/vibescom/html/temp_dir/upload.php on line 1 here is the code <html> <head></head> <body> <?php if ($_SERVER['REQUEST_METHOD'] == "POST") { $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } else { ?> <form enctype="multipart/form-data" action="upload.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> <?php } ?> </body> </html> please help me out
-
mail function using too musch time to deliever mail
techrahul87 replied to techrahul87's topic in PHP Coding Help
:)thanks for explaining i'll try your code........... -
mail function using too musch time to deliever mail
techrahul87 replied to techrahul87's topic in PHP Coding Help
actually i m just 1 week experienced in php . i was asked for a php page which sends mail for 5 html pages. so i picked a code from internet and try to implement that page by sending hidden fields from all html pages... //to get values from enquiry.html to send mail if(!empty($_POST["enquiryhidden"])) { $site_admin=$_POST["mailto"]; // to whom mail has to be sent $name=$_POST["name"]; // name from user $Email=$_POST["email"]; // email of user $phone=$_POST["telephone"]; //user entries $mobile=$_POST["mobile"]; //user entries $address=$_POST["address"]; //user entries //$sub=$_POST["subject"]; $sub="enquiry from:".$name."through http://www.jaibharatsteel.com"; //subject of the mail $mes=$_POST["comment"]; //message $from = $name.' <'.$Email.'>'; $project=$_POST["project"]; //user entry //$data="mobile no: ".$mobile."\n"."phone no: ".$phone ."\n"."Address :".$address."\n"."Project :".$project."\n"."\n".$mes; // message body $data="dear sir/mam"."\n"."\t". "you have new enquiry through your website."."\n"."\n". "\t".$mes."\n"."information of sender"."\n"."\n". "mobile no: ".$mobile."\n". "phone no: ".$phone ."\n". "Address :".$address."\n". "Project :".$project; ae_send_mail($from, $site_admin, $sub, $data, // function calling array('X-Mailer'=>'PHP script at '.$_SERVER['HTTP_HOST'])); } //to get values from contactus.html to send mail if(!empty($_POST["contacthidden"])) { $site_admin=$_POST["mailto"]; $mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x"; $name=$_POST["contact"]; $Email=$_POST["email"]; $phone=$_POST["telephone"]; $mobile=$_POST["mobile"]; $address=$_POST["address"]; //$sub=$_POST["subject"]; $sub="contact from: ".$name."through http://www.jaibharatsteel.com"; $mes=$_POST["comment"]; $from = $name.' <'.$Email.'>'; //$data="mobile no: ".$mobile."\n". //"phone no: ".$phone."\n" //."Address :".$address."\n" //.$mes; $data= "dear sir/mam"."\n"."\n"."\t" "you have queries comments and reqirments from your web site"."\n"."\t".$mes."\n" "the basic information of sender is shown as:"."\n". "phone no:".$phone."\n" ."Address :".$address."\n"; ae_send_mail($from, $site_admin, $sub, $data, // function calling array('X-Mailer'=>'PHP script at '.$_SERVER['HTTP_HOST'])); } function ae_send_mail($from, $to, $subject, $text, $headers="") { if (strtolower(substr(PHP_OS, 0, 3)) === 'win') $mail_sep = "\r\n"; else $mail_sep = "\n"; function _rsc($s) { $s = str_replace("\n", '', $s); $s = str_replace("\r", '', $s); return $s; } $h = ''; if (is_array($headers)) { foreach($headers as $k=>$v) $h = _rsc($k).': '._rsc($v).$mail_sep; if ($h != '') { $h = substr($h, 0, strlen($h) - strlen($mail_sep)); $h = $mail_sep.$h; } } $from = _rsc($from); $to = _rsc($to); $subject = _rsc($subject); $val= mail($to, $subject, $text, 'From: '.$from.$h); if($val) { echo "your mail has been sent"; } else { echo "oops! try again"; } } now i dont have much idea about that user defined function ( ae_send_mail) i just got it from the internet.....there was written that it will improve secuirity....code is working fine for both pages.....but i m not sure of this code. comments please................... :'( -
mail function using too musch time to deliever mail
techrahul87 replied to techrahul87's topic in PHP Coding Help
thanks for the info......... -
hello everyone, i had used mail function in php. i was sending mail from my local host but in that case some errors were generated. then i tried it from server. now mail function is working properly but it is taking about 2 or 3 horus to to reach the inbox. is this a normal time.
-
how to access php code by html events.
techrahul87 replied to techrahul87's topic in PHP Coding Help
thanks for that ajax thing now i m getting wts going on........... -
hello everyone, I had done my internship in ASP.NET and sql server but i got a job in php/mysql. I have to learn php by my own. so i have to search through internet and that is how i got here and got registered i had cleared many doubts here alredy. great to be here
-
how to access php code by html events.
techrahul87 replied to techrahul87's topic in PHP Coding Help
hi, isn,t there any other way for it. like in c# we can make different functions for events by adding simply runat="server". and calling them. now i m getting really confused. please give an explanation....... :confused: -
hi everyone, i m new to php. all the coding I did in php is only on form submit. e.g if there is many buttons in one form and we have to perform different tasks. how will we do this in php. thanks for helping
-
ok then i will use hidden fields.........thanks
-
i have many html forms like enquiry, contact us, career form in which mail is being sent. i had created a sendmail php file in which I want to get values from all the forms. now how i acccess the form because forms name cant be used. should i use a hidden field. is there any other way........... please suggest me some thing........
-
Parse error: syntax error, unexpected T_FUNCTION
techrahul87 replied to techrahul87's topic in PHP Coding Help
THANKS FOR HELPING ME OUT............. THANK U VERY MUCH -
HI everyone, i m new to php. the code was working fine but when i include d.inc it is generating a error. Parse error: syntax error, unexpected T_FUNCTION in every page of my application. here is the sample of code from one page.......... <?php include(db.inc) if(isset($_REQUEST['submit'])) { $user=$_POST["txtuser"]; $pass=$_POST["txtpassword"]; $res = 0; $con=mysql_connect($host1,$username1,$password1) or die(mysql_error()); mysql_select_db($database1,$con) or die(mysql_error()); $sql="select count(1) as c from userdata where username='".$user."' and password='".$pass."' and status=1 and now() < expireon"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $res = $row['c']; } if($res > 0) { session_start(); $_SESSION['user'] = $user; $_SESSION['pass'] = $pass; header("Location:main.php"); } else { echo "Your username/password is either wrong or expired"; } mysql_close($con); } error is generating on line where if is used. thanks in advance