[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 05-08-2006, 07:04 PM   #1 (permalink)
NamePros Regular
 
Tree's Avatar
 
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
13.25 NP$ (Donate)

Tree will become famous soon enoughTree will become famous soon enough


[PHP] Hidden Input, value=array

I need to have a hidden field be the value of an array. Right now I have
PHP Code:
<input type='hidden' name='location[]' value='<?=$_POST['location']?>'>
But it just returns
Code:
<input type='hidden' name='location[]' value='Array'>
How can I make it so there are actual values?
Tree is offline  
Old 05-08-2006, 07:11 PM   #2 (permalink)
NamePros Regular
 
Jim_'s Avatar
 
Join Date: Aug 2005
Posts: 585
285.40 NP$ (Donate)

Jim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to all

Save The Children
use <?=explode("|",$_POST['location'])?> instead? then, implode it when its inputted.
__________________
ask me about the internet
Jim_ is offline  
Old 05-09-2006, 01:08 PM   #3 (permalink)
NamePros Regular
 
Tree's Avatar
 
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
13.25 NP$ (Donate)

Tree will become famous soon enoughTree will become famous soon enough


Awesome. That worked!

Now how can I make it so that when a link is opened, it pops up and scrollbars are there? This is the code I have so far, and the scrollbars don't work:

Code:
<SCRIPT LANGUAGE=\"JavaScript\">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval(\"page\" + id + \" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=500,height=400');\");
}
// End -->
</SCRIPT>
Not sure why the forums are showing menubar as men ubar, but in the code it's all together.
To call it:
Code:
<a href="javascript:popUp('FAQ.php?what=CC')">Country Codes</a>
Tree is offline  
Old 05-09-2006, 02:14 PM   #4 (permalink)
NamePros Regular
 
Jim_'s Avatar
 
Join Date: Aug 2005
Posts: 585
285.40 NP$ (Donate)

Jim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to all

Save The Children
What is the html code on FAQ.php?what=CC?
__________________
ask me about the internet
Jim_ is offline  
Old 05-09-2006, 07:04 PM   #5 (permalink)
NamePros Regular
 
Tree's Avatar
 
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
13.25 NP$ (Donate)

Tree will become famous soon enoughTree will become famous soon enough


Here's the whole of the script:

PHP Code:
<?
echo "<html><head><title>Explanation of Country Codes</title></head>";
require_once(
"functions.inc.php");
switch (
$_GET['what']) {
    case
CC:
        echo
"<table cellpadding='2'>";
        foreach (
$func_country_array as $key => $value)
        {
            if (
$key == "BLANK")
            {
                continue;
            }
            if (
$key == "ALL")
            {
                echo
"<tr>
                <td>"
;
                echo
"ALL";
                echo
"</td>
                <td>"
;nbsp(7);echo "</td><td>";
                echo
"All Countries
                </td>
                </tr>
                "
;
                continue;
            }
            echo
"<tr>
                <td>"
;
            echo
$key;
            echo
"</td>
            <td>"
;nbsp(7);echo "</td><td>";
            echo
ucwords(strtolower($func_country_array[$key]))."
            </td>
            </tr>
            "
;
        }
        break;

    default:
    die(
"ARG! You didn't say the password!");
        break;
}
echo
"</html>";
?>
Tree is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 11:50 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85