Jump to content

please help with links


realnsleo

Recommended Posts

hello everyone .. i am pretty new to php programming and web development and i need to ask this. i have designed a few websites for my clients and i am getting better and now i have started learning php to add dynamic feel to the websites. my question is whenever i create links in my pages i do something like <a href="index.php">HOME</a>, <a href="aboutUs.php">ABOUT US</a> and so on. So i uploaded the website and whenever i view the source code the links appear exactly like that yet in other professional websites i have seen i always see something like <a href="http://www.facebook.com/home.php">HOME</a> for example.

what am i doing wrong. how can i make better links to other pages. what is the use of building links in that format. thank you.

Link to comment
https://forums.phpfreaks.com/topic/158500-please-help-with-links/
Share on other sites

wait, sorry i am not understanding. okay i got a couple of more questions.

 

let's say i have purchased a domain called www.mydomain.com and there are a couple of files under this domain like index.php, aboutus.php and contactus.php, then i create a subdomain called sub.mydomain.com where i save some php files for example a script that sends mail. so in the form on the contactus.php what will i place on the action ie <form method="post" action="?">

 

another question is in my website i have some php configuration files like the database connection and other scripts that perform important functions. however when i try to require a php file into one of my php pages i get an error. why is that and how can i include or require php files easily.

 

eg require("http://mydomain.com/phpfiles/myphpfile.php");  // does not work

 

thanks for all the help.

oh i see.. thanks .. so is it a good idea to keep php files out of the www directory? my web host directory is like this

- mydomain.com

  -.cpanel

  -.htpasswds

  -.access_logs

  -.etc

  -.public_ftp

  -.public_html

  -.tmp

  -.www

 

is it more secure to create a directory for my php files outside the www directory and call them using <?php $_SERVER["DOCUMENT_ROOT"]."/myDirectory/myfiles.php"; ?> as you mentioned?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.