RE: [PHP] Passing Values between C App and PHP
if memory serves... you can look into using a shared memory block, or pipes to communicate between the php/c app -Original Message- From: Tobias Krieger [mailto:tobias.krie...@teamfrednet.org] Sent: Sunday, June 21, 2009 2:44 PM To: Nathan Nobbe Cc: php-general@lists.php.net Subject: Re: [PHP] Passing Values between C App and PHP Am 21.06.2009 um 23:31 schrieb Nathan Nobbe: On Sun, Jun 21, 2009 at 3:25 PM, Tobias Krieger tobias.krie...@teamfrednet.org wrote: Hi, I've recently written an eMail regarding I2C and PHP - since I haven't found a nice solution yet, I'm considering writting the I2C part (opening device, writing, reading,...) in C (that's simple) and to recieve (and returning) the values through PHP and Javascript. E.g. Website (PHP/Javascript) - set a new motorspeed - PHP passes the new speed to C Application - C AP opens and writes the new speed onto the I2C Bus - Motor executes - returns ack - Is this somehow, and not complicated possible? if the C program is written such that it can start and stop on every request rather than as a daemon, its as simple as shell_exec(). write your C app to take args over the cli and then pass them in through the call: ?php $result = shell_exec('myI2C -speed 50'); ? something of that nature. -nathan This would be a nice and fast solution, but unfortunatelly, it's like that the C programm needs to surveilance the hardware all the time (controlling values,...) hence, it would run more as a daemon. thx, tobias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Values between C App and PHP
Tobias Krieger wrote: This would be a nice and fast solution, but unfortunatelly, it's like that the C programm needs to surveilance the hardware all the time (controlling values,...) hence, it would run more as a daemon. Depending your skill-levels with C, there is not much to it. Here is some fairly simple code I use for a daemon that controls an IOM142 (google it) board via the serial port. http://jessen.ch/files/fridged.tar.gz It's very much send two-byte command, then receive multi-byte response, but it also responds to simple http-style requests and I call it from php to produce this page: http://jessen.ch/refrigeration/ (in dire need up an update). /Per -- Per Jessen, Zürich (14.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing Values between C App and PHP
Hi, I've recently written an eMail regarding I2C and PHP - since I haven't found a nice solution yet, I'm considering writting the I2C part (opening device, writing, reading,...) in C (that's simple) and to recieve (and returning) the values through PHP and Javascript. E.g. Website (PHP/Javascript) - set a new motorspeed - PHP passes the new speed to C Application - C AP opens and writes the new speed onto the I2C Bus - Motor executes - returns ack - Is this somehow, and not complicated possible? Thanks, Tobias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Values between C App and PHP
On Sun, Jun 21, 2009 at 3:25 PM, Tobias Krieger tobias.krie...@teamfrednet.org wrote: Hi, I've recently written an eMail regarding I2C and PHP - since I haven't found a nice solution yet, I'm considering writting the I2C part (opening device, writing, reading,...) in C (that's simple) and to recieve (and returning) the values through PHP and Javascript. E.g. Website (PHP/Javascript) - set a new motorspeed - PHP passes the new speed to C Application - C AP opens and writes the new speed onto the I2C Bus - Motor executes - returns ack - Is this somehow, and not complicated possible? if the C program is written such that it can start and stop on every request rather than as a daemon, its as simple as shell_exec(). write your C app to take args over the cli and then pass them in through the call: ?php $result = shell_exec('myI2C -speed 50'); ? something of that nature. -nathan
Re: [PHP] Passing Values between C App and PHP
Am 21.06.2009 um 23:31 schrieb Nathan Nobbe: On Sun, Jun 21, 2009 at 3:25 PM, Tobias Krieger tobias.krie...@teamfrednet.org wrote: Hi, I've recently written an eMail regarding I2C and PHP - since I haven't found a nice solution yet, I'm considering writting the I2C part (opening device, writing, reading,...) in C (that's simple) and to recieve (and returning) the values through PHP and Javascript. E.g. Website (PHP/Javascript) - set a new motorspeed - PHP passes the new speed to C Application - C AP opens and writes the new speed onto the I2C Bus - Motor executes - returns ack - Is this somehow, and not complicated possible? if the C program is written such that it can start and stop on every request rather than as a daemon, its as simple as shell_exec(). write your C app to take args over the cli and then pass them in through the call: ?php $result = shell_exec('myI2C -speed 50'); ? something of that nature. -nathan This would be a nice and fast solution, but unfortunatelly, it's like that the C programm needs to surveilance the hardware all the time (controlling values,...) hence, it would run more as a daemon. thx, tobias
Re: [PHP] Passing Values between C App and PHP
On Sun, Jun 21, 2009 at 3:44 PM, Tobias Krieger tobias.krie...@teamfrednet.org wrote: This would be a nice and fast solution, but unfortunatelly, it's like that the C programm needs to surveilance the hardware all the time (controlling values,...) hence, it would run more as a daemon. then you will have to make the C app accept socket connections; or maybe try unix signals handlers in the C app w/ shared memory betwen both processes; maybe there are easier ways to do it.. -nathan
Re: [PHP] passing values from dynamic form to another php page?
Quite rite. Well i have used this on my next page: global $HTTP_POST_VARS; $num_fields=count($HTTP_POST_VARS); while(list($key, $value) = each($HTTP_POST_VARS)) { echo $key = $valuebr; /or whatever coding i want to do// } regards hope Jay Blanchard wrote: [snip] form name=sqlform action=table1_process2.php method=post enctype=multipart/form-data // now i want to access the values from input fields on next page? can somebody give me idea how to pass all form field values to next page in this context?? [/snip] Look in the $_POST array (which matches the form method) on the next page. For example; ?php print_r($_POST); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing values from dynamic form to another php page?
hi i m generating a dynamic form (no. of fileds depend upon user selection from previous page). On this page user enters values into form fields and i want to acess them on next page. ///file1.php ?php require_once('../Connections/cnn.php'); / $cID=$HTTP_POST_VARS['select1']; //echo $cID; $query1 = SELECT * FROM categories where cat_id=$cID ; $result1 = mysql_query($query1, $cnn) or die(mysql_error()); $row1=mysql_fetch_array($result1); $cat_name=$row1['cat_name']; //echo $cat_name; $cat_image=$row1['cat_image']; //echo $cat_name; $cat_intro_text=$row1['cat_intro_text']; //echo $cat_name; $attributes_list =$HTTP_POST_VARS['sql_query']; echo $attributes_list; $fldslist=split(,,$attributes_list); $fldCount=count($fldslist); $_SESSION['num_fields']=$fldCount; $_SESSION['list_fields']=$fldslist; ? html head /head body form name=sqlform action=table1_process2.php method=post enctype=multipart/form-data table width=100% border=0 cellpadding=0 cellspacing=0 tr td width=13nbsp;/td td width=654 valign=top align=centerfont color=ffstrongWelcome to the Administration Panel/strong/font/td td width=12nbsp;/td td width=14nbsp;/td /tr tr tdnbsp;/td td valign=topnbsp;/td tdnbsp;/td tdnbsp;/td /tr tr tdnbsp;/td td height=26 align=centerfont color=ff size=+1Category:nbsp;nbsp;?php echo $cID..nbsp;.$cat_name;?/font/td tdnbsp;/td tdnbsp;/td /tr tr tdnbsp;/td td valign=topdiv align=center table width=100% border=0 cellspacing=0 cellpadding=0 tr tdnbsp;/td td width=40nbsp;/td tdnbsp;/td /tr tr align=left td align=leftimg src=../images/categories/?php echo $cat_image;? width=80 height=100/td td nbsp;/td td align=justify class=highlight?php echo $cat_intro_text; ?/td /tr tr tdnbsp;/td tdnbsp;/td tdnbsp;/td /tr /table /div/td tdnbsp;/td tdnbsp;/td /tr tr tdnbsp;/td td align=centerfont class=highlight size=+1Product Attributes/font/td tdnbsp;/td tdnbsp;/td /tr tr tdnbsp;/td td valign=top table width=95% align=center border=1 cellpadding=0 cellspacing=0 tr class=highlight ?php for ($i=0;$i$fldCount;$i++) { echo td$fldslist[$i]/td; } ? tdAction/td /tr tr class=highlight ?php for ($j=0;$j$fldCount;$j++) { echo tdinput type='text' name='$fldslist[$j]' size='8' value='' maxlength='8'/td; } ? tdinput type=submit name=submit value=Add Product onClick=return validateForm(this) onKeyPress=return validateForm(this) input type=hidden name=cat_id value=?php echo $cID;? input type=hidden name=MM_insert value=sqlform/td /tr /table /td tdnbsp;/td tdnbsp;/td /tr tr tdnbsp;/td td valign=top nbsp;/td
RE: [PHP] passing values from dynamic form to another php page?
[snip] form name=sqlform action=table1_process2.php method=post enctype=multipart/form-data // now i want to access the values from input fields on next page? can somebody give me idea how to pass all form field values to next page in this context?? [/snip] Look in the $_POST array (which matches the form method) on the next page. For example; ?php print_r($_POST); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing values from a new window
Javascript. Simply just update ur fields at the parent window. On onUnload even of the popup do this self.opener.formName.fieldName.value=document.popupformName.popupfieldName.value; Your keywords to check in Javascript papers are parent_window, window_opener and Javascript DOM. If you're using Dreamweaver then ur blessed by having a Javascript at the palm of ur hand. HTH. On Fri, 05 Nov 2004 13:03:31 -0800, Todd Cary [EMAIL PROTECTED] wrote: I have a button that creates a new window. The surfer may enter data in the new window, and if he does, when the window is closed by the surfer, can the information update fields on the original page - the page/window from which the new window was created? I have seen instances where the surfer can open a new window to get email addresses and these addresses appear in the first window. Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- M.Saleh.E.G 97150-4779817 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing values from a new window
I have a button that creates a new window. The surfer may enter data in the new window, and if he does, when the window is closed by the surfer, can the information update fields on the original page - the page/window from which the new window was created? I have seen instances where the surfer can open a new window to get email addresses and these addresses appear in the first window. Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing values from a new window
That is usually done with Javascript, though if you've got a session running, you can update session variables, then use Javascript to refresh the source page. For the most part I'd recommend a purely Javascript solution, but in some cases Using session variables/cookies/database might make more sense. Chris Todd Cary wrote: I have a button that creates a new window. The surfer may enter data in the new window, and if he does, when the window is closed by the surfer, can the information update fields on the original page - the page/window from which the new window was created? I have seen instances where the surfer can open a new window to get email addresses and these addresses appear in the first window. Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing values from a new window
On Fri, 05 Nov 2004 13:03:31 -0800, Todd Cary [EMAIL PROTECTED] wrote: I have seen instances where the surfer can open a new window to get email addresses and these addresses appear in the first window. Javascript. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing values of checkboxes in PHP
hi list, I have a problem with getting the values of check boxes ... In the form i have many checkbox options created dynamically. All of them have same name but different values. But when user submits the form i am able to access only the value of last checkbox that user cliked. Values of rest of the selection is not displayed/passed. How can i get all the values. many thanks in advance ... followings are my scripts ... form this prints lot of check boxes on the from as per the result or previous mysql query while ($rows2 = mysql_fetch_array($result2)) { echo input type=\checkbox\ Name=protid value=\$variable\ something ... } I am trying to access these checkbox values in follwing script --- if(isset($_POST['submit'])) { echo hello; echo $hell=$_POST['protid']; echo $counts = count($hell); } ? counts says there is only one value (that is value of last checked box) I also tried putting $hell=$_POST['protid'] in a while loop did not work. sincerely gowtham -- Ra. Gowthaman, Graduate Student, Bioinformatics Lab, Malaria Research Group, ICGEB , New Delhi. INDIA Phone: 91-9811261804 91-11-26173184; 91-11-26189360 #extn 314 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing values of checkboxes in PHP- solved
I myself solved the problem. sorry for the trouble .. sincerely, gowtham On Mon, 2004-05-17 at 11:51, gowthaman ramasamy wrote: hi list, I have a problem with getting the values of check boxes ... In the form i have many checkbox options created dynamically. All of them have same name but different values. But when user submits the form i am able to access only the value of last checkbox that user cliked. Values of rest of the selection is not displayed/passed. How can i get all the values. many thanks in advance ... followings are my scripts ... form this prints lot of check boxes on the from as per the result or previous mysql query while ($rows2 = mysql_fetch_array($result2)) { echo input type=\checkbox\ Name=protid value=\$variable\ something ... } I am trying to access these checkbox values in follwing script --- if(isset($_POST['submit'])) { echo hello; echo $hell=$_POST['protid']; echo $counts = count($hell); } ? counts says there is only one value (that is value of last checked box) I also tried putting $hell=$_POST['protid'] in a while loop did not work. sincerely gowtham -- Ra. Gowthaman, Graduate Student, Bioinformatics Lab, Malaria Research Group, ICGEB , New Delhi. INDIA Phone: 91-9811261804 91-11-26173184; 91-11-26189360 #extn 314 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Ra. Gowthaman, Graduate Student, Bioinformatics Lab, Malaria Research Group, ICGEB , New Delhi. INDIA Phone: 91-9811261804 91-11-26173184; 91-11-26189360 #extn 314 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing values dynamically
Hi, I am getting a one column table as a result for a select statement. Now I want to pass obtained values dynamically to invoke another query in a new page. I tried to pass the values with sessions. But every time I get the last value of the previous result. Any suggestions as how I could pass the value that I click on the current page ? (One of the row values in the one column table I got as the previous result) Thank You. Rashini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing values dynamically
You need to create an array in the session and assign the values: $_SESSION['values']=array(); while( $v=/* get single value */ ) { $_SESSION['values'][]=$v; // notice the [] } Then on the other page loop the array. Rashini Jayasinghe wrote: Hi, I am getting a one column table as a result for a select statement. Now I want to pass obtained values dynamically to invoke another query in a new page. I tried to pass the values with sessions. But every time I get the last value of the previous result. Any suggestions as how I could pass the value that I click on the current page ? (One of the row values in the one column table I got as the previous result) Thank You. Rashini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing values dynamically
i guess, it would be better to use loops, if i understand your problem, the way it is. Nitin - Original Message - From: Rashini Jayasinghe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 17, 2003 3:12 PM Subject: [PHP] Passing values dynamically Hi, I am getting a one column table as a result for a select statement. Now I want to pass obtained values dynamically to invoke another query in a new page. I tried to pass the values with sessions. But every time I get the last value of the previous result. Any suggestions as how I could pass the value that I click on the current page ? (One of the row values in the one column table I got as the previous result) Thank You. Rashini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing values dynamically
Hi, I am getting a one column table as a result for a select statement. Now I want to pass obtained values dynamically to invoke another query in a new page. I tried to pass the values with sessions. But every time I get the last value of the previous result. Any suggestions as how I could pass the value that I click on the current page ? (One of the row values in the one column table I got as the previous result) Thank You. Rashini
[PHP] Passing values from one page to another
Hello all, [snip] //Page0.php a href=page1.php?empid=1Enter/a //page1.php script language=javascript function submitform() { //Check for empty values in text box } /script form onsubmit='return submitform()' method=POST action='page2.php' input type=text name=uname input type=hidden name=empid value=?php echo $empid;? /form ?php echo $empid; ? //page2.php ?php echo $empid; ? In page 1 I am able to get the value 1 of empid. But in page 2 I am not able to get it. Any solutions -murugesan
Re: [PHP] Passing values from one page to another
--- murugesan [EMAIL PROTECTED] wrote: a href=page1.php?empid=1Enter/a ... input type=hidden name=empid value=?php echo $empid;? http://www.php.net/register_globals Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Values between Pages : $_SESSION / $_GET
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hello again, I would appreciate if someone could help me out with this one. Thanks again --Pushpinder On Friday, August 8, 2003, at 11:46 AM, Pushpinder Singh Garcha wrote: Hello All, I am using php and mysql in my application which allows users to search/query a database. The database is cast and has about 32 rows per record. When the user fires the query, the result is in the form of a table that contains only the 6 important rows of the entire record. Also there is a provision to allow the user to see the full record set by clicking on the link under the 'complete profile' contained in the table. (as shown below). The name of this script is lookup_results.php Here is the result for a companies in city = 'Charlotte' / Primary key of the table is the name of the company. --- --- - Company Name Main ContactCity Website E-Mail Complete Profile --- --- - PSG Pushpy Charlotte http://www.psg.com[EMAIL PROTECTED]--Link-- TFNA Napier Charlotte http://www.psg.com[EMAIL PROTECTED]--Link-- Micro Bates Charlotte http://www.psg.com [EMAIL PROTECTED]--Link-- CNN Garcha PSCharlotte http://www.psg.com [EMAIL PROTECTED]--Link-- --- --- - To see the complete profile of the company I use href=\full_profile_1.php?name=.$row['company'] I don't see what your question is? -- Quod subigo farinam $email =~ s/oz$/au/o; A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing Values between Pages : $_SESSION / $_GET
Hello All, I am using php and mysql in my application which allows users to search/query a database. The database is cast and has about 32 rows per record. When the user fires the query, the result is in the form of a table that contains only the 6 important rows of the entire record. Also there is a provision to allow the user to see the full record set by clicking on the link under the 'complete profile' contained in the table. (as shown below). The name of this script is lookup_results.php Here is the result for a companies in city = 'Charlotte' / Primary key of the table is the name of the company. --- Company Name Main ContactCity Website E-Mail Complete Profile --- PSG Pushpy Charlotte http://www.psg.com[EMAIL PROTECTED]--Link-- TFNA Napier Charlotte http://www.psg.com[EMAIL PROTECTED]--Link-- Micro Bates Charlotte http://www.psg.com [EMAIL PROTECTED]--Link-- CNN Garcha PSCharlotte http://www.psg.com [EMAIL PROTECTED]--Link-- --- To see the complete profile of the company I use href=\full_profile_1.php?name=.$row['company'] . So once we are on the full_profile_1.php, we can see all the contents of the record. Also we display a form where we can edit the results in place. The logic works like this. // full_profile_1.php LOGIC ? session_start(); if (isset($_SESSION['validuser'])) { if($submit) { update the changes that the user has made to the form My question here is How do I get the name of the company that was passed to this script as a $_GET Parameter. I cannot use the $company because it is out of scope. The only other option would be to use $_SESSION['link'] i.e. Store the names of the companies in a session array. So now the array as per the example above would be {'PSG','TFNA', 'Micro', 'CNN' } . The way this will work is how do I get the index of the 'link' array that is applicable in this example. Here the name of the company would be $company = $_SESSION['link'][0]; If we had clicked the second row of the results table the name of the compnay would have been 'TFNA' i.e. $_SESSION['link'][1] and so on. How do I pass the index. ??? } else { $company = $_GET['name']; USE form name=form1 method=post action=full_profile_1.php ANDdisplay all the rows of the record where company_name ='company' } } else { redirect the user to the ERROR Page } // end of pseudo- code Thanks in advance guys. I know this may sound a lil' vague , but I have tried to present the logic and the problem.
Re: [PHP] Passing Values between Pages : $_SESSION / $_GET
Thank you Jay for responding. Let me clarify again. The $_GET Parameter was used to to transfer the name from the results page (with the tables etc) to a full-profile_1.php page. On the full_profile_1.php page the user is displayed a form with all the details about the company. On the same page there is a form where changes can be made to values of the fields. I am trying to pass the company name in this form as a POST Parameter. However the Update part of the full_profile.php page is not able to get this value. The main point to remember is that full_profile_1.php does 2 things : 1.) Display all the fields of the company as a form which is editable 2.) Now if the user were to make changes in the values that were returned in the form above , the changes should be updated in the record. Now my problem is trying to transfer the name of the company from the 'form' to the update query. The way the logic on the full_profile_1.php is designed is as follows: if ($submit) { // This is after the user has been displayed all the fields of the record and he has made some changes and wanst to Update them // The Problem is how do I get the same name of the company in this loop. I have tried to pass the name as another $_POST Variable from the Form in the else part below, but when I try to access it over here. nothing comes. $temp1 = $_POST['temp']; // RETURNS EMPTY :( } else{ // here we get the name of the company as a $_GET Parameter from the previous page // display all the records of the selected company as a editable Form form name=form1 method=POST action=full_profile_1.php?temp=$row['company'] } Thanks again, and have a great weekend ! --Pushpinder On Friday, August 8, 2003, at 04:20 PM, Jay Blanchard wrote: [snip] My question here is How do I get the name of the company that was passed to this script as a $_GET Parameter. I cannot use the $company because it is out of scope. [/snip] How about $_GET['company'] ? Or am I missing something? Have a pleasant day.
RE: [PHP] Passing Values between Pages : $_SESSION / $_GET
[snip] Let me clarify again. The $_GET Parameter was used to to transfer the name from the results page (with the tables etc) to a full-profile_1.php page. On the full_profile_1.php page the user is displayed a form with all the details about the company. On the same page there is a form where changes can be made to values of the fields. I am trying to pass the company name in this form as a POST Parameter. However the Update part of the full_profile.php page is not able to get this value. [/snip] Clearer now. Place the value in a hidden form field that can be passed along with the POST -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Values between Pages : $_SESSION / $_GET
Hello again, I would appreciate if someone could help me out with this one. Thanks again --Pushpinder On Friday, August 8, 2003, at 11:46 AM, Pushpinder Singh Garcha wrote: Hello All, I am using php and mysql in my application which allows users to search/query a database. The database is cast and has about 32 rows per record. When the user fires the query, the result is in the form of a table that contains only the 6 important rows of the entire record. Also there is a provision to allow the user to see the full record set by clicking on the link under the 'complete profile' contained in the table. (as shown below). The name of this script is lookup_results.php Here is the result for a companies in city = 'Charlotte' / Primary key of the table is the name of the company. --- --- - Company Name Main ContactCity Website E-Mail Complete Profile --- --- - PSG Pushpy Charlotte http://www.psg.com[EMAIL PROTECTED]--Link-- TFNA Napier Charlotte http://www.psg.com[EMAIL PROTECTED]--Link-- Micro Bates Charlotte http://www.psg.com [EMAIL PROTECTED]--Link-- CNN Garcha PSCharlotte http://www.psg.com [EMAIL PROTECTED]--Link-- --- --- - To see the complete profile of the company I use href=\full_profile_1.php?name=.$row['company'] . So once we are on the full_profile_1.php, we can see all the contents of the record. Also we display a form where we can edit the results in place. The logic works like this. // full_profile_1.php LOGIC ? session_start(); if (isset($_SESSION['validuser'])) { if($submit) { update the changes that the user has made to the form My question here is How do I get the name of the company that was passed to this script as a $_GET Parameter. I cannot use the $company because it is out of scope. The only other option would be to use $_SESSION['link'] i.e. Store the names of the companies in a session array. So now the array as per the example above would be {'PSG','TFNA', 'Micro', 'CNN' } . The way this will work is how do I get the index of the 'link' array that is applicable in this example. Here the name of the company would be $company = $_SESSION['link'][0]; If we had clicked the second row of the results table the name of the compnay would have been 'TFNA' i.e. $_SESSION['link'][1] and so on. How do I pass the index. ??? } else { $company = $_GET['name']; USE form name=form1 method=post action=full_profile_1.php ANDdisplay all the rows of the record where company_name ='company' } } else { redirect the user to the ERROR Page } // end of pseudo- code Thanks in advance guys. I know this may sound a lil' vague , but I have tried to present the logic and the problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Values between Pages : $_SESSION / $_GET
Hello Jay , I am attaching snippet of the Form Code that displays the results of the first query meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head ? echo Hello ::: .$company.br; ? body bgcolor=aa leftmargin=14 topmargin=10 form name=form1 method=POST action=full_profile_1.php?temp=$company table width=780 border=1 align=center cellpadding=2 cellspacing=2 tr td width=778 height=1007 table width=775 height=1151 cellpadding=1 cellspacing=2 bordercolor=#FF bgcolor=#FF tr bgcolor=#3300CC td height=29 colspan=2 div align=centerfont color=#FF size=2 face=Verdana, Arial, Helvetica, sans-serifstrongComplete Candidate Profilebr br /strong/font table width=770 height=27 tr td width=385font color=#FF size=1 face=Verdana, Arial, Helvetica, sans-serif? echo $_SESSION['validuser']; ?/font/td td width=385div align=rightfont color=#FF size=1 face=Verdana, Arial, Helvetica, sans-serifstronga href=logout.phpLogout/a/strong/font/div/td /tr /table font color=#FF size=2 face=Verdana, Arial, Helvetica, sans-serifstrongbr /strong/font/div/td /tr tr td width=149 height=28 bgcolor=99ccffstrongfont color=#66 size=1 face=Verdana, Arial, Helvetica, sans-serifCompany Name/font/strong/td td width=614 bgcolor=#E7E7E7font size=2 color=#552233 face=Verdana, Arial, Helvetica, sans-serifstrong? echo $company; ?/strong input name=company type=hidden id=company3 size=40 value= ? echo $company; ? /font/td /tr tr // END OF SNIPPET However when I try to access it in the if($submit) part as $_POST['temp'] I get nothing !!! Thanks in advance, --Pushpinder On Friday, August 8, 2003, at 04:57 PM, Jay Blanchard wrote: [snip] Let me clarify again. The $_GET Parameter was used to to transfer the name from the results page (with the tables etc) to a full-profile_1.php page. On the full_profile_1.php page the user is displayed a form with all the details about the company. On the same page there is a form where changes can be made to values of the fields. I am trying to pass the company name in this form as a POST Parameter. However the Update part of the full_profile.php page is not able to get this value. [/snip] Clearer now. Place the value in a hidden form field that can be passed along with the POST
RE: [PHP] Passing Values between Pages : $_SESSION / $_GET
[snip] My question here is How do I get the name of the company that was passed to this script as a $_GET Parameter. I cannot use the $company because it is out of scope. [/snip] How about $_GET['company'] ? Or am I missing something? Have a pleasant day. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing values back to form
Im new to PHP coming from a background in perl devlopement. I have a form that a user can fill out. On submit the values are iterated over a foreach to check for empty(). If the an emtyp $key is found then it passes an error string to my error function. I have 2 php files, one that is the Form called profile.php and one that processes the values from the form, called profileprocess.php. There are multiple functions in profileprocess.php. When the header function is called in the profileprocess.php it takes you back to the profile.php with empty values in the fields. I was wandering if their is a way, (which Im sure their is) to pass back all the data that was correctly entered back to the form, and then a nice little message that displays the error of the data that needs to be checked by the user. I could do this a number of ways, but the key is not writing code that you dont have to. Its just smarter programming. Any ideas, or functions I could read on in the rtFM manual is greatly appreciated. I appreciate you looking at this problem... Thanks in advance, Daniel
Re: [PHP] Passing values back to form
Hi Daniel, My advice is to use php sessions. You can register both the filled and empty values in the session after processing them. Then you can header() redirect normally with no fuss and extract the values from the session file on the form page. And here's a tip. Set up some CSS in a switch() statement to highlight the form fields that are left blank. This makes for a nice user interface, esspecially on larger forms. Read up on sessions.. http://www.php.net/manual/en/ref.session.php HTH, Kevin Stone - Original Message - From: Daniel J. Rychlik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:31 AM Subject: [PHP] Passing values back to form Im new to PHP coming from a background in perl devlopement. I have a form that a user can fill out. On submit the values are iterated over a foreach to check for empty(). If the an emtyp $key is found then it passes an error string to my error function. I have 2 php files, one that is the Form called profile.php and one that processes the values from the form, called profileprocess.php. There are multiple functions in profileprocess.php. When the header function is called in the profileprocess.php it takes you back to the profile.php with empty values in the fields. I was wandering if their is a way, (which Im sure their is) to pass back all the data that was correctly entered back to the form, and then a nice little message that displays the error of the data that needs to be checked by the user. I could do this a number of ways, but the key is not writing code that you dont have to. Its just smarter programming. Any ideas, or functions I could read on in the rtFM manual is greatly appreciated. I appreciate you looking at this problem... Thanks in advance, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing values back to form
Thanks so much for your time. These are great tips, thanks again. - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: Daniel J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:37 PM Subject: Re: [PHP] Passing values back to form Hi Daniel, My advice is to use php sessions. You can register both the filled and empty values in the session after processing them. Then you can header() redirect normally with no fuss and extract the values from the session file on the form page. And here's a tip. Set up some CSS in a switch() statement to highlight the form fields that are left blank. This makes for a nice user interface, esspecially on larger forms. Read up on sessions.. http://www.php.net/manual/en/ref.session.php HTH, Kevin Stone - Original Message - From: Daniel J. Rychlik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:31 AM Subject: [PHP] Passing values back to form Im new to PHP coming from a background in perl devlopement. I have a form that a user can fill out. On submit the values are iterated over a foreach to check for empty(). If the an emtyp $key is found then it passes an error string to my error function. I have 2 php files, one that is the Form called profile.php and one that processes the values from the form, called profileprocess.php. There are multiple functions in profileprocess.php. When the header function is called in the profileprocess.php it takes you back to the profile.php with empty values in the fields. I was wandering if their is a way, (which Im sure their is) to pass back all the data that was correctly entered back to the form, and then a nice little message that displays the error of the data that needs to be checked by the user. I could do this a number of ways, but the key is not writing code that you dont have to. Its just smarter programming. Any ideas, or functions I could read on in the rtFM manual is greatly appreciated. I appreciate you looking at this problem... Thanks in advance, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing values from one script to another script
Hello everybody, I want to pass a value, which came from a HTML form, to another PHP script. How can i do this? e.g.: $login - the value of this varriable is came from LOGIN.HTML to LOGIN.PHP. How can i pass the value of $login from LOGIN.PHP to PROCESS.PHP? Thank you, Chinmoy - Do you Yahoo!? Yahoo! Web Hosting - establish your business online
Re: [PHP] passing values from one script to another script
Either use session, cookies, or pass the value in URLs. Because it is login information, I would choose session or cookie Chinmoy Barua wrote: Hello everybody, I want to pass a value, which came from a HTML form, to another PHP script. How can i do this? e.g.: $login - the value of this varriable is came from LOGIN.HTML to LOGIN.PHP. How can i pass the value of $login from LOGIN.PHP to PROCESS.PHP? Thank you, Chinmoy - Do you Yahoo!? Yahoo! Web Hosting - establish your business online -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] passing values from one script to another script
I want to pass a value, which came from a HTML form, to another PHP script. How can i do this? e.g.: $login - the value of this varriable is came from LOGIN.HTML to LOGIN.PHP. How can i pass the value of $login from LOGIN.PHP to PROCESS.PHP? The easiest way is with a session. Remember, each request is unique, so if you want to carry something over, you have to include it in the next request. This means adding it to the URL ($_GET) or adding it to a form ($_POST), adding it to a cookie ($_COOKIE), or putting it in the session ($_SESSION). ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing Values to an image script
I'm stuck on an odd problem with sending values between scripts. Take the following example. $h=20; $w=80; print img src=\image.php?h=$hw=$w\; Now this is a much watered down version of what I'm doing, but the idea is the same. I don't want to put the values I'm passing to the image in the html code to be passed with a get. I'd like to be able to maybe pass then in a POST format though I'm not sure how I can do that or if I can. The other idea I had was to start a session and register $h and $w then when I start the images script I can connect to the session and get the values form there though I would have to use Arrays so that I could keep data on many diff. images. I could pass the array index to the image script which would index all the array elements needed. The only down side I can see to that is that I would have to serialize the array vars in order to maintain them between sessions (index.php and image.php) and I would have a higher over head on my session code which may impact preformance greatly. Anyone have any ideas about this as in good idea bad idea, or other suggestions on how to pass this data without letting the user see it. -Jim _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Values to an image script
On Thu, 6 Jun 2002, Anzak Wolf wrote: $h=20; $w=80; print img src=\image.php?h=$hw=$w\; Now this is a much watered down version of what I'm doing, but the idea is the same. I don't want to put the values I'm passing to the image in the html code to be passed with a get. I'd like to be able to maybe pass then in a POST format though I'm not sure how I can do that or if I can. The other idea I had was to start a session and register $h and $w then when I start the images script I can connect to the session and get the values form there though I would have to use Arrays so that I could keep data on many diff. images. I could pass the array index to the image script which would index all the array elements needed. The only down side I can see to that is that I would have to serialize the array vars in order to maintain them between sessions (index.php and image.php) and I would have a higher over head on my session code which may impact preformance greatly. Anyone have any ideas about this as in good idea bad idea, or other suggestions on how to pass this data without letting the user see it. You don't want them to see it for which reason? 1) It's highly confidential; or 2) It looks ugly; or 3) You don't want casual users messing with it...? If 3, just base64 encode the serialized array of data and most people will leave it alone (it'll just look like a string of random letters and numbers) Posting isn't that useful unless the image is going to show up on its own in the web browser window. Sessions are okay, but once people start using the back button you are going to have some weird side effects. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Values to an image script
On Thu, 6 Jun 2002, Anzak Wolf wrote: $h=20; $w=80; print img src=\image.php?h=$hw=$w\; Now this is a much watered down version of what I'm doing, but the idea is the same. I don't want to put the values I'm passing to the image in the html code to be passed with a get. I'd like to be able to maybe pass then in a POST format though I'm not sure how I can do that or if I can. The other idea I had was to start a session and register $h and $w then when I start the images script I can connect to the session and get the values form there though I would have to use Arrays so that I could keep data on many diff. images. I could pass the array index to the image script which would index all the array elements needed. The only down side I can see to that is that I would have to serialize the array vars in order to maintain them between sessions (index.php and image.php) and I would have a higher over head on my session code which may impact preformance greatly. Anyone have any ideas about this as in good idea bad idea, or other suggestions on how to pass this data without letting the user see it. You don't want them to see it for which reason? 1) It's highly confidential; or 2) It looks ugly; or 3) You don't want casual users messing with it...? If 3, just base64 encode the serialized array of data and most people will leave it alone (it'll just look like a string of random letters and numbers) Posting isn't that useful unless the image is going to show up on its own in the web browser window. Sessions are okay, but once people start using the back button you are going to have some weird side effects. miguel It's not confidental, but I don't want users figuring out my backend image code from it. While I'm not sure what they could do with it other than make images the way they want and display then for themselves I don't see any danger in it. I just don't like messy long URL lines. I'm already going to be giving the users a way to customize the site so they don't need to me messing with varibles passed to the image script. As for your comment about the back button I have come up with a section of code for my site that stops user for doing much with the back or reload button. I keep track of a link counter in a session var and then if they hit back or reload the link counter that gets sent in the post data is not equal to counter++ and so I redirect them to an error page that explains that the site does not allow the use of the back button or reload buttons. -Jim _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing Values
Hello, Today I was working on an object that will create all of the columns and tables in my DataBase for my upcoming application. I however, did run into trouble. I am having problems because I cannot pass the name of the database from the form to the function that needs it. Everything is on the same page (sql_create.php), and the functions that gets the data (the form function) and the function that needs the Database name are both within an object. Does anyone have any ideas? I can post some code samples if it will help. Thanks in Advnace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing Values
show us code -Original Message- From: Sebastian A. [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 6:02 AM To: PHP General List (PHP.NET) Subject: [PHP] Passing Values Hello, Today I was working on an object that will create all of the columns and tables in my DataBase for my upcoming application. I however, did run into trouble. I am having problems because I cannot pass the name of the database from the form to the function that needs it. Everything is on the same page (sql_create.php), and the functions that gets the data (the form function) and the function that needs the Database name are both within an object. Does anyone have any ideas? I can post some code samples if it will help. Thanks in Advnace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing values
this is still not working for passing a value from one page to another: ?php echo ' input name=inp type=hidden value='. $_POST['inp']. ' '; ? When I look at the source this appears: input name = inp type = hidden value = which I take to mean that it does not know what $inp is. could it be something with my browser, or am I still doing something wrong (I wouldn't be a bit surprised) Thanks John _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] passing values
Are you using the post form method to post this variable to the next page. The value $_POST['inp'] is not present or set...there is a null value there. You will need to set the value with a post inorder to access it with the predefined variable $_POST... Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: John Gurley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 6:43 AM To: [EMAIL PROTECTED] Subject: [PHP] passing values this is still not working for passing a value from one page to another: ?php echo ' input name=inp type=hidden value='. $_POST['inp']. ' '; ? When I look at the source this appears: input name = inp type = hidden value = which I take to mean that it does not know what $inp is. could it be something with my browser, or am I still doing something wrong (I wouldn't be a bit surprised) Thanks John _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing values to a javascript variable
echo script language='javascript' .\n\tvar ndata = '.addslashes($data_data).'; .\n\tPutCode(ndata); .\n/script; Try that. Chris TunkeyMicket Watford TunkeyMicket Productions www.tunkeymicket.com - Original Message - From: Romulo Roberto Pereira [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 21, 2001 3:38 PM Subject: [PHP] passing values to a javascript variable Hello! The following give me: unterminated string constant (this is a javascript error) when I execute the following: while ($row = mysql_fetch_array ($data_query_action)) { $data_data = $row[data_data]; } echo script language=\javascript\\n var ndata=\.addslashes($data_data).\;\nPutCode (ndata);\n/script; Ideas? Please I need help. Thank you, Rom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] passing values to a javascript variable
Hello! The following give me: unterminated string constant (this is a javascript error) when I execute the following: while ($row = mysql_fetch_array ($data_query_action)) { $data_data = $row[data_data]; } echo script language=\javascript\\n var ndata=\.addslashes($data_data).\;\nPutCode (ndata);\n/script; Ideas? Please I need help. Thank you, Rom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passing values to a javascript variable
On Thu, 21 Jun 2001, Romulo Roberto Pereira wrote: Hello! The following give me: unterminated string constant (this is a javascript error) when I execute the following: while ($row = mysql_fetch_array ($data_query_action)) { $data_data = $row[data_data]; } echo script language=\javascript\\n var ndata=\.addslashes($data_data).\;\nPutCode (ndata);\n/script; Ideas? Please I need help. Thank you, This is usually a problem where a string literal is spanning thru several lines. Remember, in JavaScript one statement ends either with a semi-colon or a newline '\n'. You should do str_replace(\n, '\n', $data_data) in there before doing addslashes(). Believe it or not, thats the error. Joao -- João Prado Maia [EMAIL PROTECTED] http://phpbrasil.com - php com um jeitinho brasileiro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
AW: [PHP] Passing values from ASP to PHP
Hi you could try to ad a filter for 'exactfilename.asp' and assign it to php. i forgot most of my iis knowledge, but as far as i recal the .asp filter can be changed on per-directory basis. putting exactfilename.asp in the filter- tab higher then the asp one should map it to php it can be done with apache even easier, but as you use asp, i assume you use iis Sebastian -Ursprungliche Nachricht- Von: Isaac [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 28. Februar 2001 22:08 An: [EMAIL PROTECTED] Betreff: [PHP] Passing values from ASP to PHP I've been given a project that I want to use PHP with, but unfortunately there are unchangable hard-coded values that point clients to an ASP script residing on our server. Here's what I want to do, and I don't really know how to do it: I want to pass all the key/value pairs that are passed to the ASP script to a PHP script. I can get values with Request.Form("key_name"), but that takes hard-coding the name of the key. So if the following is passed to the ASP script: one=bluetwo=redthree=yellow Then I would want to redirect to myscript.php?one=bluetwo=redthree=yellow How do I go about walking through all the key/values that have been passed in ASP? I really don't want to have to learn this ugly language.. -- Isaac Force [EMAIL PROTECTED] (503)656-2489 http://gorgonous.dhs.org Real Users find the one combination of bizarre input values that shuts down the system for days. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Passing values from ASP to PHP
Hi, To enumerate the key/value in ASP from the form you'd do this % dim element dim objForm dim strURL '/* We're creating an object so that it won't matter which ' * HTTP method the previous form uses. ' */ If LCase(Server.Request("HTTP_METHOD")) = "post" Then Set objForm = Request.Form Else Set objForm = Request.QueryString End If strURL = "myscript.php?" '/* Now step through the form For each element in objForm '/* Key Name is in the "element" var ' * Value of the key is in the objForm(element) ' * Now build the Redirect string ' */ strURL = strURL Server.URLEncode(element) "=" Server.URLEncode(objForm(element)) "" Next '/* Now redirect Response.Redirect(strURL) % That should do it. I've been given a project that I want to use PHP with, but unfortunately there are unchangable hard-coded values that point clients to an ASP script residing on our server. Here's what I want to do, and I don't really know how to do it: I want to pass all the key/value pairs that are passed to the ASP script to a PHP script. I can get values with Request.Form("key_name"), but that takes hard-coding the name of the key. So if the following is passed to the ASP script: one=bluetwo=redthree=yellow Then I would want to redirect to myscript.php?one=bluetwo=redthree=yellow How do I go about walking through all the key/values that have been passed in ASP? I really don't want to have to learn this ugly language.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Passing values from ASP to PHP
I'm no ASP guru (never touched it actually), but...it seems as if this will add an extra "" on the end of the url. myscript.php?one=bluetwo=redthree=yellow ^ -Original Message- From: Opec Kemp [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 01, 2001 9:47 AM To: [EMAIL PROTECTED] Cc: PHP General List Subject: RE: [PHP] Passing values from ASP to PHP Hi, To enumerate the key/value in ASP from the form you'd do this % dim element dim objForm dim strURL '/* We're creating an object so that it won't matter which ' * HTTP method the previous form uses. ' */ If LCase(Server.Request("HTTP_METHOD")) = "post" Then Set objForm = Request.Form Else Set objForm = Request.QueryString End If strURL = "myscript.php?" '/* Now step through the form For each element in objForm '/* Key Name is in the "element" var ' * Value of the key is in the objForm(element) ' * Now build the Redirect string ' */ strURL = strURL Server.URLEncode(element) "=" Server.URLEncode(objForm(element)) "" Next '/* Now redirect Response.Redirect(strURL) % That should do it. I've been given a project that I want to use PHP with, but unfortunately there are unchangable hard-coded values that point clients to an ASP script residing on our server. Here's what I want to do, and I don't really know how to do it: I want to pass all the key/value pairs that are passed to the ASP script to a PHP script. I can get values with Request.Form("key_name"), but that takes hard-coding the name of the key. So if the following is passed to the ASP script: one=bluetwo=redthree=yellow Then I would want to redirect to myscript.php?one=bluetwo=redthree=yellow How do I go about walking through all the key/values that have been passed in ASP? I really don't want to have to learn this ugly language.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Passing values from ASP to PHP
I've been given a project that I want to use PHP with, but unfortunately there are unchangable hard-coded values that point clients to an ASP script residing on our server. Here's what I want to do, and I don't really know how to do it: I want to pass all the key/value pairs that are passed to the ASP script to a PHP script. I can get values with Request.Form("key_name"), but that takes hard-coding the name of the key. So if the following is passed to the ASP script: one=bluetwo=redthree=yellow Then I would want to redirect to myscript.php?one=bluetwo=redthree=yellow How do I go about walking through all the key/values that have been passed in ASP? I really don't want to have to learn this ugly language.. -- Isaac Force [EMAIL PROTECTED] (503)656-2489 http://gorgonous.dhs.org Real Users find the one combination of bizarre input values that shuts down the system for days. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Passing values containing a ? and a
use urlencode() www.php.net/urlencode Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Tom Harris [mailto:[EMAIL PROTECTED]] Sent: Friday, February 23, 2001 4:12 AM To: [EMAIL PROTECTED] Subject: [PHP] Passing values containing a ? and a I want to assign a value using the url however the value contains both a ? and an so PHP (or the browser) seems to get confused. Here's an example: http://www.mysite.com/index.php?id=23url=http://www.anothersite.com/file.ph p?qid=234forum=4 Everything after url= should be the value of $url but this is not the case. Is there a way to solve this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Passing values containing a ? and a
I want to assign a value using the url however the value contains both a ? and an so PHP (or the browser) seems to get confused. Here's an example: http://www.mysite.com/index.php?id=23url=http://www.anothersite.com/file.ph p?qid=234forum=4 Everything after url= should be the value of $url but this is not the case. Is there a way to solve this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Passing values containing a ? and a
URLs must be encoded if they contain special characters (and should be encoded always). See urlencode(). -jm -Original Message- From: Tom Harris [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 11:12 AM To: [EMAIL PROTECTED] Subject: [PHP] Passing values containing a ? and a I want to assign a value using the url however the value contains both a ? and an so PHP (or the browser) seems to get confused. Here's an example: http://www.mysite.com/index.php?id=23url=http://www.anothersite.com/file.ph p?qid=234forum=4 Everything after url= should be the value of $url but this is not the case. Is there a way to solve this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing values containing a ? and a
At 20:11 22.02.2001, Tom Harris said: [snip] I want to assign a value using the url however the value contains both a ? and an so PHP (or the browser) seems to get confused. Here's an example: http://www.mysite.com/index.php?id=23url=http://www.anothersite.com/file.ph p?qid=234forum=4 Everything after url= should be the value of $url but this is not the case. Is there a way to solve this? [snip] Have a look at the rawurlencode() and rawurldecode() functions. Generally spoken, any variable data passed as GET or POST argument should _always_ be passed in URLEncoded format. MSIE handles this quite nicely by auto-encoding unencoded data, but other browsers miss this. When constructing your GET command line, simply use the rawurlencode() function for any value. Example: htmlbody ?php $time = date ("l dS of F Y h:i:s A"); echo "a href=\"$PHP_SELF?gettime="; // this line will work everywhere echo rawurlencode($time); // this line will work with MSIE only // echo $time; echo "\""; echo $time; echo "/abrgettime = $gettime"; ? /body/html ...ebird O Ernest E. Vogelsinger (\)http://www.1-at-web.at/ ^ ICQ# 13394035 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]