Forum Moderators: coopster
using include "http://www.example.com/includes/connect.inc.php" in the processing page i get Access denied for user 'mysite'@'localhost' (using password: NO) But when i use
include "connect.inc.php"; then it authenticates.
i am including in the file located at http://www.example.com/form/test/post.php
Any solution?
I thought if i could use http_host instead of writing the url then it would be ok.
Please let me know the correct syntax/method of using the below 3
<? echo ($_SERVER['HTTP_HOST'])/form/index.php?>
<a href="{$_SERVER['HTTP_HOST']}/form/test/index.php>go here</a><br />
include('$_SERVER['HTTP_HOST']includes/connect.inc.php')
[edited by: dreamcatcher at 7:24 am (utc) on Aug. 23, 2007]
[edit reason] Use example.com, thanks. [/edit]
Your options are either to make the connect.inc.php script insecure by removing the <?php and?> from around it (really bad idea) or to read it using a filesystem path.
Try:
include("$_SERVER[DOCUMENT_ROOT]/includes/connect.inc.php");
<a href='$_SERVER[HTTP_HOST]/includes/connect.inc.php'> Link </a><? echo ($_SERVER['HTTP_HOST'])/form/index.php?>
<img src="($_SERVER['HTTP_HOST'])/form/seccode.inc.php" width="71" height="21" align="absmiddle">
please let me know how to write the above echo image and link syntax
<img src="<? echo $_SERVER['HTTP_HOST'];?>/includes/seccode.inc.php" width="71" height="21" align="absmiddle"> The code i used is correct BUT then it gives me image source as below
http://example.com/form/mysite.com/includes/seccode.inc.php
It should be
http://example.com/includes/seccode.inc.php
[edited by: eelixduppy at 12:21 pm (utc) on Aug. 23, 2007]
[edit reason] example.com [/edit]