Advanced Search

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: user's simple entry onto a webpage?

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

    Default

    thanks you for your time.....
    still no go
    I wrote the new file, and chmodd'ed both files to 777 to be sure...
    I dont see the form box, and the size of the text file is still zero

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

    Default

    if I enter a number into the price.txt file it shows, so we are not writing into that file

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

    Default

    hmm how about if you put this in to see what is happening

    PHP Code:
    <?php
        
    echo "Processing";
        if (isset(
    $_POST['access']) && $_POST['access'] = "password") {
        echo 
    "Processing" "password set";
        
    //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'] !="") {
                echo 
    "Processing" "price set";
              
    $price $_POST['new_price'];
                echo 
    "price is $price";
              
    $current_price "price.txt";
                echo 
    "file is $current_price";
              
    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.

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

    Default

    in and 777'ed
    thanks

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

    Default

    can you strip all the existing page info out, I'll make a new file and we can see if the base file works?

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

    Default

    I am running a Blue Quartz server with PHP version: 4.3.9

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

    Default

    Oh that's the problem file_put_contents doesnt work in php 4. Have to rewrite it with fopen...
    Corrections to my coding/thoughts welcome.

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

    Default

    Rewritten, fixed another problem too.


    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_save fopen($current_price'w');
            
    fwrite($file_save$price);
            
    fclose($file_save);
            }
        }
    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 
    }
    ?>
    Last edited by bluewalrus; 06-17-2010 at 12:45 AM.
    Corrections to my coding/thoughts welcome.

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

    Default

    updated
    still not writing to the price.txt file (777)
    thank you

  10. #20
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    11,833
    Thanks
    233
    Thanked 659 Times in 647 Posts

    Default

    I'd suggest finding out how to write a file on your server. This is now a large and complex script, and there's no need to test within it when there could be a number of things causing problems for writing files. Once you find a method that works on your server, adapt the script to use that and it should be fine.
    Daniel - Freelance Web Design | <?php?> | <html>| Deutsch | italiano | español | português | català | un peu de français | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية

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
  •