Advanced Search

Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: user's simple entry onto a webpage?

  1. #1
    Join Date
    Jun 2010
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default user's simple entry onto a webpage?

    What I want to do is for a webpage - for a client to securely post a number (in this case a current price) into a page on their website.
    In this case my client for whom I host a domain wants to be able to easily post a price daily for a commodity of theirs. FTP and HTML is beyond them and I havent found a tiny CMS method to do something this small (yet). Present alternative is an email blast.
    Ideas? Thank you.

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    I think publishing in Wordpress could be easy to learn for your client

  3. #3
    Join Date
    Jun 2010
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    too much fluff unfortunately. A maybe for now
    Thanks

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    You can do this with PHP you don't need any special script particularly...


    Can you post some sample html of how you'd want to use it and I'll make a sample php coding?
    Corrections to my coding/thoughts welcome.

  5. #5
    Join Date
    Jun 2010
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    On the page http://www.goldbuyinggirl.com/enterGBG.htm (or a new php page), I just need the client to enter an amount daily, like $100, into a "space" on the page, so her clients can se it.

  6. #6
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I haven't tested this so let me know if there's any error or any questions.

    To update the price the user should load

    http://domain.com/?price=anythingcanbehere

    PHP Code:
    <?php
        
    if (isset($_POST['access']) && $_POST['access'] = "password") {
        
    //this assumes the users password is password for access. You can also hash this with md5 if you want or some other method of your choosing
            
    if (isset($_POST['new_price']) && $_POST['new_price'] !="") {
                
    $price $_POST['new_price'];
                
    $current_price "price.txt";
                
    file_put_contents($current_price$price);
            }
        }
    if (isset(
    $_GET['price']) && $_GET['price'] !="") {
        
    ?>
         <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        Input the New Price to be displayed:<input type="text" name="new_price" /><br />
         Input your Password:<input type="password" name="access" />
         </form>
    <?php
    } else {
    $current_price "price.txt";
    $price_is file_get_contents($current_price);
    ?>
    <!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" xml:lang="en" lang="en">

    <head>
        <style type="text/css">
        #price {
        /*style price however you want here*/
        }
        </style>
        <title>Contact The Gold Buying Girl For A Gold Party or To Sell Gold</title>
        <meta name="ROBOTS" content="INDEX,FOLLOW">
        <meta name="description" content="Gold Buying Girl, Host a gold party in Houston, gold buyer, mailing gold, gold parties in Houston, TX">
        <meta name="keywords" content="Gold Buying Girl, gold buyer in houston, host a gold party, mailing gold, gold parties in Houston, TX">
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <meta http-equiv="Content-Language" content="en-us">

    <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
    </head>
    <body background="images/background60.jpg" topmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#000000">

    <div align="center">
        <table border="0" width="1053" cellspacing="0" cellpadding="0" id="table2">
            <tr>
                <td width="211" rowspan="2">
    <img border="0" src="images/gold-buying-girl-home.png" width="221" height="255" alt="Gold Buyer in Houston"></td>
                <td width="832">
    <img border="0" src="images/gold-party-purse.jpg" width="594" height="204" align="right" alt="Gold Buyer and Gold Parties"></td>
            </tr>

            <tr>
                <td align="right" width="832">
                    <p align="center">
                    <a href="index.html"><img border="0" src="/images/button-home.png" width="185" height="51" alt="Houston Gold Parties"></a>
                    <a href="about_gold_buying_girl.html"><img border="0" src="images/button-host-a-gold-party.png" width="192" height="51" alt="Host A Gold Party"></a>
                    <a href="faq.html"><img border="0" src="images/button-faq.png" width="181" height="51"></a>
                    <a href="contact_gold_buying_girl.html"><img border="0" src="images/button-contact.png" width="192" height="51"></a>
                    <a href="gold-party-testimonials.html"><img border="0" src="images/button-testimonials.png" width="192" height="51"></a>
                    <a href="contact_gold_buying_girl.html"><img border="0" src="images/button-appointment.png" width="240" height="51">

                    </a>
                    <a href="welcome.htm"> </a><a href="contact_gold_buying_girl.html"><img border="0" src="images/charity.png" width="192" height="51"></a>
                    <a href="become_a_gold_buyer.html"><img border="0" src="images/button-gbg.png" width="192" height="51"></a>
                  </td>
            </tr>
        </table>
    </div>
    <div align="center">
        <table border="0" width="1050" cellspacing="0" cellpadding="0" id="table1">

            <tr>
                <td valign="top" rowspan="3" width="246">
    </td>
                <td valign="top" rowspan="3" width="30">&nbsp;
                </td>
            </tr>
            <tr>
                <td align="left" width="768">
                &nbsp;

                <p>&nbsp;
                </td>
            </tr>
            <tr>
                <td align="center" width="768" valign="middle" >
                  <b>
                  <font color="#FFFFFF" size="3" face="Georgia"><a href="http://www.cabida.com/gbgcal/cks.php" target="_blank"><i>View
                the Calendar</i></a></font>
                  <i><font color="#FFFFFF" face="Georgia" size="2"> (opens
                    in a new tab or window)</font></i></b><br><br>

                <p><i><b><a href="calendarupdateform.htm"><font face="Georgia" color="#FFFFFF" size="3">Send a Calendar
                Update to the Gold Buying Girl</font></a></b></i></p>
                <p><b><font color="#FFFFFF" size="3" face="Georgia"><a href="http://www.cabida.com/gbgcal/calen.php"><br>
        <i>Maintain the Calendar</i></a><i> </i></font>
                <i><font color="#FFFFFF" face="Georgia" size="2">(requires
                a password)</font></i></b>
                </td>
            </tr>
            <tr>

                <td valign="top" width="246">
                   I have not idea where you want the price to show up but ummmm here? <div id="price"><?php echo $price_is?></div>
    </td>
                <td valign="top" width="30">
                </td>
                <td align="center" width="768">
                
                
                
                </td>
            </tr>
        </table>
    </div>
    <p align="center">

    &nbsp;</p>
    <script type="text/javascript">
    <!--
    swfobject.registerObject("FlashID");
    //-->
    </script>
    </body>
    </html>
    <?php 
    }
    ?>
    Corrections to my coding/thoughts welcome.

  7. #7
    Join Date
    Jun 2010
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks....
    I created a page on the domain from your code called price.php, which is now chmod'ed to 764.
    When I go to ../?price=100 and enter, I get no password challenge and it puts me back to the home page, and when I go back to price.php I see no changes.

    Advice?
    Thank you

  8. #8
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Oh yea forgot to mention you'll need to make a price.txt with permissions of... 600 i think.

    Can you post a link, not sure from your description what is happening?
    Corrections to my coding/thoughts welcome.

  9. #9
    Join Date
    Jun 2010
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    http://www.goldbuyinggirl.com/price.php
    the php page has permissions of 764
    the price.txt file is 600
    the files are all in the same folder

    thanks

  10. #10
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    opps I forgot the submit button on the form there. This code is the same with the submit button

    PHP Code:
    <?php
        
    if (isset($_POST['access']) && $_POST['access'] = "password") {
        
    //this assumes the users password is password for access. You can also hash this with md5 if you want or some other method of your choosing
            
    if (isset($_POST['new_price']) && $_POST['new_price'] !="") {
                
    $price $_POST['new_price'];
                
    $current_price "price.txt";
                
    file_put_contents($current_price$price);
            }
        }
    if (isset(
    $_GET['price']) && $_GET['price'] !="") {
        
    ?>
         <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
        Input the New Price to be displayed:<input type="text" name="new_price" /><br />
         Input your Password:<input type="password" name="access" /><br />
         <input type="submit" />
         </form>
    <?php
    } else {
    $current_price "price.txt";
    $price_is file_get_contents($current_price);
    ?>
    <!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" xml:lang="en" lang="en">

    <head>
        <style type="text/css">
        #price {
        /*style price however you want here*/
        }
        </style>
        <title>Contact The Gold Buying Girl For A Gold Party or To Sell Gold</title>
        <meta name="ROBOTS" content="INDEX,FOLLOW">
        <meta name="description" content="Gold Buying Girl, Host a gold party in Houston, gold buyer, mailing gold, gold parties in Houston, TX">
        <meta name="keywords" content="Gold Buying Girl, gold buyer in houston, host a gold party, mailing gold, gold parties in Houston, TX">
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <meta http-equiv="Content-Language" content="en-us">

    <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
    </head>
    <body background="images/background60.jpg" topmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#000000">

    <div align="center">
        <table border="0" width="1053" cellspacing="0" cellpadding="0" id="table2">
            <tr>
                <td width="211" rowspan="2">
    <img border="0" src="images/gold-buying-girl-home.png" width="221" height="255" alt="Gold Buyer in Houston"></td>
                <td width="832">
    <img border="0" src="images/gold-party-purse.jpg" width="594" height="204" align="right" alt="Gold Buyer and Gold Parties"></td>
            </tr>

            <tr>
                <td align="right" width="832">
                    <p align="center">
                    <a href="index.html"><img border="0" src="/images/button-home.png" width="185" height="51" alt="Houston Gold Parties"></a>
                    <a href="about_gold_buying_girl.html"><img border="0" src="images/button-host-a-gold-party.png" width="192" height="51" alt="Host A Gold Party"></a>
                    <a href="faq.html"><img border="0" src="images/button-faq.png" width="181" height="51"></a>
                    <a href="contact_gold_buying_girl.html"><img border="0" src="images/button-contact.png" width="192" height="51"></a>
                    <a href="gold-party-testimonials.html"><img border="0" src="images/button-testimonials.png" width="192" height="51"></a>
                    <a href="contact_gold_buying_girl.html"><img border="0" src="images/button-appointment.png" width="240" height="51">

                    </a>
                    <a href="welcome.htm"> </a><a href="contact_gold_buying_girl.html"><img border="0" src="images/charity.png" width="192" height="51"></a>
                    <a href="become_a_gold_buyer.html"><img border="0" src="images/button-gbg.png" width="192" height="51"></a>
                  </td>
            </tr>
        </table>
    </div>
    <div align="center">
        <table border="0" width="1050" cellspacing="0" cellpadding="0" id="table1">

            <tr>
                <td valign="top" rowspan="3" width="246">
    </td>
                <td valign="top" rowspan="3" width="30">&nbsp;
                </td>
            </tr>
            <tr>
                <td align="left" width="768">
                &nbsp;

                <p>&nbsp;
                </td>
            </tr>
            <tr>
                <td align="center" width="768" valign="middle" >
                  <b>
                  <font color="#FFFFFF" size="3" face="Georgia"><a href="http://www.cabida.com/gbgcal/cks.php" target="_blank"><i>View
                the Calendar</i></a></font>
                  <i><font color="#FFFFFF" face="Georgia" size="2"> (opens
                    in a new tab or window)</font></i></b><br><br>

                <p><i><b><a href="calendarupdateform.htm"><font face="Georgia" color="#FFFFFF" size="3">Send a Calendar
                Update to the Gold Buying Girl</font></a></b></i></p>
                <p><b><font color="#FFFFFF" size="3" face="Georgia"><a href="http://www.cabida.com/gbgcal/calen.php"><br>
        <i>Maintain the Calendar</i></a><i> </i></font>
                <i><font color="#FFFFFF" face="Georgia" size="2">(requires
                a password)</font></i></b>
                </td>
            </tr>
            <tr>

                <td valign="top" width="246">
                   I have not idea where you want the price to show up but ummmm here? <div id="price"><?php echo $price_is?></div>
    </td>
                <td valign="top" width="30">
                </td>
                <td align="center" width="768">
                
                
                
                </td>
            </tr>
        </table>
    </div>
    <p align="center">

    &nbsp;</p>
    <script type="text/javascript">
    <!--
    swfobject.registerObject("FlashID");
    //-->
    </script>
    </body>
    </html>
    <?php 
    }
    ?>
    Corrections to my coding/thoughts welcome.

Bookmarks

Posting Permissions

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