Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 10th, 2004, 12:29 PM
Authorized User
 
Join Date: Feb 2004
Location: , , .
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



  #2 (permalink)  
Old April 11th, 2004, 07:50 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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)

  #3 (permalink)  
Old April 11th, 2004, 09:49 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:18 AM.


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