Jump to content

zohab

Members
  • Posts

    223
  • Joined

  • Last visited

Posts posted by zohab

  1. Hi,

     

    My client want to update existing CMS and add new features in CMS.

     

    Currently I do not have source code with me.

     

    I find out using file extension it is PHP CMS.

     

    All urls on website are showing .html instead .php for SEO friendly feature.

     

    My question is how to find which CMS is used using view source in browser or URLS or any other way.

     

    - Thanks

    Zohaib.

  2. hi,

     

    sorry I got to update in last post code.

     

    the problem still exists

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <script language="javascript" type="text/javascript">
    function focusMe(id)
    {
    
    document.getElementById(id).focus();
    
    }
    </script>
    </head>
    
    <body>
    <ul>
     <li><a href="#" id="1" onclick="javascript:focusMe('1');">menu1</a></li>
     <li><a href="#" id="2" onclick="javascript:focusMe('2');">menu2</a></li>
     <li><a href="#" id="3" onclick="javascript:focusMe('3');">memnu3</a></li>
     <li><a href="#" id="4" onclick="javascript:focusMe('4');">menu4</a></li>
     <li><a href="#" id="5" onclick="javascript:focusMe('5');">menu5</a></li>
     <li><a href="#" id="6" onclick="javascript:focusMe('6');">menu6</a></li>
     <li><a href="#" id="7" onclick="javascript:focusMe('7');">menu7</a></li>
     <li><a href="#" id="8" onclick="javascript:focusMe('8');">menu8</a></li>
     <li><a href="#" id="9" onclick="javascript:focusMe('9');">menu9</a></li>
     <li><a href="#" id="10" onclick="javascript:focusMe('10');">menu10</a></li>
     <li><a href="#" id="11" onclick="javascript:focusMe('11');">menu11</a></li>
     <li><a href="#" id="12" onclick="javascript:focusMe('12');">menu12</a></li>
     <li><a href="#" id="13" onclick="javascript:focusMe('13');">menu13</a></li>
     <li><a href="#" id="14" onclick="javascript:focusMe('14');">menu14</a></li>
     <li><a href="#" id="15" onclick="javascript:focusMe('15');">menu15</a></li>
    
    </ul>
    
    </body>
    </html>

     

    - Thanks

    Zohaib

  3. Hi,

     

    In my project I am calling ul and li data in Iframe and when I click on link then it move fucus on top instead of selected item.

     

    Following is the example of the problem.

     

    testFrame.htm

     

     

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Tree Frame</title>
    </head>
    <body>
    <table width="50%" border="0">
    <tr id="frameRow">
    <td>
    <iframe id="treeFrame" src="treeFrame2.htm" width="50%" height="100%" scrolling="yes" frameborder="0">
    </iframe>
    <td>
    </tr>
    </table>
    </body>
    </html>

     

    testFrame2.htm

     

    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Test Frame2</title>
    <script language="javascript" type="text/javascript">
    function focusMe(id)
    {
    documentBygetelementsbyid(id).focus();
    
    }
    </script>
    </head>
    
    <body>
    <ul>
    <li><a href="#" id="1" onclick="javascript:focusMe('1');">menu1</a></li>
    <li><a href="#" id="2" onclick="javascript:focusMe('2');">menu2</a></li>
    <li><a href="#" id="3" onclick="javascript:focusMe('3');">memnu3</a></li>
    <li><a href="#" id="4" onclick="javascript:focusMe('4');">menu4</a></li>
    <li><a href="#" id="5" onclick="javascript:focusMe('5');">menu5</a></li>
    <li><a href="#" id="6" onclick="javascript:focusMe('6');">menu6</a></li>
    <li><a href="#" id="7" onclick="javascript:focusMe('7');">menu7</a></li>
    <li><a href="#" id="8" onclick="javascript:focusMe('8');">menu8</a></li>
    <li><a href="#" id="9" onclick="javascript:focusMe('9');">menu9</a></li>
    <li><a href="#" id="10" onclick="javascript:focusMe('10');">menu10</a></li>
    <li><a href="#" id="11" onclick="javascript:focusMe('11');">menu11</a></li>
    <li><a href="#" id="12" onclick="javascript:focusMe('12');">menu12</a></li>
    <li><a href="#" id="13" onclick="javascript:focusMe('13');">menu13</a></li>
    <li><a href="#" id="14" onclick="javascript:focusMe('14');">menu14</a></li>
    <li><a href="#" id="15" onclick="javascript:focusMe('15');">menu15</a></li>
    
    </ul>
    </body>
    </html>
    
    

     

     

    Any solution?

     

     

     

    - Thanks

    Zohaib.

  4. Hi,

     

    I am developing pagination in JSP.

     

    I want to get number of records return by query.

     

    In PHP we have function mysql_num_rows which give count of rows return by query.

     

    Any idea how to get number of rows in JSP.

     

    PreparedStatement stat= conn.prepareStatement("SELECT AC_ID, AC_NAME, AC_PHOTO , AC_DESCRIPTION FROM AC_IMAGE_GALLERY ");
    rs = stat.executeQuery();
    nume = 11;
    //$nume=mysql_num_rows($sqlResAll);
    
    PreparedStatement stat2= conn.prepareStatement("SELECT AC_ID, AC_NAME, AC_PHOTO , AC_DESCRIPTION FROM AC_IMAGE_GALLERY WHERE ROWNUM >"+eu+" AND ROWNUM <"+limit+"");
    rs2 = stat2.executeQuery();
    num_rows = 10;
    //$num_rows = mysql_num_rows($result);

     

    - Thanks

    Zohaib.

  5. Hi,

     

    I have added background image blueGradient.png to tr.

     

    It is not showing as expected.

     

    attached image.

     

    I want to show background image properly and need help in this.

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>background Image</title>
    </head>
    
    <body>
    <table width="100%" border="1">
    <tr style=" background-color:#00FFFF; background-image:url(blueGradient.png); background-repeat:repeat;">
    <td colspan="2" align="center">Title</td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    </tr>
    </table>
    
    </body>
    </html>
    
    

     

    -Thanks

    Zohaib.

    post-40479-0-82134000-1353353780_thumb.png

  6. Hi,

     

    I got it working but I want to use 1 SQL statement instead of 2.

     

     

    <?php
    
    error_reporting(0);
    mysql_connect("localhost", "username", "password");
    mysql_select_db("headermenu");
    
    $sql="SELECT ID,PARENTID,TITLE,HAS_CHILD FROM headermenu ORDER BY ID";
    $result = mysql_query($sql);
    $str = "";
    
    while ($row = mysql_fetch_assoc($result)) 
    {
    $id =  $row["ID"];
    $parentid =  $row["PARENTID"];
    $title =  $row["TITLE"];
    $has_child =  $row["HAS_CHILD"];
    $parentid;
    
    if($parentid == -1)
    {
    if($has_child==0)
    {
    $str .= "<li><a href='#'>$title</a></li>";
    }
    if($has_child==1)
    {
    $str .= "<li><a href='#'>$title</a>";
    $str .= "<ul>";
    $sql2="SELECT TITLE FROM headermenu WHERE PARENTID=$id ORDER BY ID ";
    $result2 = mysql_query($sql2);
    while ($row2 = mysql_fetch_assoc($result2)) 
    {
    $title2 =  $row2["TITLE"];
    $str .= "<li><a href='#'>$title2</a></li>";
    }
    $str .= "</ul>";
    $str .= "</li>";
    }
    }
    }
    
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="all" />
    <title>jQuery Mega Drop Down Menu Plugin Sample Styling</title>
    <link href="custom_mega_menu_styles/css/dcmegamenu.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type='text/javascript' src='custom_mega_menu_styles/js/jquery.hoverIntent.minified.js'></script>
    <script type='text/javascript' src='custom_mega_menu_styles/js/jquery.dcmegamenu.1.2.js'></script>
    <script type="text/javascript">
    $(document).ready(function($){
    $('#mega-menu-tut').dcMegaMenu({
    rowItems: '3',
    speed: 'fast'
    });
    });
    </script>
    <link href="custom_mega_menu_styles/menu.css" rel="stylesheet" type="text/css" />
    <style>
    /* Demo Styles */
    .wrap {width: 960px; margin: 0 auto;}
    </style>
    </head>
    <body>
    <div class="wrap">
    
    <div class="dcjq-mega-menu">
    
    <ul id="mega-menu-tut" class="menu">
    <!--
    <li><a href="#">Home</a></li>
    <li><a href="#">About Us</a>
     <ul>
    <li><a href="#">Menu Item 1</a></li>
    <li><a href="#">Menu Item 2</a></li>
     </ul>
    </li>
    <li><a href="#">Services</a></li>
    <li><a href="#">Contact us</a></li>
    -->
    <?php echo $str; ?>
    </ul>
    
    </div>
    <div style="height: 350px;"></div>
    </body>
    </html>
    
    

     

    /*Table structure for table `headermenu` */
    
    DROP TABLE IF EXISTS `headermenu`;
    
    CREATE TABLE `headermenu` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `PARENTID` int(11) DEFAULT NULL,
     `title` varchar(255) DEFAULT NULL,
     `HAS_CHILD` int(11) DEFAULT NULL,
     PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
    
    /*Data for the table `headermenu` */
    
    insert  into `headermenu`(`id`,`PARENTID`,`title`,`HAS_CHILD`) values (1,-1,'Home',0),(2,-1,'Menu2',1),(3,2,'Menu2 Child1',0),(4,2,'Menu2 Child2',0),(5,2,'Menu2 Child3',0),(6,2,'Menu2 Child4',0);
    
    

     

     

    Any way to get same result using 1 sql statement.

     

    - Thanks

    Zohaib.

    headermenu.zip

  7. Hi,

     

    I am creating menu using jquery-mega-drop-down-menu-plugin.

     

    I am stroing menu items in database and want to create html sturcture dynamically by looping over resultset

     

    I have attached working example.

     

    Following html need to create dynamically.

    <li><a href="#">Home</a></li>
    <li><a href="#">About Us</a>
     <ul>
         <li><a href="#">Menu Item 1</a></li>
         <li><a href="#">Menu Item 2</a></li>
     </ul>
    </li>
    <li><a href="#">Services</a></li>
    <li><a href="#">Contact us</a></li>
    

    Database Table for menu items as follow

    CREATE TABLE `headermenu` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `text` varchar(300) DEFAULT NULL,
     `parentid` int(11) DEFAULT NULL,
     PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1
    

    Any solution?

     

    Thanks for time and efforts in advance.

     

    - Thanks

    Zohaib.

    menu.zip

  8. Hi,

     

    I have created tree using JSON data and JQWidgets.

     

    JQWidgets do not provide support for Right to left direction therefore I have develop tree from right to left using css change (jsontree.css)

     

    I am problem related moving root node when Expand All and Collapse All.

     

    Root node move position when tree collapse or expand.

     

    I have attached source code zip file.

     

    I want to tree to be fixed when expand or collapse any node of the tree.

     

    Any help will be appriciated.

     

    - Thanks

    Zohaib.

    demo.zip

  9. I am able to make ajax request and perform operations using following code.

     

    I want to do same with JQuery and I need example to do make Ajax Call and perform operations using JQuery.

     

    index.php

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]"> 
    <html xmlns="[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Multiple Response in Ajax</title> 
    
    <script> 
    var xmlhttp; 
    
    function getDetails() 
    { 
      xmlhttp=GetXmlHttpObject(); 
      if (xmlhttp==null) 
      { 
    	    alert ("Your browser does not support Ajax HTTP"); 
    	    return; 
      } 
      var url="getDetails.php"; 
      xmlhttp.onreadystatechange=getOutput; 
      xmlhttp.open("GET",url,true); 
      //xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
      //xmlhttp.setRequestHeader("Content-Type", "text/html;charset=UTF-8"); 
      xmlhttp.send(null); 
    } 
    function getOutput() 
    { 
      if (xmlhttp.readyState==4) 
      { 
    	    alert(xmlhttp.responseText); 
    	    //document.frmMultipleResponse.txtNo.value = xmlhttp.responseText; 
    	    //document.frmMultipleResponse.txtName.value = xmlhttp.responseText; 
    	    return; 
      } 
    } 
    function GetXmlHttpObject() 
    { 
      if (window.XMLHttpRequest) 
      {  
         return new XMLHttpRequest(); 
      } 
      if (window.ActiveXObject) 
      { 
        return new ActiveXObject("Microsoft.XMLHTTP"); 
      } 
      return null; 
    }	
    </script> 
    
    </head> 
    <body> 
    
    <form action="" method="post" name="frmMultipleResponse"> 
    <table width="100%" border="1"> 
     <tr> 
      <td> </td> 
      <td><input type="text" name="txtName" id="txtName" value="" /></td> 
     </tr> 
     <tr> 
      <td> </td> 
      <td><input type="text" name="txtNo" id="txtNo" value="" /></td> 
     </tr> 
     <tr> 
      <td> </td> 
      <td><a href="#" onclick="getDetails();">Get Details</a></td> 
     </tr> 
    </table> 
    </form> 
    
    

    getDetails.php

     

    <?php 
    
      echo "Name"; 
    
    ?>
    

     

    - Thanks

    Zohaib

  10. Hi,

     

    I want to write stored procedure with one select query and 3 update queries.

     

    I want to fetch 2 columns from first select query and use them in next 3 update queries.

     

    Following is the procedure body.

     

    PROCEDURE CHANGEORDER_TABLENAME(
    P_ID NUMBER,
    P_OLD_PARENT NUMBER,
    P_DEST_PARENT NUMBER,
    P_DEST_POSITION NUMBER
    , RC1 OUT RCT) AS
    BEGIN
    OPEN RC1 FOR
    SELECT TABLENAME_POSITION,TABLENAME_PARENT FROM AC_TABLENAME;
    /*
    SELECT TABLENAME_PARENT, TABLENAME_POSITION FROM AC_TABLENAME WHERE TABLENAME_ID = P_ID
    UPDATE AC_TABLENAME SET TABLENAME_POSITION = TABLENAME_POSITION - 1 WHERE TABLENAME_POSITION > TABLENAME_POSITION AND TABLENAME_PARENT = TABLENAME_PARENT
    UPDATE AC_TABLENAME SET TABLENAME_POSITION = TABLENAME_POSITION + 1 WHERE TABLENAME_POSITION => P_DESTPOSITION AND TABLENAME_PARENT = P_DESTPARENT
    UPDATE AC_TABLENAME SET TABLENAME_POSITION = P_DESTPOSITION WHERE TABLENAME_PARENT => P_DESTPARENT AND ID = P_ID
    */
    END;
    

     

    - Thanks

    Zohaib.

  11. Hi ,

     

    I am using frameset with 2 frames in left and right side of the page.

     

    I have form in right side frame and when I submit the right side frame then I want only right side frame should be refresh not whole page.

     

    I tried following but not working for me.

    index.jsp

     

    <FRAMESET COLS="17%,80%">

    <FRAME SRC="treemenu.jsp" name="treemenu" id="treemenu">

    <FRAME SRC="treeOperations.jsp" name="treeoperations" id="treeoperations"> </FRAMESET><noframes></noframes>

     

    treeOperations.jsp

     

    //alert("The operation was successfully.");

    //top.location.href="index.jsp";

    window.location.href="treeOperations.jsp";

    //window.treeoperations.location.reload();

    //parent.treeoperations.location.reload();

    //parent.location.reload();

     

     

    Any solution ?

     

    -Thanks

    Zohaib.

  12. I did this using JSP and Oracle Database easily. Also I have solution for same in .NET

     

    I understand that people suggest storing video in mysql database in not good idea

     

    But this is the first time in years of experience I found storing video using PHP and MySQL getting difficult for expert in forum also.

     

    I have seen many .NET and J2EE applications where video files stored in database.

     

    I appreciate people coming to this post and trying to post solution and I want to say thank for their time. :)

     

    I am actually not able to find way to store video in mysql DB and using PHP and need solution.

     

    Thanks ChristianF for the link :)

     

    :)

     

     

    - Thanks

    Zohaib.

  13. Hi ,

     

    I set following in php.ini configuration and restart server

     

    upload_max_filesize 300M 300M

    max_execution_time 600 600

    memory_limit 500M 500M

    upload_max_filesize 300M 300M

     

     

    When I upload video file then I am getting following message.

     

    error_reporting(E_ALL);
    echo"<pre>";
    print_r($_POST);
    echo"</pre>";
    
    echo"<pre>";
    print_r($_FILES);
    echo"</pre>";
    
    echo"<pre>";
    print_r($_FILES['userfile']['error']);
    echo"</pre>";

     

     

     

    Array

    (

        [MAX_FILE_SIZE] => 2000000

        [upload] =>  Upload

    )

     

    Array

    (

        [userfile] => Array

            (

                [name] => Video.FLV

                [type] =>

                [tmp_name] =>

                [error] => 2

                => 0

            )

     

    )

     

    2

     

    Same code work fine for images.documents upload.

     

    Any solution for this problem in uploading videos in mysql database from php

     

    - Thanks

    Zohaib.

  14. Hi,

     

    I am able to upload image file and store in database.

     

    I am not able to upload video files in database. I have increase file upload limit and related settings in php.ini

     

    Thanks

    Zohaib.

     

    <?php
    
    error_reporting(E_ALL);
    
    /*
    
    Table   Create Table                                              
    ------  ----------------------------------------------------------
    upload  CREATE TABLE `upload` (                                   
              `id` int(11) NOT NULL AUTO_INCREMENT,                   
              `name` varchar(30) CHARACTER SET utf8 DEFAULT NULL,     
              `type` varchar(30) CHARACTER SET utf8 DEFAULT NULL,     
              `size` int(11) DEFAULT '0',                             
              `content` longblob,                                     
              PRIMARY KEY (`id`)                                      
            ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1  
    
    
    */
    $dbhost = 'localhost';
    $dbuser = 'user';
    $dbpass = 'password';
    $dbname = 'fileupload';
    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
    mysql_select_db($dbname);
    
    if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0)
    {
    $fileName = $_FILES['userfile']['name'];
    $tmpName = $_FILES['userfile']['tmp_name'];
    $fileSize = $_FILES['userfile']['size'];
    $fileType = $_FILES['userfile']['type'];
    $fp = fopen($tmpName, 'r');
    $content = fread($fp, filesize($tmpName));
    $content = addslashes($content);
    fclose($fp);
    if(!get_magic_quotes_gpc())
    {
    	$fileName = addslashes($fileName);
    }
    /*
    echo "<br/>".$fileName;
    echo "<br/>".$fileSize;
    echo "<br/>".$fileType;
    //echo "<br/>".$content;
    */
    $query = "INSERT INTO upload (name, size, type, content ) "."VALUES ('$fileName', '$fileSize', '$fileType', '$content')";
    mysql_query($query) or die('Error, query failed');
    
    mysql_close($conn);
    
    echo "File $fileName uploaded";
    }
    ?>
    <form method="post" enctype="multipart/form-data">
    <table width="350" border="0" cellpadding="1" cellspacing="1" class="box">
    <tr>
    <td width="246">
    <input type="hidden" name="MAX_FILE_SIZE" value="2000000">
    <input name="userfile" type="file" id="userfile">
    </td>
    <td width="80"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></td>
    </tr>
    </table>
    </form>

  15. Hi,

     

    I am trying to send email using pear email and php mailer with gmail account credentials and from address example@clientdomain.com

     

    but it is not working.

     

    Either it shows only gmail email in from or email sending did not work.

     

    Basically I want to send email using credentials mygmail@gmail.com and from address should be example@clientdomain.com

     

    Any solution for this problem?

     

    PEAR EMAIl EXAMPLE

     

    error_reporting(E_ALL);
    // Require Pear Mail Packages
    include("pearemail/Mail.php");
    include("pearemail/Mail/mime.php");
    
    
    $to  = 'mygmail@gmail.com';
    
    // Additional headers
    $from = "example@clientdomain.com";
    
    $headers["From"] = $from;
    $headers["To"]    = 'mygmail@gmail.com'; 
    $headers["Subject"] = "Test Email";
    
    $headers  = array ('From' => $from,'To' => 'mygmail@gmail.com'); 
    
    $adminMessage = "Test Email";
    
    $crlf = "\n";
    
    $mime = new Mail_mime($crlf);
    
    $mime->setHTMLBody($adminMessage);
    $adminMessage = $mime->get();
    $headers = $mime->headers($headers);
    $params["host"]    = 'smtp.gmail.com';
    $params["auth"]    = true; // note: there are *no delimiters*
    $params["username"]     = "mygmail@gmail.com";
    $params["password"]     = "mygmailpassword"; 
    
    $mail_message =& Mail::factory('smtp', $params);
    $mail_message->send ($to, $headers, $adminMessage);

    PHP MAILER EXAMPLE

     

     

    <?php
    
    //require("phpmailer/class.phpmailer.php");
    include("class.phpmailer.php");
    $mail = new PHPMailer();
    $mail->Host = "ssl://smtp.gmail.com::465";
    $mail->SMTPSecure = "ssl";
    $mail->IsSMTP(); // send via SMTP
    //IsSMTP(); // send via SMTP
    $mail->SMTPAuth = true; // turn on SMTP authentication
    $mail->Username = "mygmail@gmail.com"; // SMTP username
    $mail->Password = "mygmailpassword"; // SMTP password
    $webmaster_email = "example@clientdomain.com"; //Reply to this email ID
    $email="mygmail@gmail.com"; // Recipients email ID
    $name="name"; // Recipient's name
    $mail->SetFrom = $webmaster_email;
    $mail->FromName = "Webmaster";
    $mail->AddAddress($email,$name);
    $mail->AddReplyTo($webmaster_email,"Webmaster");
    $mail->WordWrap = 50; // set word wrap
    //$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
    //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // attachment
    $mail->IsHTML(true); // send as HTML
    $mail->Subject = "This is the subject";
    $mail->Body = "Hi,
    This is the HTML BODY "; //HTML Body
    $mail->AltBody = "This is the body when user views in plain text format"; //Text Body
    if(!$mail->Send())
    {
    echo "Mailer Error: " . $mail->ErrorInfo;
    }
    else
    {
    echo "Message has been sent";
    }
    ?> 

     

    Thanks

    Zohaib.

  16. Hi,

     

    I want to create result set from group by column.

     

    I have parent_title as group by columns

     

    I want to create array something like

     

    parent1 = >

    0 =>

    0=>name1

    1=>name1@email.com

    2=>parent1

     

    1 =>

    0=>name2

    1=>name2@email.com

    2=>parent1

    parent2 = >

    0 =>

    0=>name3

    1=>name3@email.com

    2=>parent2

     

    1 =>

    0=>name4

    1=>name4@email.com

    2=>parent2

     

    Thanks

    Zohaib.

     

    DROP TABLE IF EXISTS `tablename`;
    
    CREATE TABLE `tablename` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(300) DEFAULT NULL,
      `email` varchar(300) DEFAULT NULL,
      `parent_title` varchar(300) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
    
    /*Data for the table `tablename` */
    
    insert  into `tablename`(`id`,`name`,`email`,`parent_title`) values (1,'name1','name1@email.com','parent1'),(2,'name2','name2@email.com','parent1'),(3,'name3','name3@email.com','parent2'),(4,'name4','name4@email.com','parent2');

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