Jump to content

fredrikrob

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Posts posted by fredrikrob

  1. Hi,

     

    I am working on simple project and it's for the institute Class project where i am learning php. i have to submit the project as soon as possible. But i am doing it different way then of i was supposed. Instead of validation message i want to use a picture or icon with Red error icon and Green yes icon as you can check in the attached picture. I am calling a function on submit button and if there is any error then using document.GetElementById('error').style.background="none" and ="pic url". I am getting output but it's just for a second then disappeared. I have already attached the Screen Shot to get the full idea.

    index.php?action=dlattach;topic=358205.0;attach=18161;image

    post-127764-13482403437873_thumb.jpg

  2. Your query does not look healthy

    $str="SELECT citycode,cityname 
    FROM city 
    WHERE statecode 
    IN ( 
    SELECT statecode 
    FROM city 
    JOIN state ON city.statecode = $id)"; 
    

     

    This is what I think you want

    $str="SELECT citycode, cityname 
    FROM city 
    WHERE statecode = $id";
    

     

    And you should has something in your first dropdown. Yours is empty. And I would not use 'action' as the name of a function. I'm sure it's a reserved word, but too lasy to look it up. Try "get_select" instead.

     

    Thanks for the reply.  Well i had a message code in my file before but i had issue in Ajax and javascript as i was unable to print the double result. With the help of ajax i was getting one 2 response one for city and one for market dropdown  menu. But i had only one id selected to print the result. For that i have used if condition and now it's working.  Here is the code :

    var res=obj.responseText; 
                if(md=='city') 
                { 
                     
                document.getElementById("market").innerHTML=res; 
                  
                    } 
                    else { 
                        document.getElementById("city").innerHTML=res; 
                         
                        } 

    But now i cant get 100% good result like i am not able to get the result on third menu as i use to change value in the first menu. Hop you got my point.

    Thanks.

  3. Hi,

     

    I have some problem in ajax like i am not able to retrieve data through Ajax. Please look at the attachment pic to better understand the scenario.  .

     

    Here are three fields first one will go with State, second will go with the city within the state and third one is for the market's or showroom within the city. I can easily retrive the data till first 2 option. Like if i select the State A and then i can see all the cities under the state A but i am not able to get the output in the market section. As Ajax query have only one response variable. I have spent lot's of hour in this and now have give up. Please help me in this. I am attaching the both php and files to get it clear.

     

    here is the main desiging file:

    <!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=utf-8" /> 
    <title>Untitled Document</title> 
    <script type="text/javascript"> 
    function Action(link,md) 
    { 
         
    var obj,url; 
    
    url="dcode.php?mode="+md+"&id="+link; 
    
    
    
    
    
    try { 
             
            obj=new XMLHttpRequest(); 
             
            } 
            catch(e) 
                { 
                    try { 
                         obj=new ActivexObject("Microsoft.XMLHTTP"); 
                         
                        } 
                         
                        catch(e) { 
                             
                            alert(e); 
                             
                            } 
                     
                    } 
             
      obj.open("GET",url,true); 
      obj.send(null); 
    obj.onreadystatechange=function() 
    { 
         if(obj.readyState==4) 
            { 
                 
                var res=obj.responseText; 
                 
                alert(res); 
                document.getElementById("city").innerHTML=res; 
                 
            } 
           
           
           
           
        } 
       
         
    } 
    </script> 
    
    
    <? 
    
    
    ?> 
    
    
    
    
    </head> 
    
    <body> 
    
    <form action="dcode.php" method="get"> 
    <table width="200" border="1" align="center"> 
      <tr> 
        <th scope="row"><label> 
          <select name="state" id="state" style="width:150px;" onchange="Action(this.value,'state')"> 
           
          <? 
          mysql_connect("localhost","root","") or die("check server"); 
            mysql_select_db("students")or die("check database"); 
    
        $str="select sno,sname from state"; 
        $rs=mysql_query($str); 
         
        while(list($scode,$stname)=mysql_fetch_array($rs)) 
        { 
          
             echo "<option value='$scode'>$stname</option>"; 
             
        } 
          ?> 
          </select> 
        </label></th> 
      </tr> 
      <tr> 
        <th scope="row"><label> 
          <select name="city" id="city" style="width:150px;" onchange="Action(this.value,'city')"> 
          <option value="city">Select city</option> 
          <? 
          $str="SELECT citycode,cityname 
    FROM city 
    WHERE statecode 
    IN ( 
    
    SELECT statecode 
    FROM city 
    JOIN state ON city.statecode = $id 
    
    )"; 
        $rs=mysql_query($str); 
         
        while(list($citycode,$cityname)=mysql_fetch_array($rs)) 
        { 
         
        echo "<option value='$citycode'>$cityname</option>"; 
         
        } 
           
          ?> 
          </select> 
        </label></th> 
        
      </tr> 
      <tr> 
        <th scope="row"><select name="market" id="market" style="width:150px;"> 
          <option value="market">Select Market</option> 
          <? 
          $str="SELECT citycode,cityname 
    FROM city 
    WHERE statecode 
    IN ( 
    
    SELECT statecode 
    FROM city 
    JOIN state ON city.statecode = $id 
    
    )"; 
        $rs=mysql_query($str); 
         
        while(list($citycode,$cityname)=mysql_fetch_array($rs)) 
        { 
         
        echo "<option value='$citycode'>$cityname</option>"; 
         
        } 
           
          ?> 
        </select></th> 
      </tr> 
    </table> 
    </form> 
    
    <script type="text/javascript"> 
    Action(101,'state'); 
    </script> 
    </body> 
    </html>

     

    and here is the main Code file where i have written php query to get the result:

     

    <? 
    
    
    mysql_connect("localhost","root","") or die("check server"); 
    mysql_select_db("students")or die("check database"); 
    
    
    
    if($_REQUEST["mode"]==state) 
    
    { 
        $id=$_REQUEST["id"]; 
         
        $str="SELECT citycode,cityname 
        FROM city 
        WHERE statecode 
        IN ( 
         
        SELECT statecode 
        FROM city 
        JOIN state ON city.statecode = $id)"; 
         
        $rs=mysql_query($str); 
         
        while(list($citycode,$cityname)=mysql_fetch_array($rs)) 
           { 
            echo "<option value='$citycode'>$cityname</option>"; 
         
            } 
             
        } 
         
    
    ?>

    post-127764-13482403427071_thumb.jpg

  4. I was looking for some Zen Coding Tutorial online but got nothing much informative. I have knowledge in some basic zen code like using ("html" and by pressing tab to get the <html></html> code) and

    html>head+body
    
    <html>
    <head></head>
    <body></body>
    </html>
    

     

    but i was looking for some advanced level code if i can assign some basic attribute to these elements.

     

  5. There is a simple trick to find out that how your website looks in the mobile devices that you can short your browser's screen by restoring down your browser by click on the maximize button as per the size of mobile device.

    You must have knowledge of responsive designing for this as most of the designer use the technique to design there website for mobile device compatible.   

  6. It will be nice if you can share your Css code with this post. So we can find out where you are doing wrong. But i will suggest you that please try to use "display: block" and "line-height: 25px" in your css file for the specific a tag. As i have already have gone through the same issue.

  7. Thanks for your response i have got a website W3school dot com and it seems to be a good platform to start. But i will prefer online videos too and i usually use to download the video's  instead buffering them again and again. But video tutorial are really good.

  8. I have good knowledge in Photoshop and looking to go for the Web Designing but i don't have any idea about it like what other things i should need to learn to became a good web designer. I use to learn from online tutorials .  Can some one provide me some good link for  PSD  to HTML conversion tutorial or for other format as i have seen these are in great demand in the present time .

     

  9. The follow items are separate languages and technologies that have nothing to do with each other at the fundamental level:

    PHP

    MySQL

    Regular Expressions

    HTML/CSS

    JavaScript/AJAX/Jquery

     

    Those items above, when combined properly by a person skilled in all 5 of them, create a fully functioning website. They are NOT the same language, and an expert in one of them is not necessarily an expert in another. Most of the moderators of the PHP boards are experts in all 5 simply through virtue of experience (and being awesome). What most new developers fail to understand is that PHP doesn't "know" anything about your HTML form or your MySQL database. PHP "knows" only PHP things. You must tell it, specifically and explicitly, if you want it to fetch information from a database, or receive information from an HTML form.

     

    If you want to make a web page you need to know HTML.  If you want to make a DYNAMIC web page you need to know some server-side language such as PHP.  You need both.

     

    -Dan

     

    Thanks for the reply.

    I have basic knowledge in HTML and CSS and i use to create some website for testing in Html. But thanks to let me know that i need to learn MysQl and java script/ ajayx/jquery. Thank for the advise.

  10. Hi,

     

    I have a good knowledge in HTML code's but i am not a professional Coder in HTML. I can design a basic HtmL website and pages. I want to know that can Html knowledge will be enough if have to go for the PhP learning ?

     

     

    Thanks

    Fred

  11. The best thing to get rid of it..reinstalling the Firefox again. But you need to follow some steps. First uninstall the Firefox through add remove program and please tick the button to remove the old setting. After the uninstallation  of Firefox don't forgot to remove the Firefox installation folder from the all program folder. Then restart the computer and then reinstall the new Firefox.

  12. I would like to hyperlink from the resources which don't need any authentication. It's not good too use user-name and password in the url. Instead you can share your resource through any other way. Ftp with anonymous permission is good option for the same .

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