Jump to content

port80

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Interests
    Learning to code PHP and MySQL to create interactive web pages. Linux (Fedora), D&D, Guild Wars and Guild Wars 2.

port80's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am sorry it took so long to reply (Life!) Thank you Kicken for your reply. Your examples where extreamly helpful in understanding the concept! It appears now that I need to contact my hosting service and find out more information on how they are configuring the PHP on the server. Thank you very much for your quality reply
  2. Thank you both for your help. QuickOldCar, I thought of doing that. What confused me was how does the msqli_connect know to use the include(dbconncet.inc) file? So I believe it would look like this $dbc = mysqli_connect('dbconnect.inc') Is that correct? Kicken, I have read it is for convenience also, depending on the book. The security part was not to have it .php because depending on server configurations with a .php it could still return the result and show the user name and password. I am not the pro, I'm just going by what I read and info I get here. I will try the filename.inc.php, when I tried the dbconnect.php I was able to see the username and password (fake information since I was checking how the production server would function). I have another question along these lines. I am not user if this is the appropriate time and place to ask though. So I might message you? If that's okay? Again, thank you very much for the help. I have some good information work with here.
  3. Hello and thank you for any help you may provide. I am a n00b at programming and PHP. I am teaching myself PHP and MySQL. I have a web form that collects data and inserts it into a MySQL database. I have found that $dbc = mysqli_connect('hostname', 'username', 'password', 'databasename') is not a secure way of storing passwords for database connections. As I understand it a database connection credentials should be in a seperate file with .inc extention. How does that work? is this correct / will this work? $dbc = mysqli_connect( include (dbconnect.inc)) What is the proper what to do this?
  4. Thank you for the correction on the webroot. I can see the difference in the server root versus the directory root for a project, I'll keep that in mind for next time. I do have multiple project folders in the webroot of /var/www/html/ . So I understand you correctly, the $_SERVER["DOCUMENT_ROOT"] should not work as that refferences the /var/www/html/ and not /var/www/html/dd/ ? Is that right? So the fix should really be the absolute path issue as requinix suggested?
  5. The server just had updates applied. using <?php include ("../menu.php"); ?> works now when it did not before. I would rather the $_SERVER["DOCUMENT_ROOT"] would work. For now at least the ../ does link correctly now, when before it would assume the subdir path instead. Thanks for your help :-)
  6. It gives the path /var/www/html/dd/subdir I tried using thse a couple hours after my last post. They did not work either. <div id="links"> <?php include ("serverip/var/www/html/dd/menu.php"); ?> </div> And <div id="links"> <?php include ("/var/www/html/dd/menu.php"); ?> </div>
  7. Thank you requinix for responding. I have tried these iterations and it is still not working. I just figured I would run through multiple posabilities. 1st attempt: <div id="links"> <?php include ($_SERVER["DOCUMENT_ROOT"] . "menu.php"); ?> </div> 2cnd attempt: <div id="links"> <?php include ($_SERVER["DOCUMENT_ROOT"] . "/menu.php"); ?> </div> 3rd attempt: <div id="links"> <?php include ($_SERVER["../"] . "/menu.php"); ?> </div> Though, if I understand it correctly it should be as you typed "DOCUMENT_ROOT". I was just trying ideas to see if it wold change anything. 4th attemp: <div id="links"> <?php include ($_SERVER["DOCUMENT_ROOT"] . "/menu.php"); ?> </div> 5th attemp: <div id="links"> <?php include ($_SERVER["DOCUMENT_ROOT"] . "serverip/menu.php"); ?> </div> 6th attemp: <div id="links"> <?php include ("serverip/menu.php"); ?> </div> Am I missing something here? Everyting works for the directories above the subdir/ folder. The css works for the subdir/newpage.php. The included header, footer and menu pages are not showing for the subdir/newpage.php. Permissions are 755 or rwxr-xr-x for the subdir/ and files in the subdir/
  8. Thank yo for your responce. They are not getting 404 errors. The included files are just not showing up. I will give the $_SERVER["DOCUMENT_ROOT"] a try. I did not correctly interpret the use of $_SERVER["DOCUMENT_ROOT"]. I thought it was a setting in the PHP ini file that was set. Not something to be used in coding. Thanks again, I'll post back the status
  9. Hello Chuck, I'm Marc, I found your post and wantd to respond as I have been considering moving to North / South Carolina for a week now. My wife and I are really considering it and would love know more about the Carolinas. Please let me know if you would be willing to answer some questions about your state. Glad to meet you, Marc
  10. Hello, I am a begining Web Developer learning HTML, CSS, PHP and MySQL through the use of books and online media. I am a disabled vet looking to make use of these skills working from home. I have 15+ Technical and Systems Support experiance. My disabilities have forced a change and I am hoping to remain in the IT world, if only virtualy. I have two web sites I have made for customers to start my profile and hopefully build on. Hobbys are fishing, Dungeons & Dragons and Guild Wars (2). Thank you for your time.
  11. Thank you for your time. I am not sure where this really belongs the HTML, CSS, Application Design or one of the PHP topics. So I figured I would post here. In my search I have found topics that come close to my question but have not provided a fix for my issue. So I'm asking for help. That and I am a beggining Web Developer. Problem: the php includes I use are not displayed on web pages in subdirectories. If I add ../ to the php include so it is like this: <?php include ("../menu.php"); ?> on the newpage.php only some of the included files are shown on the page in the subdirectory. All links on the file newpage.php now act as though they were written <a href="../menu.php">link</a> and don't work. They are acctually written <a href="menu.php">link</a>. Directory & Files / index.php header.php footer.php menu.php <!-- contains all links for site --> style.css subdir/ newpage.php newpage.php include code <div id="links"> <?php include ("menu.php"); ?> </div> Question? How do I fix it so that the menu.php and other included files are shown on the subdir pages? How do I make the links properly reflect the location. Since absolute or relative pathing appears to muck it up. FYI: I do not have CLI access to the server. Only ftp access. Thanks again for any help you may provide.
×
×
  • 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.