html - Storing value inside text file with php -


i'm doing tutorial have form 5 different values inside of it. whenever hit value/number inside form, number saved textfile. let's hit value 3 , 4. result be:

textfile.txt:

3  4 

so question is, how send these values textfile? same structure of php coding if sent database?

my form looks like:

<form>       <div id="rating-area" class="shadow">      <img src="star-icon.png" id="thumb1" value="1"/>     <img src="star-icon.png" id="thumb2" value="2"/>     <img src="star-icon.png" id="thumb3" value="3"/>     <img src="star-icon.png" id="thumb4" value="4"/>     <img src="star-icon.png" id="thumb5" value="5"/>   </div> </form> 

i've been searching day answer without success.

form.php

<?php     //save text file     if( isset($_get['hit_number']) && is_numaric($_get['hit_number']) )       file_put_contents( 'textfile.txt', $_get['hit_number'], file_append | lock_ex); ?> <form>       <div id="rating-area" class="shadow">        <a href="form.php?hit_number=1"> <img src="star-icon.png" id="thumb1" value="1"/> </a>     <a href="form.php?hit_number=2"> <img src="star-icon.png" id="thumb2" value="2"/> </a>     <a href="form.php?hit_number=3"> <img src="star-icon.png" id="thumb3" value="3"/> </a>     <a href="form.php?hit_number=4"> <img src="star-icon.png" id="thumb4" value="4"/> </a>     <a href="form.php?hit_number=5"> <img src="star-icon.png" id="thumb5" value="5"/> </a>   </div> </form> 

the link around img reload same page hit_number param set based on image clicked.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -