Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 40
  1. #21
    Junior Member
    Join Date
    Apr 2012
    Posts
    27
    Member #
    31494
    Morning Ganners, you ok

    Thank you again for last night

    Did you see the coding for the search form and see the csv file ok

    Kind regards

    Ian

  2.  

  3. #22
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    Hi, at work at the moment but just had a look at your form. Right, to do searches like, that the script needs to be amended a bit and would really require some refactoring. It's not crazy complicated but it's the sort of thing you'd split into a template/strategy and is not something I have time to do at the moment. Again if no one picks up this issue then I'll help you when I get home (in another 8 hours or so)
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)

  4. #23
    Junior Member
    Join Date
    Apr 2012
    Posts
    27
    Member #
    31494
    Hi Mark

    That's ok no worries

    I will see if I can google template/strategy and see if it tells me anything

    Thank you so much

    Appreciate it

  5. #24
    Junior Member
    Join Date
    Apr 2012
    Posts
    27
    Member #
    31494
    Hi Mark

    Hope you had a good day

    I googled the strategy thing then googled php strategy but was mostly saying about how to search on websites and was talking about keywords, not sure if I got it right but some were saying putting keywords in the search, probably wrong lol

  6. #25
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    Hi Ian,

    So I've quickly refactored the script and split out the CSV processing into a class. So rather than posting the code here I'll provide you the download to a zip file which has it all in as there are a few files.

    http://ganners.co.uk/files/csv_to_table.zip

    There are a few files in here, you can try out index.php and see that all works with the new form now. There's also another file which shows how you can have an external form very easily. The csv_to_table.php is a class so you don't load this as a web page. Currently it must live with the index.php file in the same directory but just change the require_once to include any path you want.

    Edit: Just saw your last post. Strategy and template are design patterns used by developers in this sort of instance to separate out stuff like this so it's more maintainable and consists of better practices.
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)

  7. #26
    Junior Member
    Join Date
    Apr 2012
    Posts
    27
    Member #
    31494
    Hi Mark

    Ahhh thank you so much, appreciate it

    I will download it and try it now

    You on here for a while or you going offline soon

  8. #27
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    That's alright, I'll be on here for a little bit
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)

  9. #28
    Junior Member
    Join Date
    Apr 2012
    Posts
    27
    Member #
    31494
    Ok cool just trying to get my head round it as I need the search from on the front page and to display the results when a search is run, I have already got a front page but im thinking I am going to need to put all the coding on my index.html page into your index.php page as the search form is linked to your index.php page

  10. #29
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    Just rename my index.php page to whatever you want. That doesn't matter.

    You just have to replace NAME OF TABLE PAGE HERE with whatever the name of your table page is, then this block can work from anywhere


    The form code is this:
    HTML Code:
    <form method="get" id="csv-filter" action="NAME OF TABLE PAGE HERE">
                <ul id="searchform">
                    <li>
                        <label for="bedrooms">Number of Bedrooms:</label>
                        <select name="bedrooms" id="bedrooms">
                            <option value="" selected="selected">Any</option>
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                        </select>
                    </li>
    
                    <li>
                    <label for="bedrooms">Number of Bathrooms:</label>
                        <select name="bathrooms" id="bathrooms">
                            <option value="" selected="selected">Any</option>
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                        </select>
                    </li>
    
                    <li>
                        <label for="location">Location:</label>
                        <input type="text" name="location" value="" />
                    </li>
    
                    <li>
                    <label for="bedrooms">Minimum Price:</label>
                        <select name="minprice" id="minprice">
                            <option value="0" selected="selected">&pound;0</option>
                            <option value="100000">&pound;100,000</option>
                            <option value="125000">&pound;125,000</option>
                            <option value="150000">&pound;150,000</option>
                            <option value="175000">&pound;175,000</option>
                            <option value="200000">&pound;200,000</option>
                            <option value="225000">&pound;225,000</option>
                            <option value="250000">&pound;250,000</option>
                            <option value="275000">&pound;275,000</option>
                            <option value="300000">&pound;300,000</option>
                            <option value="325000">&pound;325,000</option>
                            <option value="350000">&pound;350,000</option>
                            <option value="375000">&pound;375,000</option>
                            <option value="400000">&pound;400,000</option>
                            <option value="425000">&pound;425,000</option>
                            <option value="450000">&pound;450,000</option>
                            <option value="475000">&pound;475,000</option>
                            <option value="500000">&pound;500,000</option>
                            <option value="550000">&pound;550,000</option>
                            <option value="600000">&pound;600,000</option>
                            <option value="650000">&pound;650,000</option>
                            <option value="700000">&pound;700,000</option>
                            <option value="800000">&pound;800,000</option>
                            <option value="900000">&pound;900,000</option>
                            <option value="1000000">&pound;1,000,000</option>
                        </select>
                    </li>
    
                    <li>
                    <label for="bedrooms">Maximum Price:</label>
                        <select name="maxprice" id="maxprice">
                            <option value="100000">&pound;100,000</option>
                            <option value="125000">&pound;125,000</option>
                            <option value="150000">&pound;150,000</option>
                            <option value="175000">&pound;175,000</option>
                            <option value="200000">&pound;200,000</option>
                            <option value="225000">&pound;225,000</option>
                            <option value="250000">&pound;250,000</option>
                            <option value="275000">&pound;275,000</option>
                            <option value="300000">&pound;300,000</option>
                            <option value="325000">&pound;325,000</option>
                            <option value="350000">&pound;350,000</option>
                            <option value="375000">&pound;375,000</option>
                            <option value="400000">&pound;400,000</option>
                            <option value="425000">&pound;425,000</option>
                            <option value="450000">&pound;450,000</option>
                            <option value="475000">&pound;475,000</option>
                            <option value="500000" selected="selected">&pound;500,000</option>
                            <option value="550000">&pound;550,000</option>
                            <option value="600000">&pound;600,000</option>
                            <option value="650000">&pound;650,000</option>
                            <option value="700000">&pound;700,000</option>
                            <option value="800000">&pound;800,000</option>
                            <option value="900000">&pound;900,000</option>
                            <option value="1000000">&pound;1,000,000</option>
                            <option value="1250000">&pound;1,250,000</option>
                            <option value="1500000">&pound;1,500,000</option>
                            <option value="2000000">&pound;2,000,000</option>
                            <option value="3000000">&pound;3,000,000</option>
                        </select>
                    </li>
    
                    <li>
                        <input type="submit" value="Search" />
                    </li>
    
                </ul>
            </form>
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)

  11. #30
    Junior Member
    Join Date
    Apr 2012
    Posts
    27
    Member #
    31494
    The external_form_test.php is perfect, exactly what I am looking for and say for example I need to add more properties to the csv file, I can by adding it into the excel file and saving it as the csv file with the same file name and upload that again replacing the one on the webspace at the moment, is that right


Page 3 of 4 FirstFirst 1 2 3 4 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

php filter row from csv

Click on a term to search for related topics.
All times are GMT -6. The time now is 05:41 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com