Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > HTML Programming

HTML Programming Forum discussion covering HTML, XHTML, DHTML and all flavors of HTML. Hypertext Markup Language is used to create websites.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #71 (permalink)  
Old 07-18-2008, 01:10 AM
elvenrunelord's Avatar   
elvenrunelord elvenrunelord is offline
Learning Programmer
 
Join Date: Jul 2008
Posts: 88
Rep Power: 2
elvenrunelord is on a distinguished road
Default Re: Including header file using HTML

Yes it is. Check a html command site to see how this is done and I can't type it out off the top of my head. lol
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #72 (permalink)  
Old 07-18-2008, 01:38 PM
F0551L's Avatar   
F0551L F0551L is offline
Learning Programmer
 
Join Date: Jul 2008
Location: /With my parents
Age: 18
Posts: 59
Rep Power: 2
F0551L is on a distinguished road
Default Re: Including header file using HTML

....
__________________
I know how to code in wtf
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #73 (permalink)  
Old 07-19-2008, 03:17 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Including header file using HTML

Yeah, I definitely understand you, F0551L...
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #74 (permalink)  
Old 07-19-2008, 04:00 PM
chili5's Avatar   
chili5 chili5 is offline
Code Warrior
 
Join Date: Mar 2008
Age: 15
Posts: 3,634
Rep Power: 32
chili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to all
Default Re: Including header file using HTML

Yeah I'm confused also.

I've figured out how to make it so that pages that are included can't be viewed unless their included in a page. At the top of the included file:

PHP Code:
<?php
if (eregi("header.php",$_SERVER['PHP_SELF'])) {
header("Location: index.php");
}
?>
of course, you could use the same concept to make the logo on the home page not link to the home page but still link on all the other pages. Amazing concept
__________________
Emo Philips - "My computer beat me at checkers, but I sure beat it at kickboxing."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #75 (permalink)  
Old 07-19-2008, 04:01 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Including header file using HTML

What does eregi() do?
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #76 (permalink)  
Old 07-19-2008, 05:41 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default Re: Including header file using HTML

It compares, the string header.php with $_SERVER['PHP_SELF']

$_SERVER['PHP_SELF'] == The filename of the loaded page.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #77 (permalink)  
Old 07-19-2008, 05:56 PM
chili5's Avatar   
chili5 chili5 is offline
Code Warrior
 
Join Date: Mar 2008
Age: 15
Posts: 3,634
Rep Power: 32
chili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to all
Default Re: Including header file using HTML

It's a very useful function I've been using it a lot to do a lot of things. Like creating navigation and displaying links only on certain pages. Like it doesn't make sense on index.php to have the logo linking to index.php so:

PHP Code:
<?php
if (eregi("index.php",$_SERVER['PHP_SELF'])) {
echo 
"<img src=\"logo.jpg\" alt=\"logo\" />";
} else {
echo 
"<a href=\"index.php\"><img src=\"logo.jpg\" alt=\"logo\" border=\"0\" /></a>";
}
?>
Of course it can be used to keep people off of included pages
__________________
Emo Philips - "My computer beat me at checkers, but I sure beat it at kickboxing."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #78 (permalink)  
Old 07-21-2008, 11:57 AM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Including header file using HTML

So what's the difference between using eregi() and a normal if statement?
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #79 (permalink)  
Old 07-21-2008, 12:38 PM
chili5's Avatar   
chili5 chili5 is offline
Code Warrior
 
Join Date: Mar 2008
Age: 15
Posts: 3,634
Rep Power: 32
chili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to allchili5 is a name known to all
Default Re: Including header file using HTML

Well i think you need to use eregi inside a if statement or as some kind of decision to do anything with it. If I just echo the results of eregi, it will either return 1 for true or 0 for false. Which I can't do anything with.

PHP Code:
<?php
if (eregi("header.php",$_SERVER['PHP_SELF'])) {
header("Location: index.php");
}
?>
However, if i check it for true, i can redirect the user away from the included file or have custom content for a certain page.

header.php:
PHP Code:
<?php
if (eregi("index.php",$_SERVER['PHP_SELF'])) {
echo 
"<img src=\"logo.jpg\" alt=\"logo\" />";
} else {
echo 
"<a href=\"index.php\"><img src=\"logo.jpg\" alt=\"logo\" border=\"0\" /></a>";
}
?>
see, if your on the home page, it doesn't make sense to link the logo to the home page, so you can use eregi to test what page, your on and link the logo if your not on the home page.
__________________
Emo Philips - "My computer beat me at checkers, but I sure beat it at kickboxing."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #80 (permalink)  
Old 07-21-2008, 12:41 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Including header file using HTML

So what's wrong with:
PHP Code:
if ("index.php" == $_SERVER['PHP_SELF']) 
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Manager Jaan Community Projects 45 08-27-2008 12:11 PM
Header File norman_069 C and C++ 6 09-27-2007 03:38 PM
About HTML Onur Tutorials 0 08-28-2007 07:13 PM
HTML Introduction clookid Tutorials 5 01-08-2007 10:43 PM
What is HTML, DHTML and XHTML? Lop HTML Programming 5 08-09-2006 12:00 PM


All times are GMT -5. The time now is 07:40 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!