Jump to content

Pass hash "#" contained in variables in the parameter list along with a URL


devarishi

Recommended Posts

Hi All,

 

 

I have two web pages in ASP:

 

First web page (userData.asp) displays a form and the submit button passes the values to the second web page.

 

The second web page (getData.asp) receives the query and saves it in a Database.

 

So, far all is working fine!

 

Well, I needed to email the same data (record consisting of around 8 or 10 text fields) to internal email IDs. As I don't know how to do that with ASP so I did it in PHP.

 

So, I have another web page (email.php) which is called by the application getData.asp and at the end of this file is this line:

 

Response.Redirect "email.php?n=" & Request.Form("analystName") & "&s=" & Request.Form("shift") & "&si=" & Request.Form("sIssue") & "&oi=" & Request.Form("oIssue") & "&q=" & Request.Form("qJ") & "&a=" & Request.Form("aJ") & "&f=" & Request.Form("fJ") & "&r=" & Request.Form("rmk")

 

As it is clear from the above code line that parameters (variables) with their associated values are being sent to the PHP application email.php. The problem is that if, for example, the second parameter has a string in which the hash symbol ("#") is found then whatever follows it along with  # gets truncated. Even none f the values of the other parameters after that one is passed to the email.php.

 

So, how can I resolve this problem?

 

 

The web form userData.asp calls the getData.asp web page and it gets everything right because the Submit button send the form's data. So, we are not passing any parameter to it manually. But when do it manually then we have to include %23 in place of # so that it can work fine.

 

But, as the case, is I can only pass parameters along with the email.php url. So, how to rectify the problem just before we pass the parameters?

 

 

 

email.php

 

 

Example:

 

If the first parameter (n) carries this value:

 

I am the #1 star in the team!

 

and the second parameter (s) carries this value:

 

I am the boss now!

 

<?php

$message .= "<p>Analyst: ";
$message .= $_REQUEST['n'];

$message .= $_REQUEST['s'];

echo $message;

?> 

 

then the output will be:

 

I am the

 

 

and the values of the other parameters are also truncated.

Yes, that function does the work in PHP. http://php.net/manual/en/function.urlencode.php

 

 

But I am googling for a similar functionality in ASP.

 

However, can we mix ASP and PHP- Can variables of ASP be used in PHP?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.