Jump to content
Larry Ullman's Book Forums

guruje

Members
  • Content Count

    7
  • Joined

  • Last visited

Posts posted by guruje


  1. Thank you very much Mr.HartleySan and Mr. Conte for providing the code with explanatory notes. I am not a programmer but by studding the books and searching the net, little bit knowledge gained in HTML,CSS,JS & PHP. Due to the reason only, my questions seems silly in the codification part.

     

    The following part of code executed well:

     

    <?php

     

    echo file_get_contents('my_phone.csv');

     

    ?>

    And the result:

    "james", cat, 26, 99567 "jhony", micy, 32, 986745 "albert" ,major,36,785665 "john" ,walrus,45,56565

     

    Then coming to the PHP inside JavaScript of HTML; it is not working:

     

     

    <script>

     

    var phone_data = '<?php echo str_replace("\r\n", '|||', file_get_contents('my_phone.csv')); ?>';

     

    alert(phone_data);

     

    </script>

     

     

    Kindly guide me sir.

     

    With regards, GURUJE


  2. Thank you Mr. Hartley,

     

    First of all I apologize for not presenting the question in a proper and readable manner.

    In a layman language, i furnish below the problem once again.

     

    I have a webpage that collects details of phone numbers and stores in a excel sheet file -"phone.csv".

    Now i like to put another UI webpage linking that excel sheet for searching the Phone numbers by submitting name so that the phone & other details will be appeared in that form it-self.

     

    with regards, GURUJE


  3. I really appreciate all the forum members including Mr.Larry for the cool & timely support for the newbie. That shows the effectiveness of the forum which I never seen any where.

    Then coming to the point, as asked by Mr. Hartley, I use the available of data of "phone.csv" in another HTML form where in the details will be shown on click and the HTML code for the search will be:

     

     

    <HTML>
    <HEAD>
    <TITLE>PHONE NUMBER FINDER</TITLE>
    </HEAD>
    <BODY>
    <div style="text-align=center; background-color: #C0C0C0; width:300px; height:350px; border:2px double blue;"> 
    <P><FONT SIZE="+1">FPHONE NUMBER FINDER</FONT><hr color="#0099FF"> </P>
    <FORM NAME="phone" METHOD="post"> <!-- How to linck search.php file" -->
    
    <P>Enter Name: 
    <select name="$name"  >
    <option>    <!-- the name list shall fetch from "phone.csv" -->
    <option>
    </select></p>
    
    <P><INPUT TYPE="button" VALUE="SUBMIT" name="AddButton" onClick="get(this.form.input_A.value)">
     <input type="Reset"  name="reset" value ="RESET" onClick ="(this.form);" /></P>
    <hr color="#0099FF">
    
    <P>Name: <INPUT TYPE=TEXT NAME="Ans1" SIZE=10></P>
    <P>Nick Name: <INPUT TYPE=TEXT NAME="Ans2" SIZE=10></P>
    <P>Age: <INPUT TYPE=TEXT NAME="Ans3" SIZE=10></P>
    <P>Phone: <INPUT TYPE=TEXT NAME="Ans4" SIZE=10></P>
    </FORM>
    </div>
    </BODY>
    </HTML>
    

    1. Yes I want the result in side the web HTML form.
    2. For these 60 rows & 4 column, I feel database may not require.
    3. I want the result either in PHP /AJAX /J SON /JAVA SCRIPT - Which ever is acceptable.

    .


  4. Thank you Mr. Hartley. I have a CSV (coma separated value file )- "phone.csv" which stores the phone number details form a html file thorugh php file. There is no header for this file and it is append mode. The values looks -

     

    James Cat 26 99556745

    Jhony Micy 32 8767565

    Albert Major 44 6767656

    The first value is for Name; second for Nick name, third for age and last value for phone number.

    Like that "phone.csv file have four columns and arround 60 rows - which is daily getting appended.

     

    Now I want to get the phone number & age details though another HTML Form by creating another php file "check.php" and for that JSON /AJAX code to be created so that the result to be appeared below the HTML form. If PHP is sufficient then well & good but I am unable to codify..


  5. I have file "phone.csv" for Phone number details and want to get the required phone though forms. Please help me.

    "phone.csv" contains four columns without header name: like - "James", "Cat", "26", " 99556745" . The list contains around 60 rows.

     

    <html><head></head><body>
    <?php
    $file = fopen("phone.csv","r");
    while(! feof($file))
     {
     print_r(fgetcsv($file));
     }
    fclose($file);
    ?>
    <form action="check.php" method="post">
    <p>Enter Name: <br>
    <input type="text" name="username" size="10" />
    <input type="submit" name="submit" value="Enter" /></p>
    
    NAME: $col1  <br>
    NICK NMAE:  $col2  <br>
    AGE: $col3 <br>
    PHONE: $col4
    </form></body></html>

     

    I am unable to write the php code for the "check.php" and link to the form. Kindly help me out.

×
×
  • Create New...