Page 1 of 1
Need help converting this from asp to php
Posted: Wed Nov 26, 2008 11:52 pm
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

Re: Need help converting this from asp to php
Posted: Thu Nov 27, 2008 12:22 am
by pinoypride
Code: Select all
<?
$_SESSION['sessionname'] = $_POST['fieldname'] . $item;
?>
Re: Need help converting this from asp to php
Posted: Thu Nov 27, 2008 1:21 am
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).
Re: Need help converting this from asp to php
Posted: Thu Nov 27, 2008 1:50 am
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

Re: Need help converting this from asp to php
Posted: Thu Nov 27, 2008 4:45 am
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
BUMP
Posted: Thu Nov 27, 2008 7:18 am
by saucez
please help???
[bumping post]