NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [PHP] Hidden Input, value=array

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-08-2006, 08:04 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
Tree's Avatar
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
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, 08:11 PM   #2 (permalink)
NamePros Regular
 
Jim_'s Avatar
Join Date: Aug 2005
Location: NY, USA
Posts: 610
Jim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to behold
 


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, 02:08 PM THREAD STARTER               #3 (permalink)
NamePros Regular
 
Tree's Avatar
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
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.
????: NamePros.com http://www.namepros.com/programming/195375-php-hidden-input-value-array.html
To call it:
Code:
<a href="javascript:popUp('FAQ.php?what=CC')">Country Codes</a>
Tree is offline  
Old 05-09-2006, 03:14 PM   #4 (permalink)
NamePros Regular
 
Jim_'s Avatar
Join Date: Aug 2005
Location: NY, USA
Posts: 610
Jim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to behold
 


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, 08:04 PM THREAD STARTER               #5 (permalink)
NamePros Regular
 
Tree's Avatar
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
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>";
????: NamePros.com http://www.namepros.com/showthread.php?t=195375
require_once(
"functions.inc.php");
switch (
$_GET['what']) {
    case 
CC:
        echo 
"<table cellpadding='2'>";
        foreach (
$func_country_array as $key => $value)
        {
            if (
$key == "BLANK"
????: NamePros.com http://www.namepros.com/showthread.php?t=195375
            {
                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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:37 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger