If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > how to $_GET multiple values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-21-11, 15:07
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
how to $_GET multiple values

Is there an easy way to $_GET multiple values from the url:
Code:
?type=forforum&no=0&source0=tr&btitle0=Matthew&no=1&source1=kjv&btitle1=Matthew&checkresult0=1&checkresult1=23195
The reason I ask is because I want to add more to this later on such as:
PHP Code:
?type=forforum&no=0&source0=tr&btitle0=Matthew&no=1&source1=kjv&btitle1=Matthew&checkresult0=1&checkresult1=23195&no=2&source2=kjv&btitle2=Matthew&checkresult2=23195&no=3...&no=4... 
This is how it's interpreted so far:
PHP Code:
$bk=isset($_GET["book".$no]) ? $_GET["book".$no] : "";
$ch=isset($_GET["chapter".$no]) ? $_GET["chapter".$no] : "";
$vs=isset($_GET["verse".$no]) ? $_GET["verse".$no] : "";
$source=isset($_GET["source".$no]) ? $_GET["source".$no] : "";
$sourceAbb=Array("kjv""mt""mtnv""tr");
$SourceName=Array("King James""Masoretic Text""Masoretic No Vowels""Textus Receptus");
$SourceTable=Array($dbTable3$dbTable7$dbTable9$dbTable8);
for(
$i=0$i<count($SourceTable); $i++){
    if(
$source==$sourceAbb[$i]){
        
$sql "SELECT * FROM ".$SourceTable[$i]." WHERE book = '".$bk."' AND chapter= '".$ch."'";
        if(
$vs != 'all'){
            
$sql .= " AND verse= '".$vs."'";
        }
        
$sql .= " ORDER BY id ASC";
        
//echo $sql;
    
}

__________________
Compare bible texts (and other tools):
TheWheelofGod
Reply With Quote
  #2 (permalink)  
Old 04-21-11, 16:12
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
the get variable will only come in as you have named them
so prepending book will not work unless the variabel sint eh get stream are also called book

look at the code you typed
you have several items itjn he stream all called 'no' how are you expecting PHP to handle that, which 'no' is the right 'no'

what you should do is five each element a unique name and then examine that variabel to see if its set.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 04-22-11, 13:02
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
Submit your values as an array.

Salvation lies within.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On