PHP - Transferring Query Strings From Link To Website
Is it possible to have a link like this, http://www.somesite.com/?id=243 and transfer the "id" (or another query string) into the website from the link but at the same time, not affect the website (since "id" isn't a query string originally used in the website's URL)? I hope that makes sense..
Similar TutorialsI have a page that reads from a database to list employees from different states. Under each name is a link that pulls up a new window with a contact form. My goal is to get the name from that link to appear on that new window. (Which I will then use to ultimately add the name into the email that was generated so the recipient can know who the email was intended for.) I've tried using the GET and POST methods but nothing seems to work. Any help would be appreciated greatly. I will name my firstborn after anything you desire. I've included my code below. (The last line is what I've been primarily working with) Code: [Select] //Open Database Connection $db = open_db_connection(); $sql = "SELECT DISTINCT 1 from users where active = 'Y' and show_on_contactus = 'Y'"; $results = mysql_query($sql, $db); $emaillink = "<a target='main' onclick=window.open('contactform/contactCentral.php?name=$state_row[state]','popup','width=380,height=400,scrollbars=no,resizable=no,toolbar=yes,directories=no,location=no,menubar=yes,status=no,left=0,top=0'); return false>"; if(!mysql_num_rows($results) == FALSE) while($row = mysql_fetch_array($results, MYSQL_BOTH)) { echo "<ul id=\"directors\">\n"; $state_sql = "SELECT * from users where active = 'Y' and show_on_contactus = 'Y' and state_full = 'indiana' order by last_name"; $state_results = mysql_query($state_sql, $db); if(!mysql_num_rows($results) == FALSE) { while($state_row = mysql_fetch_array($state_results, MYSQL_BOTH)) { echo "<li>\n"; echo " <div class=\"fl dirimg\">\n"; if($state_row[photo] == "") { echo "<img border=\"0\" width=\"61\" height=\"85\" src=\"images/exe_placeholder.jpg\" alt=\"$state_row[first_name] $state_row[last_name]\" />\n"; } else { echo "<img border=\"0\" width=\"61\" height=\"85\" src=\"n2team/pictures/$state_row[photo]\" alt=\"$state_row[firstname] $state_row[last_name]\" />\n"; } echo " </div>\n"; echo " <span class=\"fr\">$state_row[first_name] $state_row[last_name]<br />\n"; echo " $state_row[title]<br />\n"; echo " $state_row[city], $state_row[state]<br />\n"; echo " $emaillink Contact $state_row[first_name] </a></span></li>\n"; } Hi Guys Again, another noob question that I can't seem to find a concise answer to. What is the best way to append a query string to a url? I've tried using the Header() function but this didn't seem to work - i.e. Code: [Select] Header("Location: enc.php?ID=test"); My goal is to change the query string depending on the output of various if else statements. For instance if $test isset then execute some code. The script will be self contained so it'll be posting back to itself with the query string and reacting differently depending on the query string. Any ideas? PS sorry if i am asking too many questions. Eager to learn and struggling to find answers to some things. What I basically want to do (and not sure if this is possible) is to append a different query string based on strings from a field(type: VARCHAR(4000)) are being truncated at 255 characters. Apparently this is how varchars work(how is that useful?). I've found these two solutions on the internet but neither of them seemed to work. first, some people thought it might be a php.ini thing, so I put this at the top of my php file: Code: [Select] ini_set ( 'mssql.textlimit' , '65536' ); ini_set ( 'mssql.textsize' , '65536' ); that didn't work, so other people suggested using the text field type instead but these two queries return nothing, so I must be doing something wrong or this just isn't the answer: Code: [Select] $bquery="SELECT CONVERT(TEXT,description) FROM table WHERE userID='$row[userID]'"; $bquery="SELECT CAST(description AS TEXT) FROM table WHERE userID='$row[userID]'"; Hello there, i`m trying to figure out a way to reorder a query string depending on variables. So the url would have the following query: /result/index.php?page=Weissenfels+Clack+and+Go&tyre=155_70_12&option1=30_02&option2=43_02&v_t=car&options=2 It should depend what page they come from if the page is equal to option2 then option1 is op1 and option2 is op2 To make it myself easier i have converted some variables On every first two digits ie 43 from the 43_02 can have 13 different ending digits, ie _03 or _04 or _05 etc... So i have converted all 43_02 43_03 etc to one variable ie $chain1 or $chain2 which holds in this case 43 a 43 is equal to Weissenfels+Clack+and+Go in the index page i have included the following process. At the moment i can only use php coding, unfortunately no mysql atm thank you in advance. Code: [Select] <?php $tyre = $_GET['tyre']; // finds the tyre size $op1 = $_GET['option1']; // finds the first chain size if applicable $op2 = $_GET['option2']; // finds the second chain size if applicable $op3 = $_GET['option3']; // finds the third chain size if applicable $op4 = $_GET['option4']; // finds the fourth chain size if applicable $op5 = $_GET['option5']; // finds the fith chain size if applicable $op6 = $_GET['option6']; // finds the sixth chain size if applicable $op7 = $_GET['option7']; // finds the seventh chain size if applicable $op8 = $_GET['option8']; // finds the eighth chain size if applicable $options = $_GET['options']; $page = $_GET['page']; $error = $_GET['info']; $vehicle_type = $_GET['v_t']; // finds the vehicle type $b = "Weissenfels+WeissTech+Tecna"; $c = "Weissenfels+Clack+and+Go"; if (($op1 == "30_02") || ($op1 == "30_03")) { $chain1 = "m30"; } elseif (($op2 == "43_02") || ($op2 == "43_03")) { $chain2 = "m43"; } else echo "error"; switch ($page) { case (($page == $c) && ($chain1 == "m43")); $option1 = $op1; $option2 = $op2; break; case (($page == $c) && ($chain2 == "m43")); $option1 = $op2; $option2 = $op1; break; default; $option1 = $op1; $option2 = $op2; break; } if ($options=="1") // calculates the possible combination { // outputs the results include 'options_1.php'; // type the amount of possible chains in here ie options_3 options_4 etc } elseif ($options=="2") { // outputs the results include 'options_2.php'; // type the amount of possible chains in here ie options_3 options_4 etc } elseif ($options=="3") { // outputs the results include 'options_3.php'; // type the amount of possible chains in here ie options_3 options_4 etc } elseif ($options=="4") { // outputs the results include 'options_4.php'; // type the amount of possible chains in here ie options_3 options_4 etc } elseif ($options=="5") { // outputs the results include 'options_5.php'; // type the amount of possible chains in here ie options_3 options_4 etc } elseif ($options=="6") { // outputs the results include 'options_6.php'; // type the amount of possible chains in here ie options_3 options_4 etc } elseif ($options=="7") { // outputs the results include 'options_7.php'; // type the amount of possible chains in here ie options_3 options_4 etc } elseif ($options=="8") { // outputs the results include 'options_8.php'; // type the amount of possible chains in here ie options_3 options_4 etc } else echo "there is an error on process_action2"; ?> I am building a project that requires I store query strings in a table (stage_reqs) which are called to determine permissions. These strings will look something like this: Code: [Select] select salesman from jobs where salesman is not NULL and job_id='".$this->job_id."' limit 1 The variable value needs to be determined from within the function it is being accessed in. Can I use eval to do this? Thanks, Chris Please reply in simple terms, 'cause I'm simple! Hello all. If I have a list of links on a page like: >Manchester United >Manchester City >Aresnal How do I make clicking one of the links then query my database for that record? So I click on manchester united and the body of the page calls all the information on the database for that club? Surely I don't need each page to link to their own PHP page do I? The manchester united link doesn't need to point to manchester-united.php? Can I have all the links pointing to club.php that changes in content depending on the link that was clicked? How do I achieve this? What's this called? Please help! Thanks all in advance. hello, i am transferring the post number from a forum page, to a non-forum page via url variables.. how do i stop someone editing the url variable and viewing the posts concerned? i thought i could possibly use cookies/or a kind of auto-post form.. please help if you can.. just what to google would be appreciated hi, I have a webpage that is driven by a database mostly. it has a catalog of dog treats and most will transfer to the checkout page but 2 two won't. I have checked the database and everything looks fine if it would help, here 's the webpage. http://auntievics.com/treats.php. it's the Cara The Flirt's K9 Canoli Stuffed and the Cara The Flirt's K9 Canoli Unstuffed that won't transfer. Any help would be appreciated. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=344960.0 Sorry, I initially posted this in the Ajax Help Thread, but thinking about it, I suspect this is a php query.
I am trying to write a basic Private Messaging script.
I have my main page which lists all messages that have been received. I then want to click on an href link to run an ajax query to bring information in from another .php file which shows the content of the selected message.
But I can't fathom out how to do this with an href. First off, is it possible? If so, can anyone tell me what I am doing wrong?
The relevant script is:
privatemessage.php:
<?php $query2 = DB::getInstance()->query("SELECT c.id as cid, c.title, c.time, m.id as membersid, m.username, m.member_first_name, m.member_last_name FROM conversation as c, members as m WHERE ((c.member1='{$memberid}' and c.read1='Yes' and c.removed1='No' and m.id=c.member2) OR (c.member2='{$memberid}' and c.read2='Yes' and c.removed2='No' and m.id=c.member1)) GROUP BY m.id ORDER BY m.id DESC"); ?> <table> <tr> <td align="left"> <?php echo htmlentities($result2->member_first_name); ?> <?php echo htmlentities($result2->member_last_name); ?> <?php echo "("; echo htmlentities($result2->username); echo ")"; ?> </td> <td align="right"> <?php echo timeAgo(strtotime($result2->time)); ?> </td> </tr> <tr> <td colspan="2" align="left"> <form action="" method="post"> <?php echo "Subject: "; ?> <?php echo "<input type='hidden' name='id' id='id' value='{$result2->cid}'>"; ?> <a href="#$result2->cid" onClick="showMessages(this.value)"><?php echo htmlentities($result2->title); ?> </form> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="js/readmessage.js"></script> </td> </tr> </table> <div id="txtMessage"></div>My readmessage.js code is: function showMessages(str) { if (str=="") { document.getElementById("txtMessage").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtMessage").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","readmessage.php?q="+str,true); xmlhttp.send(); }And my readmessage.php code is: ?php require 'core/memberinit.php'; $member = new Member(); include 'timeago.php'; $memberid = $member->data() ->id; if(isset($_GET['q'])) { $q = html_entity_decode($_GET['q']); $req1 = DB::getInstance()->query("SELECT title, member1, member2 FROM conversation WHERE id='{$q}' AND id2='1'"); foreach ($req1->results() as $dn1) if($req1->count()==1) { if(($dn1->member1=='{$memberid}') or ($dn->member2=='{$memberid}')) { if($dn1->member1=='{$memberid}') { DB::getInstance()->query("UPDATE conversation SET read1='Yes' where id='{$q}' and id2='1'"); $user_partic = 2; } else { DB::getInstance()->query("UPDATE conversation SET read2='Yes' where id='{$q}' and id2='1'"); $user_partic = "1"; } $req2 = DB::getInstance()->query("SELECT conversation.time, conversation.message, members.id as userid, members.username, members.member_first_name, members.member_last_name FROM conversation, members WHERE conversation.id='{$id}' AND members.id=conversation.member1 ORDER BY conversation.id2"); if(isset($_POST['message']) and $_POST['message']!='') { $message = $_POST['message']; if(get_magic_quotes_gpc()) { $message = stripslashes($message); } $message = $string(nl2br(htmlentities($message, ENT_QUOTES, 'UTF-8'))); if( DB::getInstance()->query("INSERT into conversation (id, id2, title, member1, member2, message, time, read1, read2) VALUES('{$q}', '{(intval($req2->id2)+1)}', '', '{$memberid}', '', '{$message}', '.time().', '', '')") and DB::getInstance()->query("UPDATE conversation SET read'{$user_partic}'='Yes' WHERE id='{$q}' AND id2='1'")); } echo "<h4>"; echo $dn1->title; echo "</h4><br><br>"; echo "<table><col width='150px'><col width='50px'><col width='150px'>"; echo "<tr><th>Member</th><th> </th><th>Message</th></tr>"; foreach ($req2->results() as $dn2) { echo "<tr><td>"; echo $dn2->members.member_first_name; echo $dn2->members.member_last_name; echo " ("; echo $dn2->members.username; echo ") </td><td></td><td>"; echo timeAgo(strtotime($dn2->time)); echo "<br>"; echo $dn2->message; echo "</td></tr>"; } echo "</table>"; } } } ?>However, just to try and find where the error lies, I have tried the following code for my readmessage.php file: <?php require 'core/memberinit.php'; $member = new Member(); include 'timeago.php'; $memberid = $member->data() ->id; if(isset($_GET['q'])) { $q = intval($_GET['q']); echo $q; } ?>Which always returns a "0" reply - which says to me that my files are talking, but that the id isn't being carried across. Anybody got any suggestions? Many thanks for any help offered. I have the following code Code: [Select] while($player = mysql_fetch_array($players)) { #Lets loop through all the players echo "<BR><input type=submit onclick=this.form.action='points.php?points=".$_GET['points']."&player=".$player['playerID']."&playerName=".$player['name']."' value='".$player['name']."'>"; }but the problem is that $player['name'] is always two words and it doesn't work. So I have removed '&playerName=".$player['name']."' but now don't know how to transfer that info. Is there a way of having the player name in the header or another way of sending this data to the next page? Another way of doing it is to check for the players name via there playerID number but this involves another call to the database which I am trying to avoid. Hello guys, I have created a mini image hosting website. Well, I have successfully coded the file upload, including security to allow certain image extensions and size as a beginner in PHP. However, only one thing remains is the image link. You can view the website on this address http://mini-image-hosting.99k.org/ where it is currently hosting on a free web hosting account with a free sub-domain. Right now, only the image can be uploaded and is being stored in a directory. Nevertheless, I want that when the person uploads an image, he gets also the link, for example: http://mini-image-hosting.99k.org/xxx.jpg something like that. Can you help me for this? Hi, I have a search results from a query like this: Accomodation & Housing Aqua & Hatcheries Automotive Beauty,Body & Sourl Billing Construction Education Electrical & Electronics Entertainment Financial Services Food & Dining Freelancers Health Services Home & Garden Industries Miscellaneous I wanted to hyper link these lines as an input to further query: For example: A link should establish to line item Industries, when i click on this, a further query to run with the results from another table with key word "Industries". Can somebody please help me on this issue. I am using dream weaver 5.5 for this project, if any help in this issue is greatly appreciated. Thanks, hi there alll newbie here lol just needed help with the code for the next page of results ? IE i have say 30 results returned from a sql query but only want to show ten at a time i no how to limit the result with the LIMIT 10 but how do i get it to put link show the other ten and so on. the code i have is here at the bottom of page http://www.phpfreaks.com/forums/index.php/topic,307971.0.html thanks in advance for any help kaine I have a "Members" page that displays my organizations members info via My SQL. Currently, the database displays "State" quick links at the top and has the members organized by State down the page. If you click on one of the State links at the top, it will navigate to the section of the page with that state and associated members. I want the members associated with a specific state to be displayed only once I click the associated state link -- instead of all of the information showing at once like it is now. The page I am referring to can be seen at this link: http://homesforhorse...rs.com/members/
<?php update_option('image_default_link_type','none'); include("/home/cingen/config_admin.php"); function listMembers() { $sql = mysql_query("SELECT c.*, s.* FROM (".TABLE_MEMBERS." c LEFT JOIN ".TABLE_STATE." s on c.state = s.state_abbr) WHERE c. status = '1' ORDER BY c.country, c.state, c.organization ASC"); while ($row = mysql_fetch_array($sql)) { $display_members = false; $organization = stripslashes($row['organization']); $website = stripslashes($row['website']); if ($website) { $link = "<a href='http://".$website."' target='_blank'>"; $endlink = "</a>"; } else { $link = ""; $endlink = ""; } $display_members .= $link.$organization.$endlink."<br />"; if ($row['address']) $display_members .= stripslashes($row['address'])." ".stripslashes($row['address2'])."<br />"; if ($row['city']) $display_members .= stripslashes($row['city']).", "; if ($row['state']) $display_members .= stripslashes($row['state']).""; if ($row['zip']) $display_members .= " ".$row['zip']; $display_members .= "<br />"; if ($row['contact_name']) $display_members .= "Contact: ".stripslashes($row['contact_name']); if ($row['contact_title']) $display_members .= ", ".stripslashes($row['contact_title']); if ($row['phone']) $display_members .= "<br />Tel: ".stripslashes($row['phone']); if ($row['email']) $display_members .= "<br />".$row['email']; if ($row['website']) $display_members .= "<br /><a href='http://".$row['website']."' target='_blank'>".$row['website']."</a><br/>"; if ($row['year_est']) $display_members .= "Founded in ".$row['year_est']."."; if ($row['org501c3'] == "1") $display_members .= " A 501(c)3 non-profit."; if ($row['gfas'] == "1") $display_members .= "<br />GFAS: Accredited Sanctuary."; if ($row['gfas'] == "2") $display_members .= "<br />GFAS: Verified Sanctuary."; if ($row['member_category']) $display_members .= "<br />".$row['member_category']; $display_members .= "<br /><br />"; $entries[$row['country']][$row['state_name']][] = $display_members; } $countrylinks = false; $statelinks = false; $display = false; if(is_array($entries)){ $display .= ' <div class="memberlist">'; foreach($entries as $country=>$state_members){ $countrylinks .= '<a href="#'.$country.'">'.$country.'</a> '; $display .= ' <h2 id="'.$country.'">'.strtoupper($country).'</h2> <div class="country">'; if(($state_members)){ foreach($state_members as $state=>$members){ $statelinks .= '<a href="#'.$state.'">'.$state.'</a> '; $display .= ' <h3 id="'.$state.'">'.strtoupper($state).'</h3> <div class="state">'; if(is_array($members)){ foreach($members as $key=>$member){ $display .= ' <div class="member"> '.$member.' </div>'; } } $display .= ' </div>'; } } $display .= ' </div>'; } $display .= ' </div>'; } $statelinks1 = ' <h2>Members List</h2> <strong>Quick Links</strong><br /><br /> '.$statelinks.'<br /><br />' .$display; return $statelinks1; } add_shortcode('memberlist', 'listMembers'); function listRescueStandards() { $display_members = ''; $sql = mysql_query("SELECT vc.*, s.*, m.* FROM ".TABLE_COMPLIANCE." vc, ".TABLE_STATE." s, ".TABLE_MEMBERS." m WHERE vc.member_id = m.cid AND m.status = '1' AND m.state = s.state_abbr ORDER BY m.state, m.organization ASC"); while ($row = mysql_fetch_array($sql)) { $organization = stripslashes($row['organization']); if ($row['website']) { $link = "<a href='http://".$row['website']."' target='_blank'>"; $endlink = "</a>"; } else { $link = ""; $endlink = ""; } if($x!=$row['state_name']){ $display_members .= "<br /><strong>".strtoupper($row['state_name'])."</strong><br />"; $x = $row['state_name']; } $display_members .= $link.$organization.$endlink."<br /> ".stripslashes($row['address'])." ".stripslashes($row['address2'])."<br /> ".stripslashes($row['city']).", ".stripslashes($row['state'])." ".$row['zip']."<br />"; if ($row['contact_name']) $display_members .= "Contact: ".stripslashes($row['contact_name']); if ($row['contact_title']) $display_members .= ", ".stripslashes($row['contact_title']); if ($row['phone']) $display_members .= "<br />Tel: ".stripslashes($row['phone']); if ($row['fax']) $display_members .= "<br />Fax: ".stripslashes($row['fax']); if ($row['email']) $display_members .= "<br />".$row['email']; if ($row['website']) $display_members .= "<br /><a href='http://".$row['website']."' target='_blank'>".$row['website']."</a>"; if ($row['year_est']) $display_members .= "<br />Founded in ".$row['year_est']."."; if ($row['org501c3'] == "1") $display_members .= "<br />This organization IS registered with the IRS as a 501(c)3."; if ($row['org501c3'] != "1") $display_members .= "<br />This organization is NOT registered with the IRS as a 501(c)3."; $display_members .= "<br /><br />"; } return "<div class='memberlist'>" . $display_members . "</div>"; } add_shortcode('standardslist', 'listRescueStandards'); Im trying to create a page that collects personal info from users and registers them. I have a page that contains the registration form which i will call page 1. A second page which I will call page 2, processes the form. A simplified version of page 2 looks like this Code: [Select] <?php if (isset($_POST['submitted'])) { $errors = array(); // Connect to the database. require_once ('config.php'); //Check for errors. //Check to ensure that the password is long enough and is of the right format. if (eregi ("^[[:alnum:]]{8,16}$" , $_POST['password'])) { $b = TRUE; } else { $b = FALSE; $errors[] = 'Please enter a password that consists only of letters and numbers between 8 and 16 characters long.'; } //Check to make sure the password matches the confirmed password. if ($_POST['password'] == $_POST['password2']) { $c = TRUE; $password = $_POST['password']; //Encrypt the password. } else { $c = FALSE; $errors[] = 'The password you entered did not match the confirmed password.'; } //Check to make sure they entered their first name and it's of the right format. if (eregi ("^([[:alpha:]]|-|')+$", $_POST['firstname'])) { $d = TRUE; } else { $d = FALSE; $errors[] = 'Please enter a valid first name.'; } //Check to make sure they entered their last name and it's of the right format. if (eregi ("^([[:alpha:]]|-|')+$", $_POST['lastname'])) { $e = TRUE; } else { $e = FALSE; $errors[] = 'Please enter a valid last name.'; } //Insert data into database. if (empty($errors)) { //query the database. for the sake of simplicity, I wont include the code // Show thank you message echo "<h3>Thank You!</h3> You have been registered"; } else { echo '<font color="red">You could not be registered, please contact us about the problem and we will fix it as soon as we can.</font>'; } //Display error messages. } else {// if errors array is not empty header("Location: page1.php?message=$errors");//Trying to pass the errors array into the url for page1 } } ?> So the idea is to create an array that contains all the errors. Upon querying the database, if the user completed the fields as required, a thank you message is printed. If not, he is redirected to the page containing the form (page 1) and the array containing the errors is transferred to page 1. Now I will include the relevant section of page 1 whihc is supposed to print the error messages. Code: [Select] <?php if(isset($_GET['message']) { echo '<h3>Error!</h3> The following error(s) occured:<br />'; foreach ($errors as $msg) { echo "$msg<br/>\n"; } } ?> I get the following error message when I submit the registration forms with deliberate errors: Error! The following error(s) occured: PHP Error Message Warning: Invalid argument supplied for foreach() in /home/a4993450/public_html/register_page_content.php on line 66 Free Web Hosting Can anyone point out why this error occurs? Hey there, I was wondering if this is possible with mysql, my goal is to transfer the users id from the users table to the id field in my status table, thanks in advance. NOTE: Not manually, through a script. Hi Everyone. I get the following data from a result from database search <?php echo $rsjobs['CompanyURL'];?> It prints out the url but when I try to turn it into a clickable link it does not work Here is the coding I have so far. <a href="<?php echo $rsjobs['CompanyURL'];?>"><?php echo $rsjobs['CompanyURL'];?></a> What am I doing wrong ? please help. So I am trying to execute an sql query by clicking a button or a link. Ultimately I want users to be able to click the "Fav" button and it then fades into "Added to favorites!" (I am building a favorite system which first collects data on page load like userid and itemid and then it needs to send it to the DB after a button is clicked) The fade and stuff is not the most important part now (although a tip on doing that would be awesome) but the most important part is how to get this functional: PHP Code: <?php // Start Favorite System! $user =& JFactory::getUser(); $userid = $user->id; if ($userid == 62) { echo "userID: ".$userid."<p />"; if ($user->guest) {echo "You are a guest<p />";} $itemid = $this->item->id; echo "itemID: ".$itemid."<p />"; $catid= $this->item->category->id; echo "catID: ".$catid."<p />"; $query = "INSERT INTO jos_k2_fav_xref (userID, itemID, catID) VALUES ('$userid', '$itemid', '$catid')"; // Need a way to make this into a button $run = mysql_query($query) or die(mysql_error()); } else {} ?> Currently all the values get stored in the DB as the page is loaded. I however want to be able to click on something to execute that query how do i do that? I read a bunch of stuff on javascript and ajax but it got me nowhere... Help is greatly appreciated! Hi, I am a curious fellow just beginning to use PHP. I understand the basics of what the $_GET and $_POST superglobals do, and how we can use them to retrieve data after form submission. I also know that since $_GET and $_POST are just associate arrays, we can create our own values in both $_GET and $_POST by writing statements like $_POST['variable'] = "value". I am wondering if it is at all possible to send data beyond form data by adding new key/value pairs into $_GET and $_POST. So for example, if I had a form that transferred username/password through Post, would it be possible for me to include further data by just saying $_POST['formtype'] = "house_insurance_form"? Basically what I'm getting at is trying to physically add your own data to $_POST or $_GET that you could pull from the next page where the form redirects to. In other words, can I send data beyond form data using these superglobals? I know I can do this with $_SESSION, but could I do it through $_POST or $_GET? I haven't been able to accomplish this, and I was just wondering if someone could give me an in-depth explanation of how this might work or how this is not possible. I would really really really appreciate it. Best Regards, -Sky |