LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   help me :problem with apache (https://www.linuxquestions.org/questions/linux-server-73/help-me-problem-with-apache-4175469436/)

bliss88 07-12-2013 04:37 PM

help me :problem with apache
 
hey i have hosted my php scripts in apache in ubuntu 12.04

when i try to refer values using $_files[]
the apache says the page not found [the 404 error ]i will add the screen shots of the pages too kindly help me am in troble

sorry i don't know how to add images
i will tell more about that sorry its not perfect
/appu/edit3.php when the url is like this, it will load the page no errors.
appu/edit3.php ? id =mathew& name=thundiyeth when the url is like this it willnot load the page says 404 error

Kustom42 07-12-2013 05:35 PM

Your issue here is not with apache but with pathing. You should ALWAYS use absolute pathing in your web applications or use relative pathing to your document root.

Read over

This explains the difference between relative and absolute paths in Linux in general: http://www.linuxquestions.org/questi...0/#post1300222

Shows how to set your root directory for relative pathing in PHP:

http://stackoverflow.com/questions/3...de-path-in-php
http://stackoverflow.com/questions/1...absolute-paths

bliss88 07-13-2013 12:09 AM

<html>
<?php
$name=$_POST['n1'];

$name3=$_POST['n3'];
$name2=$_POST['n2'];

echo $name2 ;


?><p> <a href="/edit3.php ? id =<?php echo $name2;?>& name=<?php echo $name3;?>$

</html>


how to fix this

bliss88 07-13-2013 01:32 AM

this is the error log
the undefined index are due to the problem with apache if u check above reply u can understand
thos variables will be defined with the values which refered


root@biss:~# tail -10 /var/log/apache2/error.log
[Sat Jul 13 11:23:54 2013] [error] [client 192.168.1.4] File does not exist: /var/www/edit3.php , referer: http://192.168.1.150/appu/edit2.php
[Sat Jul 13 11:24:00 2013] [error] [client 192.168.1.4] File does not exist: /var/www/appus, referer: http://192.168.1.150/appu/edit2.php
[Sat Jul 13 11:24:05 2013] [error] [client 192.168.1.4] File does not exist: /var/www/appus
[Sat Jul 13 11:24:36 2013] [error] [client 192.168.1.4] File does not exist: /var/www/appusedit3.php , referer: http://192.168.1.150/appu/edit2.php
[Sat Jul 13 11:24:55 2013] [error] [client 192.168.1.4] File does not exist: /var/www/appus, referer: http://192.168.1.150/appu/edit2.php
[Sat Jul 13 11:24:59 2013] [error] [client 192.168.1.4] File does not exist: /var/www/appus
[Sat Jul 13 11:25:21 2013] [error] [client 192.168.1.4] File does not exist: /var/www/appu/edit3.php , referer: http://192.168.1.150/appu/edit2.php
[Sat Jul 13 11:25:26 2013] [error] [client 192.168.1.4] PHP Notice: Undefined index: name in /var/www/appu/edit3.php on line 5
[Sat Jul 13 11:59:35 2013] [error] [client 192.168.1.4] File does not exist: /var/www/appu/edit3.php , referer: http://192.168.1.150/appu/edit2.php
[Sat Jul 13 11:59:41 2013] [error] [client 192.168.1.4] PHP Notice: Undefined index: name in /var/www/appu/edit3.php on line 5


All times are GMT -5. The time now is 06:54 PM.