Closed Thread Icon

Topic awaiting preservation: Convert ASP to PHP Pages that link to <a href="https://ozoneasylum.com/backlink?for=12794" title="Pages that link to Topic awaiting preservation: Convert ASP to PHP" rel="nofollow" >Topic awaiting preservation: Convert ASP to PHP\

 
Author Thread
magicstor
Obsessive-Compulsive (I) Inmate

From: Indio, CA USA
Insane since: Jun 2003

posted posted 06-22-2003 21:47

Help !

I am running on a Unix server and it does not support ASP - so I need to convert to PHP and do not have a clue

Here is the script I need to convert

<% @LANGUAGE = VBScript %>
<%
Option Explicit
Response.Expires = 0
Dim number, zipCode, status, msg, shipDate, track, carrier
number = Request.QueryString("number")
zipCode = Request.QueryString("zipCode")
status = Request.QueryString("status")
msg = Request.QueryString("msg")
shipDate = Request.QueryString("shipDate")
track = Request.QueryString("track")
carrier = Request.QueryString("carrier")
%>

<html><body>
<p>
Tracking Results<br><br>

Order Number: <%= number %><br>
Zip Code: <%= zipCode %><br>
Status: <%= status %><br>
Message: <%= msg %><br>
Ship Date: <%= shipDate %><br>
Tracking Number: <%= track %><br>
Carrier: <%= carrier %>

</html></body>


any and all help will be appreciated

Doc
drbob@magicstor.com

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 06-23-2003 11:37

The easiest way to do this is probably by using this principle:

code:
ASP
number = Request.QueryString("number")
Order Number: <%= number %><br>
*******
Can be replaced with:
PHP
Order Number: <?php $_POST['number'] ?><br>
(or $_GET['number'] base on what you use in the preceeding form)



Everything that comes from a form to a page can be accessed in the array $_POST[] or $_GET[] depending on if you use POST or GET in the form.
So the line above would insert the value from the querystring into the HTML text.

That should get you going
/Dan

{cell 260}
-{ a vibration is a movement that doesn't know which way to go }-

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 06-23-2003 13:06

magicstor: You might also find this of use:

:FAQ: Can I convert from ASP to PHP or from PHP to ASP?

Oh and welcome. As you are new you should pop around to:

:FAQ: The Reception Room

___________________
Emps

FAQs: Emperor

sukerman
Nervous Wreck (II) Inmate

From: BATH, UK
Insane since: Jun 2003

posted posted 06-23-2003 16:27

Use $_REQUEST, its a superset of $_POST and $_GET args.

magicstor
Obsessive-Compulsive (I) Inmate

From: Indio, CA USA
Insane since: Jun 2003

posted posted 06-23-2003 20:28

Thanks Guys !

I finally got it using the folloiwing:

<?
// Option $Explicit;
$number=$HTTP_GET_VARS["number"];
$zipCode=$HTTP_GET_VARS["zipCode"];
$status=$HTTP_GET_VARS["status"];
$msg=$HTTP_GET_VARS["msg"];
$shipDate=$HTTP_GET_VARS["shipDate"];
$track=$HTTP_GET_VARS["track"];
$carrier=$HTTP_GET_VARS["carrier"];
?>


then the seperate calls:

Zip Code: <? echo $zipCode; ?>

etc, etc, etc

But you guys got me started !! Thank you all !!


« BackwardsOnwards »

Show Forum Drop Down Menu