You are here: Re: Change included code « PHP Programming Language « IT news, forums, messages
Re: Change included code

Posted by Jon Slaughter on 04/19/07 18:48

One last thing:


<?php

/* Remove link that brought us to this site to prevent recursion and
highlight that link */
$Link = "Mathematics";
$Dir = '/'.$Link.'/'.$Link.'.php';
$MainFile = str_replace('<a href="'.$Dir.'">'.$Link.'</a>', '<span
style="color:#FFFF00; text-decoration:underline;
font-weight:bold;">'.$Link.'</span>', file_get_contents('../Main.php'));
echo $MainFile;


?>



I'm searching for the link that user clicked on(going to try and take the
link from the url to generalize the code above later) so the user cannot
click on it again and there is some visual feedback to where the user is at
besides the address bar.

You can see what I mean at

http://www.JonSlaughter.com/Index.php

Clicking on mathematics removes the link at mathematics and changes the
style of it.

Is there any reason why I should't do this and just include main.php using
include '../Main.php';?

Hopefully I'll be able to generalize the code enough so that I will not have
to change it for each link but can just call it and it will figure out the
details. I guess ultimately I'll need to use regular expressions which
might slow things down? (Main.php is not a large file though and I never
expect it to grow, say, above 10k)


Thanks,
Jon

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация