SitePoint Sponsor

User Tag List

Results 1 to 1 of 1

Thread: Values from php

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    London
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Values from php

    Hello Everybody,
    I have a problem. My problem is I need to insert values into mysql database,which are displayed by functions written in a file stuff.php which is in admin folder. I am pasting the functions written.

    admin/stuff.php

    function show_areas($current_area = "") {
    echo "<select name=\"area\">";
    foreach ($GLOBALS["hounslow_areas"] as $area) {
    echo "<option value=\"$area\" ";
    if ($area == $current_area) echo "selected";
    echo ">".ucfirst($area)."</option>";
    }
    foreach ($GLOBALS["bethnal_green_areas"] as $area) {
    echo "<option value=\"$area\" ";
    if ($area == $current_area) echo "selected";
    echo ">".ucfirst($area)."</option>";
    }
    foreach ($GLOBALS["manor_park_areas"] as $area) {
    echo "<option value=\"$area\" ";
    if ($area == $current_area) echo "selected";
    echo ">".ucfirst($area)."</option>";
    }
    foreach ($GLOBALS["tottenham_areas"] as $area) {
    echo "<option value=\"$area\" ";
    if ($area == $current_area) echo "selected";
    echo ">".ucfirst($area)."</option>";
    }
    echo "<option value=\"other\">Other</option>";
    echo "</select>";
    } // function show_areas()

    function show_bedrooms($no_rooms = "") {
    echo "<select name=\"bedrooms\">";
    for ($i = 1; $i <= 9; $i++) {
    echo "<option value=\"$i\"";
    if ($no_rooms == $i) echo " selected";
    echo ">$i</option>";

    function show_property_type($property_type = "") {
    ?>
    <script language="JavaScript" type="text/JavaScript">
    <!--



    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    //-->
    </script>

    <body>
    <select name="property_type"><option value="house" <?php if ($property_type == "house") echo "selected"; ?>>House</option><option value="bungalow" <?php if ($property_type == "bungalow") echo "selected"; ?>>Bungalow</option><option value="flat" <?php if ($property_type == "flat") echo "selected"; ?>>Flat</option><option value="room" <?php if ($property_type == "room") echo "selected"; ?>>Room</option><option value="studio" <?php if ($property_type == "studio") echo "selected"; ?>>Studio</option><option value="commercial" <?php if ($property_type == "commercial") echo "selected"; ?>>Commercial</option></select>
    <?php
    } // function show_property_type()

    these functions are used to display data. I need to get the values and insert them in mysql database.

    If it is possible by using the attribute name how do I do it.

    Thank You



    Please help.

    Thank You
    Last edited by phpnew; Oct 11, 2004 at 09:36.


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
  •