473,657 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_POS T_VARS['categoryid']);
unset($HTTP_POS T_VARS['shopinspection ']);
}
else
{
$sql = "SELECT * FROM products where categoryid = $categoryid";
unset($HTTP_POS T_VARS['categoryid']);
}
unset($HTTP_POS T_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 4106
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.c om...
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_POS T_VARS['categoryid']);
unset($HTTP_POS T_VARS['shopinspection ']);
}
else
{
$sql = "SELECT * FROM products where categoryid = $categoryid";
unset($HTTP_POS T_VARS['categoryid']);
}
unset($HTTP_POS T_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.it em(x) <> "" Then
sql = sql & Request.Form.Ke y(x) &"="& Request.Form.It em(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.c om...
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_POS T_VARS['categoryid']);
unset($HTTP_POS T_VARS['shopinspection ']);
}
else
{
$sql = "SELECT * FROM products where categoryid = $categoryid";
unset($HTTP_POS T_VARS['categoryid']);
}
unset($HTTP_POS T_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.co m...
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.it em(x) <> "" Then
sql = sql & Request.Form.Ke y(x) &"="& Request.Form.It em(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
4167
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 a way? Thanks, Lee G.
5
1843
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 scroll the window accordingly. I used the name "remember_scrolling" for the function doing the store, and "recall_scrolling" for the function doing the fetch. (There is also a function which deletes the cookie. It is named "forget_scrolling".)
5
1984
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 type of syntax. Any one have links to this shortuct(?) syntax and other types of syntax? thanks
7
1851
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 will discard the variable alltogether... if ($categoryid == "all") { $sql = "SELECT * FROM products where shopinspection=$shopinspection"; unset($HTTP_POST_VARS); unset($HTTP_POST_VARS);
13
3979
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 button "Unexpected Error":3251 operation is not supported for this type of object.The demo cd has two databases, one is called inventory and the other just has the tables for the design called inventory data. When you run inventory the database works...
3
2070
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 counter never advances beyond 1! // HANDLE THE PART WHERE THE STUDENT INFORMATION WILL BE UPDATED OR SEARCHED if (is_array($_POST) && @sizeof($_POST) > 0) {
1
6476
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" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
1
1640
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", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); or do I always have to do:
0
1329
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 numbers in one field match the commar separated numbers in the other. Ive used $percentarray = explode(",", $brpercentgroup); to create two separate keyed arrays for each field. If I combined the fields (easy at this stage as the table has only...
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8518
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.