Need help converting this from asp to php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saucez
Forum Newbie
Posts: 14
Joined: Wed Nov 26, 2008 11:49 pm

Need help converting this from asp to php

Post by saucez »

Hey guys, could you help me convert this to php, its an asp code.

ASP CODE:

Code: Select all

<% Session("sessioname")= Request.Form("fieldname").Item; %>
I tried with a php converter and it came out with this, but im getting an error with it:

Code: Select all

<?php Session("sessioname")= @$_POST["fieldname"].$Item;; ?>
Please help guys :D
pinoypride
Forum Newbie
Posts: 4
Joined: Wed Nov 26, 2008 7:46 pm

Re: Need help converting this from asp to php

Post by pinoypride »

Code: Select all

<? 
 
$_SESSION['sessionname'] = $_POST['fieldname'] . $item;
 
?>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Need help converting this from asp to php

Post by requinix »

I'm thinking it's more like

Code: Select all

$_SESSION["sessionname"] = $_POST["fieldname"];
Request.Form(fieldname) is a collection, and ASP uses . like PHP uses -> (ie, not concatenation but member access).
saucez
Forum Newbie
Posts: 14
Joined: Wed Nov 26, 2008 11:49 pm

Re: Need help converting this from asp to php

Post by saucez »

for somereason it dont work too well or somthing.
Ok so what im trying to do is update a record in the database using a form, but im selecting from a list on another page, and then pressing sumbit, after that it uses this code to pick up what i selected from the form:

Code: Select all

<?php $_SESSION['sessionSE'] = $_POST['idradio'] . $item; ?>
and then im display the record inside a form which is filtered it by a recordset that filters by using that session name above.

but its not working, maybe u gave me the wrong code.
It doesn't display an error it just doesn't display anything in the form.

Please help =]]

o btw thanks heaps for the code above, it got me to the next stage =]]]

REALLY APRECIATED FOR YOUR HELP GUYS :D :D
saucez
Forum Newbie
Posts: 14
Joined: Wed Nov 26, 2008 11:49 pm

Re: Need help converting this from asp to php

Post by saucez »

ok soz i posted last messgae without reading the one above.

Ok i have the same problem still as above!

the content still doesn't display in the form, could you please help

=]
btw im new at php, so i am using the dreamweaver in-built functions for building php applications.

So i need so code that gets the selected field from the list that was submited, and then puts it into a variable so i can filter my recordset by it [preferbly a session variable, so it can expire and be used anywhere
saucez
Forum Newbie
Posts: 14
Joined: Wed Nov 26, 2008 11:49 pm

BUMP

Post by saucez »

please help???

[bumping post]
Post Reply