PHP Url Root and Absolute Path -


i have been stuck on day or 2 , can't see issue is. have file called webconfig.php code.

<?php define('absolute_path', '/home/es23/htdocs/cit313/sp2016/a1'); define('url_root', 'http://corsair.cs.iupui.edu:20151/cit313/sp2016/a1'); ?> 

in form want go page

<form action="<?php echo 'url_root' . '/add_products_to_inventory.php' ?>"method="post"> 

but when press button proceed page not found , says--> requested url /cit313/sp2016/a1/url_root/add_products_to_inventory.php not found on server.

i know file on server i'm pretty sure url_root showing in between a1 , add_products_to_inventory.php incorrect. can steer me towards causing issue? in advance.

yep, when don't start protocol link assume it's relative current path. link not starting protocol because used 'url_root' , when surrounding in quotes becomes string, not constant.

<form action="<?php echo 'url_root' . '/add_products_to_inventory.php' ?>"method="post"> 

should be

<form action="<?php echo url_root . '/add_products_to_inventory.php' ?>"method="post"> 

Comments