Jump to content

Jaswinder

Members
  • Posts

    124
  • Joined

  • Last visited

Posts posted by Jaswinder

  1. hello everyone....

     

    what i am trying is.. i have created a simple 5 pages HTML website... and i need to add a search in it.... Is it possible without php ??

     

    what i found is a code for google search,, which searches through web (obviously) and  not in my site.... any help ??

  2. i am learning static keyword.. and find this example , but it shows error ,, which i highlited below

     

    <?php
    class a{

    static protected $test="class a";

    public function static_test(){

    echo static::$test; // Results class b             here the program shows error .... can we use static keyword to call the variable or we have to use a class name?
    echo self::$test; // Results class a

    }

    }

    class b extends a{

    static protected $test="class b";

    }

    $obj = new b();
    $obj->static_test();
    ?>

     

    getting confused about these two terms.. i tell you what i understand till now about them... make me clear plz

     

    Scope resolution (::) - this is used to call constants and static variables, static functions and classes but not with instance/object ?? am i right ?? anything more about it ?

     

    static keyword -   we can call static variable and functions without  the need of instantiation i.e directly  using scope resolution.... the class also becomes static , if any property  or method declared static in it. After inheriting from such class  if we override property  or method we have to use static keyword again while override,,,, ok or i need to learn more ??

     

  3. hello friends... i have uploaded the videos,, now i want to see it...

     

    i uses the <iframe> tag ,but it shows video only in firefox and also starts on page load... which i dont want,,,,,

     

    For chrome HTML5 video tag is being used... and i dont know about IE... so how should i write my code???

     

    here is my code :-

     

    <?php
        while($f=mysql_fetch_array($q))
        {
            if($f['video'] != ' ')
            {
        ?>
       <li> <video controls="controls" width="450" height="280">
        <source src='upload/<?php echo $f["event"]; ?>/video/<?php echo $f["video"];?>' type="video/mp4" height="200" width="200">
        </video></li><br />

     

    <iframe src="upload/<?php echo $f["event"]; ?>/video/<?php echo $f["video"];?>" height="200" width="200"></iframe>
      
      <?php
            }
        }
    ?>

     

    How could i put condtions for browsers the chrome uses video tag and not iframe tag.., as now it shows two videos ,, but working other blank(obviously for iframe tag)... and vice-versa for firefox... and what to do for IE

     

     

     

  4. can anyone clear me what is the difference between  ->    and   => ??

     

    when we call method of a class, we use

     

    $obj -> method();

     

    can we use this also ???

     

    $obj => method();

     

    and also ,when we assign a value to a variable ( e.g $name ) , we us

     

    $obj->name="Smith";

     

    but what this means ??  $obj->$name ..    or is it incorrect  ??  or am i  assigning value of $name to $obj ??

     

    i have seen a working code ... what it means

     

    $obj= new name;  //name is a class
    foreach($obj as $var=>$value)

     

     

     

     

  5. hello friends i am new to oops.... what i am trying is put the value of a constant in a variable... but not getting any output

     

    code :-

     

    <?php
    class visible
    {
        const a='Hello';
    }
    class check extends visible
    {
        private $c;
        public function c()
        {
            $this->c=self::a;
        }
    }
    $d=new check;
    echo $d->c();
    ?>

     

    is it possible to inherent a constant ??

  6. hello friends..

    i have uploaded the images ,but their paths are different.. e.g

     

    upload/dancing/images/filename.jpg

     

    upload/singing/images/filename.jpg

     

    upload/fashion/images/filename.jpg

     

    i want to show all the images by clicking on a button....

     

    How do i give path to all these..???

     

    i am trying this code

     

    <img src="upload/../images/<?php $f['images'];?>">

     

    here <?php $f['images'];?> is a file name coming from database

     

    but getting no result...

     

    and also the same way i want to show pdf and videos and they are also uploaded in different folders and their name are coming from database...

     

     

    any suggestions???

  7. <div style="width:100%; height:auto; background-color:#000; color:#FFF; text-align:center;">
     <table align="center" width="100%" border="1" style="color:#FFF;">
     <tr><th>Pdf</th><th>Video</th><th>Images</th></tr>
    <?php
    $email=$_GET['email'];
    include_once ('host.php');
    $c="select * from upload where email_id=$email";
    $sq=mysql_query($c) or die(mysql_error());
    $r=mysql_num_rows($sq);
    if($r>=0)
    {
        while($f=mysql_fetch_array($sq));
        {?>
       
        
        <tr><td><? echo $f['pdf']; ?></td><td><? echo $f['video']; ?></td><td><? echo $f['images']; ?></td></tr>
     
        <?php
        }
    }
    else
        {
            echo "You do not uploaded anything yet";    
        }
        
    ?>
    <tr><td colspan="3" style="background-color:#F00;"><a href="upload.php">Back</a></td></tr>
    </table>
    </div>

     

     

    error

     

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@s.com' at line 1

                                     

                                           Pdf                                        Video                                       Images

     

     

    Where email id is a@s.com

  8. Today i came across this concept MVC of PHP.. i got number of list on it..

    e.g

    1. Zend

    2. Joomla (also a CMS)

    3.Symfony

    4.Drupal

    5 Cake php

    6 Codelgnitor

    7. Twitter Bootstrap

    , etc

    and may be more...

     

    i want to know..where and what is the use of these MVC's... and  which one should i learn or is in demand??

  9. its not showing that also... so i just changed the host.. its working great know and i got the email.. :)

     

    about <<<EOD (heredoc)

    what exactly it do... i search the web ,  not get clear much,,,i think it is used to write multiple lines with single(') and double quotes(") ?? is it

     

    and also about this line

     

    From: "$name" <$email>

  10. and 1 more question about <<<EOD (heredoc)

    what exactly it do... i search the web ,  not get clear much,,,i think it is used to write multiple lines with single(') and double quotes(") ?? is it

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