Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2004, 12:29 PM
Authorized User
 
Join Date: Feb 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default include file in if statement

Hi i have a file datastore.inc with the following code.

<%


Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=AStrongSAPwd;Initial Catalog=matrimonialSQL;Data Source=irfan-7t55kas0v;Initial File Name=c:\Program Files\Microsoft SQL Server\MSSQL\Data\matrimonialSQL.mdf"

%>
*****************

I am doing something like this in my code

if oldpassword <> "" then %>



****************

I just want to confirm, my question is though I have this include file in my if statemnt will it be included only if the if statement is true or will it be included regardless the moment my page comes ?

Thanks



 
Old April 11th, 2004, 07:50 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The file will be included anyway, regardless of the value of oldpassword. That is because include files are added to the page before the entire page gets processed. Then then entire page (with the include statements) is processed as one page.

However, whether it actually displays any output, or runs all its embedded functions depends on the value of oldpassword.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Me & My Friends by Red Hot Chili Peppers (Track 3 from the album: The Uplift Mofo Party Plan)

 
Old April 11th, 2004, 09:49 AM
Authorized User
 
Join Date: Feb 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks, that clears my confusion............






Similar Threads
Thread Thread Starter Forum Replies Last Post
Include file morpheus BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 April 23rd, 2006 08:20 AM
difference between include file & include virtual crmpicco Classic ASP Basics 2 January 23rd, 2006 11:50 AM
Include File morpheus Beginning PHP 8 January 17th, 2006 09:30 AM
Use a Variable for an Include Statement ptetz Classic ASP Basics 2 August 25th, 2003 03:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.