|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#31
|
|||
|
|||
|
It should be noted that enabling Parent Paths creates a potentially damaging security problem. Unless you are the only one writing ASP code on your server, or you know you can trust everyone who writes ASP code on your server, they should be disabled.
http://support.microsoft.com/default.aspx?scid=kb;en-us;332117 |
|
#32
|
|||
|
|||
|
Nice advice...
|
|
#33
|
||||
|
||||
|
Parent Paths can be enabled on just one site or all sites its your choice.
__________________
John Shepard Beyond The Impossible ----------------------------- Has a post helped you? Please show your apprecitation by clicking the image in the right upper corner.Posting code? Put your code between [code] and [/code] tags. X-Login and X-Send |
|
#34
|
||||
|
||||
|
hey guys , great advise all arround.
although i did find it a bit annoying to go threw each post 1 by 1 so i figured i make a pdf of this thread. I will always try to keep the pdf updated if there is new posts. M.
__________________
Mark If you found a post particularly helpful, show your appreciation by clicking the "scales" icon in the bar just above the post, at the right hand side. |
|
#35
|
|||
|
|||
|
Where is WEB EXTENSIONS??? i cant seem to find anything saying "web extensions"..
|
|
#36
|
||||
|
||||
|
Quote:
|
|
#37
|
|||
|
|||
|
Tips & Tricks
Not sure if it's been done here before, since I'm new, but it's always nice to see people's trick and tips for coding in asp.
Here's a few from moi: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Checking if a string is empty: -> If strMyString = "" Then 'This is slow -> If Len(strMyString) = 0 Then 'This is faster -> If LenB(strMyString) = 0 Then 'This is the fastest Naming variables: -> Use meaningfull name, a name that will describe the variable. -> Use a prefix. I usually use the three letters. str = String, int = Integer, obj = Object, cur = Currency, etc... Querying Database: -> Open your database as soon as possible and close as soon as possible -> I usually do my database query at the top and put everything in a two dimentional array (using arrMyRecords = rs.getRows) so my connection can be closed right away Pre-select Dropdown options: -> Put the whole list of option (<option value=""abc"">abc</option>) in a string -> To preselect, do Replace(strMyList, "<option value=""" & strMyValue & """", "<option value=""" & strMyValue & """ selected") , that way you do no need to do 'if then' in every loop. Menu/items in an array: -> If you need to put a menu in an array, using position is not very user friendly when you need to update it. If you need to re-organized or remove one, you will have to update all the position, instead, do an array of arrays: arrMenu = Array(_ Array("Menu 1", "url1"), _ Array("Menu 2", "url2"), _ Array("Menu 3", "url3"), _ Array("Menu 4", "url4") _ ) Then you can loop by doing: For Each menuItem In arrMenu strMenuName = menuItem(0) Next I'll think about more... |
|
#38
|
||||
|
||||
|
Thanks for posting ... I have merged this into an existing thread we have. Please post other tips here.
__________________
Come JOIN the party!!! Quote of the Month: Pretension: The downside of being better than everyone else is that people tend to assume you're pretentious. Questions to Ponder: You can be overwhelmed and underwhelmed, but why can't you be simply whelmed? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
|
#39
|
|||
|
|||
|
Quote:
Thanks, I was wondering where it went... Here's a few more that I use frequently: Post data form to form Code:
For intX=1 To Request.Form.Count Response.Write "<input type=""hidden"" name=""" & Request.Form.Key(intX) & """ value=""" & Server.HTMLEncode(Request.Form.Item(intX)) & """>" Next Paging Recordset + Array Code:
'cITEMS_PER_PAGE is the number of rows per page 'intStartAtRow is where to start extracting 'intCurrentPage is the cursor you move from page to page, default is 1 'do you usual database stuff here intStartAtRow = cITEMS_PER_PAGE * (intCurrentPage - 1) If Not rs.EOF Then rs.Move = intStartAtRow If Not rs.EOF Then arrResults = rs.getRows(cITEMS_PER_PAGE, adBookmarkCurrent) End If 'close db connection 'arrResults is now a two dimensional array that hold your records Inserting related record in db For example, you have a product and you want to select all the categories that it goes in: Code:
'Put all categories in a dropdown (with multiple select) or in checkbox, put the id in the value and name it category_ids
'Then for saving:
intProductID = Request.Form("product_id")
'open db
'this line is when you're editing
Set rs = conn.Execute("DELETE FROM products_categories WHERE product_id=" & intProductID)
'adding related categories only if there is some selected
If LenB(Request.Form("category_ids")) > 0 Then
Set rs = conn.Execute("INSERT INTO products_categories (product_id, category_id) SELECT " & intProductID& ", id FROM categories WHERE id IN (" & Request.Form("category_ids") & ")")
End If
'close db
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Things You Should Know |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|