Jump to content

plodos

Members
  • Posts

    212
  • Joined

  • Last visited

Posts posted by plodos

  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. $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 (:)

  7.       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  :confused:

     

    How can I control the file..If there is no file do not control the extensions...

     

    I try $_FILES["file"]["size"] = 0  .... not working

  8. 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?

     

  9. $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?

  10. <?php
    function random_color(){
        mt_srand((double)microtime()*1000000);
        $c = '';
        while(strlen($c)<6){
            $c .= sprintf("%02X", mt_rand(0, 255));
        }
        return $c;
    }
    $color = random_color();
    
    $data = mysql_query("select * from data where country='greece' group by name  ");   
    //ORDER BY id ASC
    
    
    while($info=mysql_fetch_array($data))
    
    {
    Print "                 <p style=\"TEXT-ALIGN: justify\">                        ";
    Print "					<font color=\"".$color."\" face=\"Verdana\"><br>              ";
    Print "					</font><font face=\"Verdana\" style=\"font-size: 7pt\">    ";
    
    Print "					{$info['name']}<br />  ";
    
    Print "					<br>   ";
    Print "					</font>    ";
    Print "					<font face=\"Verdana\" style=\"font-size: 7pt;\" color=\"".$color."\"></font>  ";
    Print "				  </p>         ";
    
    }
    ?>
    

     

    I want to sort data with color group,  each name group  will have same color like

    VGA

    VGA

    VGA

    VGA 

    Cafe

    Cafe

    Cafe

    Cafe

    Purple

    Purple

    but my script is now working  :(

    and if its possible how can I sort datas ORDER BY id ASC with using group by  ???

     

  11. Maybe your database format like date='25-12-2008 18:49:06'  is wrong, you need to enter the date as shown.

    YYYY-MM-DD HH:MM:SS

     

    Could you share your dbase date field with inputs....

    OR

    Could you share your mysql query output like  insert into tableName set date='25-12-2008 18:49:06'

  12. CREATE TABLE IF NOT EXISTS `conference` (
      `id` int(11) NOT NULL auto_increment,
      `year` varchar(10) NOT NULL,
      `mounth` varchar(20) NOT NULL,
      `country` varchar(100) NOT NULL,
      `city` varchar(100) NOT NULL,
      `name` text NOT NULL,
      `sname` varchar(50) NOT NULL COMMENT ,
      `keywords` longtext NOT NULL,
      `cdate` varchar(50) NOT NULL COMMENT ,
      `link` text NOT NULL,
      `rdate` datetime NOT NULL COMMENT ,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=168 ;

     

    I want to make advance search with using PHP.

     

    1) There will be combobox for select conference year

    2) After user will select month

    3) maybe user will select onyl city, than user willl see the conferecences which are related with this city

    4) or user can only search with keywords to see the related conferences

     

    there are the conditions...

     

    Could you give me an idea or sample code.

     

    Thanks for everything.

  13. .sql

    CREATE TABLE IF NOT EXISTS `conference` (
      `id` int(11) NOT NULL auto_increment,
      `year` varchar(10) NOT NULL,
      `mounth` varchar(20) NOT NULL,
      `country` varchar(100) NOT NULL,
      `city` varchar(100) NOT NULL,
      `name` text NOT NULL,
      `sname` varchar(50) NOT NULL COMMENT 
      `content` longtext NOT NULL,
      `cdate` varchar(50) NOT NULL COMMENT 
      `link` text NOT NULL,
      `rdate` datetime NOT NULL COMMENT 
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;

     

    i will keep 1300-2000 characters inside of the `content` longtext NOT NULL,

     

    I used "longtext" is it enought or not....Also system will have a search engine to search content

     

    Is it good design or not??

     

    Thank you

  14. I coundt solve it.....what is wrong in <guid> section ?

     

    <?php
    echo "
    <item>
    <title><![CDATA[ ".stripslashes($opstr['name'])." ]]> </title>
    <description>".$opstr['city']."</description>
    
    <guid><http://www.w3.org/2005/Atom> Atom"     rel=\"self\"     href= ".$opstr['link']."      type=\"application/rss+xml\" /> </guid>
        
    <pubDate>".$date."</pubDate>
    </item>";
    }
    ?>

    error: missing atom:link with rel="self" is not erally an error, but recommendation.

     

    My problem is that I have NO IDEA of how to "edit" my RSS feed with <guid>. Can anyone tell me how I locate my RSS feed and what I can use to edit the feed???

×
×
  • 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.