Jump to content

plodos

Members
  • Posts

    212
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

plodos's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hello I have a webform like below input name="fileatt" type="file" id="fileatt" size="60" form name="form" method="POST" enctype="multipart/form-data" onsubmit="return checkCheckBoxes();" action="sendX.php" sendX.php require("class.phpmailer.php"); $theFileName = $HTTP_POST_FILES['fileatt']['name']; $mail = new PHPMailer(true); $mail->IsSMTP(); $mail->Host = "88.35.11.87"; $mail->SMTPAuth = true; $mail->Username = "info@xxx.org"; $mail->Password = "xxx"; $mail->From = "info@xxx.org"; $mail->FromName = $aut_email; $mail->CharSet = "utf-8"; $mail->IsHTML(true); $mail->AddAttachment($_FILES['fileatt']['tmp_name'],$theFileName); $mail->AddAddress("info@xxx.org","xxx- Info"); $mail->AddReplyTo($aut_email,$name); $mail->Subject = '.$msg_title; $mail->Body = $message; $mail->MsgHTML($message); I attached WORK.DOC file When I check the email, attached file is damaged and The new attachment name like Aasdjkaskdaj Email is working. Only attachment part is problem. What can be the problem ? Thanks for your help.
  2. mail addAttachment(fileatt) is not working ? How can I get the file from the online form ? FORM <form name="form" method="POST" enctype="multipart/form-data" action="sendauthorX.php"> <tr> <td width="175">Attach Your File</td> <td>Acceptable file types (.zip,.rar)<p><input name="fileatt" type="file" id="fileatt" size="60"></td> </tr> <td><input type="submit" value="Send!"></td> </form> sendauthorX.php
  3. <? $link = mysql_connect($dbhost,$dbuser,$dbpass) or die ('Could not connect: ' . mysql_error()); mysql_select_db($dbname) or die ('Error connecting to database'); $sql = "SELECT * FROM papers WHERE ctitle='May 2012'"; $result = mysql_query($sql); $num = mysql_num_rows($result); //number of entry $data = mysql_query("select * from papers where ctitle='May 2012' ORDER BY id ASC"); $Wrd = new COM("Word.Application"); $Wrd->Application->Visible = False; $DocName = "MyDoc/MyWord.doc"; $WrdDoc = $Wrd->Documents->Add(); $WTable = $WrdDoc->Tables->Add($Wrd->Selection->Range, 2, $num); // Colums, Rows while($info=mysql_fetch_array($data)) { $i=1; $WTable->Cell($i,1)->Range->Text = $info['title']; $WTable->Cell($i,2)->Range->Text = $info['name'] $info['surname'] $info['institution'] $info['country']; $i++; } $Wrd->ActiveDocument->SaveAs(realpath($DocName)); $Wrd->Application->Quit; $Wrd = null; ?> Word Created <a href="<?=$DocName?>">Click here</a> to Download. php script is not working. Can someone please help me to detect the errors? i want create a table in ms word file for all entry in my database... "2 columns, number of rows" Cell(1,1) Cell(1,2) Cell(2,1) Cell(2,2) etc... Cell(3,1) Cell(3,2)
  4. I have lost my record when I run the code below, all fields are empty... <a href='edit.php?id={$info['person_id']}'><font color='#00AE0A'>Edit User</font> </a> $sql = "SELECT * FROM person WHERE person_id='{$_REQUEST['id']}' "; $result = mysql_query($sql); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } if ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { print " <form action='<?php echo $PHP_SELF;?>' method=\"post\"> <table> <tr> <td><strong>Name</strong></td> <td><input type=\"text\" name=\"fname\" size=\"60\" value=\"$row[fname]\"></td> </tr> <tr> <td><strong>Surname</strong></td> <td><input type=\"text\" name=\"lname\" size=\"60\" value=\"$row[lname]\"></td> </tr> <tr> <td><strong>Email</strong></td> <td><input type=\"text\" name=\"email\" size=\"60\" value=\"$row[email]\"></td> </tr> <tr> <td><strong>Committee</strong></td> <td><input type=\"text\" name=\"committee_no\" size=\"60\" value=\"$row[committee_no]\"></td> </tr> <tr> <td><INPUT type=\"submit\" value=\"Send\"> </td> </tr> </table></form> "; } else { echo("There has been an error" . mysql_error()); } /* closes connection */ ?> <?php $control = mysql_query(" UPDATE person SET fname='{$_REQUEST['fname']}' , lname='{$_REQUEST['lname']}' , email='{$_REQUEST['email']}', committee_no='{$_REQUEST['committee_no']}' WHERE person_id='{$_REQUEST['id']}'"); if($control) { header("Location:".$_SERVER["HTTP_REFERER"].""); } ?>
  5. Java Script does not work.. What can be the problem ? <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1254"> <title>New Page 1</title> <STYLE TYPE="text/css"> <!-- input{ display:none; } span { display:none; } --> </STYLE> <script type="text/javascript"> <!-- $(function() { $('#sel').change(function() { $("input").hide().filter("." + $(this).find("option:selected").val()).show(); }); $("input").focus(function() { $(this).next("span").fadeIn(1000); }).blur(function() { $(this).next("span").fadeOut(1000); }); }); --> </script> </head> <body> <form> <select id="sel"> <option value="">- select -</option> <option value="option1">Option 1</option> <option value="option2">Option 2</option> <option value="option3">Option 3</option> <option value="option4">Option 4</option> <option value="other">Other</option> </select> <input type="text" class="option1" /><span>Textbox label 1</span> <input type="text" class="option2" /><span>Textbox label 2</span> <input type="text" class="option2" /><span>Textbox label 2</span> <input type="text" class="option2" /><span>Textbox label 2</span> <input type="text" class="option3" /><span>Textbox label 3</span> <input type="text" class="option3" /><span>Textbox label 3</span> <input type="text" class="option4" /><span>Textbox label 4</span> <input type="text" class="other" /><span>Other</span> </form> </body> </html>
  6. $str =explode(':',$cTitle); $str1= $str[0]; echo str1
  7. my server PHP Version is 5.2.17... does not support true/false 3. variable... anyway how can I get before : from the sentence ?
  8. $pdf->Write(5, "Title {$inv['cTitle']}, {strstr($inv['cTitle'], ':', true);}"); Code gives an error... How can I use this function correctly {strstr($inv['cTitle'], ':', true); example: cTitle = Robert 20078956 : HOT TEA strstr(cTitle) = Robert 20078956 I want to get before colon (
  9. echo " <form method='POST' enctype='multipart/form-data'> <textarea name='note' cols='50' rows='10'></textarea><br /> <input type='file' name='fileDos'> <input type='submit' name='action' value='Save'> </form>"; if(isset($_FILES['fileDos'])) { $FILE_EXTS = array('.pdf','.doc','.docx','.ps','.odt','.ppt','.pptx','.txt','.jpg','.png'); $file_name = $_FILES['fileDos']['name']; $file_ext = strtolower(substr($file_name,strrpos($file_name,"."))); if (!in_array($file_ext, $FILE_EXTS)){ echo "<script language=javascript>"; echo "alert('Only ".implode(', ', $FILE_EXTS)." accepted.');"; echo "</script>"; echo "<script language=javascript>"; echo " window.location='http://".$_SERVER['SERVER_NAME']."/subject.php?id=$subject'; "; echo "</script>"; exit(); } } When I write something without upload documents...That gives an error like Only pdf','.doc','.docx','.ps','.odt','.ppt','.pptx','.txt','.jpg','.png' accepted... But I did not upload anything How can I control the file..If there is no file do not control the extensions... I try $_FILES["file"]["size"] = 0 .... not working
  10. i have old links like http://www.xxxxx.com/1-2-3-4-5.pdf but the new links is http://www.xxxxx.com/pdf/numbers.pdf OR http://www.xxxxx.com/vw.html but the new links http://www.xxxxx.com/cars/vw/vw.php when user click the old links from the google or other forums...link does not working Not Found The requested URL /1-2-3-4-5.pdf was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. old link is not working....how can i re-direct old link to new link?
  11. <?php session_start(); if ($_SESSION['loggedIn'] != 'admin') { //check the registered user, if not go index.php if(!$_SESSION['id']) { header("location:index.php"); die(); } else { echo " <script language='JavaScript'>history.go(-1);</script>"; } } ?>
  12. check it : http://www.phpfreaks.com/forums/index.php?topic=256139.0
  13. Thanks for urgent reply. I have 2 makeFile.php files, I mixed the files....now I uploaded the new version, Code is working...
  14. $city = trim($_POST['city']); $name = trim($_POST['name']); $c = strtolower($city); $n = strtolower($name); $mypath="sweet/$c/$n"; mkdir($mypath,0777,TRUE); $myfile = "sweet/$c/$n/index.html"; $fh = fopen($myfile, 'w') or die("Problem!"); $data= ' <html>'; fwrite($fh, $data); fclose($fh); Warning: fopen(pages/index.html) [function.fopen]: failed to open stream: No such file or directory in /home6/uni/public_html/makeFile.php on line 26 Problem! What is the Problem?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.