473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Alternative of PHP "Unset" function is ASP

Hi everybody I have got the following PHP code which I am trying to convert to
ASP any help will be appreciated...I have done most of it but I cant find a
replace function for Unset in asp which will discard the variable alltogether...
if ($categoryid == "all")
{
$sql = "SELECT * FROM products where shopinspection=$shopinspection";
unset($HTTP_POST_VARS['categoryid']);
unset($HTTP_POST_VARS['shopinspection']);
}
else
{
$sql = "SELECT * FROM products where categoryid = $categoryid";
unset($HTTP_POST_VARS['categoryid']);
}
unset($HTTP_POST_VARS['Submit']);
while (list($key, $value) = each($HTTP_POST_VARS))
{
if ($value != "" )
{
$sql = $sql .=" AND $key=$value";
//$sql = $sql .=" AND solesource = $solesource";
//echo "<strong>$value</strong>";
}
}

Jul 21 '05 #1
3 4085
I don't believe that you'll find a replacement for this, as the Request.Form
collection is read-only. Try something like:
For each thing in Request.Form
If thing <> "categoryid" And thing <> "shopinspection" Then
'''your code
Next

Ray at work

<fa*****@yahoo.com> wrote in message news:cl*********@drn.newsguy.com...
Hi everybody I have got the following PHP code which I am trying to
convert to
ASP any help will be appreciated...I have done most of it but I cant find
a
replace function for Unset in asp which will discard the variable
alltogether...
if ($categoryid == "all")
{
$sql = "SELECT * FROM products where shopinspection=$shopinspection";
unset($HTTP_POST_VARS['categoryid']);
unset($HTTP_POST_VARS['shopinspection']);
}
else
{
$sql = "SELECT * FROM products where categoryid = $categoryid";
unset($HTTP_POST_VARS['categoryid']);
}
unset($HTTP_POST_VARS['Submit']);
while (list($key, $value) = each($HTTP_POST_VARS))
{
if ($value != "" )
{
$sql = $sql .=" AND $key=$value";
//$sql = $sql .=" AND solesource = $solesource";
//echo "<strong>$value</strong>";
}
}

Jul 21 '05 #2
Thanks ray I am including my ASP code which I have converted but is not working
the way I want it to....

if categoryid = "all" Then
sql = "SELECT * FROM products where shopinspection= "& shopinspection &""
Else
'sql = "SELECT * FROM products where categoryid = "& categoryid &""
sql = "SELECT * FROM products where "
End If

For x = 1 To (formcount - 1)
If Request.Form.item(x) <> "" Then
sql = sql & Request.Form.Key(x) &"="& Request.Form.Item(x) &""
sql = sql & " And "
End If
Next

In article <e9**************@tk2msftngp13.phx.gbl>, Ray Costanzo [MVP]" <my
first name at lane 34 dot commercial> says...

I don't believe that you'll find a replacement for this, as the Request.Form
collection is read-only. Try something like:
For each thing in Request.Form
If thing <> "categoryid" And thing <> "shopinspection" Then
'''your code
Next

Ray at work

<fa*****@yahoo.com> wrote in message news:cl*********@drn.newsguy.com...
Hi everybody I have got the following PHP code which I am trying to
convert to
ASP any help will be appreciated...I have done most of it but I cant find
a
replace function for Unset in asp which will discard the variable
alltogether...
if ($categoryid == "all")
{
$sql = "SELECT * FROM products where shopinspection=$shopinspection";
unset($HTTP_POST_VARS['categoryid']);
unset($HTTP_POST_VARS['shopinspection']);
}
else
{
$sql = "SELECT * FROM products where categoryid = $categoryid";
unset($HTTP_POST_VARS['categoryid']);
}
unset($HTTP_POST_VARS['Submit']);
while (list($key, $value) = each($HTTP_POST_VARS))
{
if ($value != "" )
{
$sql = $sql .=" AND $key=$value";
//$sql = $sql .=" AND solesource = $solesource";
//echo "<strong>$value</strong>";
}
}



Jul 21 '05 #3
In what way is it not working the way you want it to and in what way do you
want it to work? Tell us what you see that tells you it "is not working the
way I want it to...."

Ray at work

<fa*****@yahoo.com> wrote in message news:cl********@drn.newsguy.com...
Thanks ray I am including my ASP code which I have converted but is not
working
the way I want it to....

if categoryid = "all" Then
sql = "SELECT * FROM products where shopinspection= "& shopinspection
&""
Else
'sql = "SELECT * FROM products where categoryid = "& categoryid &""
sql = "SELECT * FROM products where "
End If

For x = 1 To (formcount - 1)
If Request.Form.item(x) <> "" Then
sql = sql & Request.Form.Key(x) &"="& Request.Form.Item(x) &""
sql = sql & " And "
End If
Next

In article <e9**************@tk2msftngp13.phx.gbl>, Ray Costanzo [MVP]"
<my
first name at lane 34 dot commercial> says...

I don't believe that you'll find a repla

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: leegold2 | last post by:
Is there a way I can "dispose" of an array. For example I need to use an array for short time in a script. After I've used that data structure I want to dispose of it to free-up resources. Is there...
5
by: Kai Grossjohann | last post by:
On unload of a page, I store the current scrollbar position (ie, window.pageXOffset and window.pageYOffset) into a cookie. On load of that same page, I fetch the information from that cookie and...
5
by: juglesh | last post by:
"$string = isset($xyz) ? $xyz : "something else";" Hello, someone gave code like this in another thread. I understand (by inference) what it does, but have not found any documentation on this...
7
by: fasanay | last post by:
Hi everybody I have got the following PHP code which I am trying to convert to ASP any help will be appreciated...I have done most of it but I cant find a replace function for Unset in asp which...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
3
by: comp.lang.php | last post by:
I have a counter that evokes the "Three Strikes You're Out" rule.. if you make more than N mistakes it auto-resets to avoid flooding $_SESSION with attempt after attempt, etc. However, the...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
1
by: Brian Kendig | last post by:
How do I take an index of a literal array, instead of a variable? That is, say I want to get the short name of a month. Can I do something like: $monthname = ("Jan", "Feb", "Mar", "Apr",...
0
by: mantrid | last post by:
I was thinking along these lines initially but didnt know much about arrays. So thought the easiest way was to use two separate fields. However the two fields match, in that the commar separated...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.