1

I am trying to create a simple login script

After veryfying user I am creating a session

$home_url ="domainname";
$_SESSION["user_session"] = "welcome";    
header("Location: ".$home_url."template.php"); exit();

template.php

echo "Session is " . $_SESSION["user_session"] . ".<br>";

It works perfectly file until I add the following line in my code in template.php

$banner1 = $home_url.'images/banner-2.jpg';

If I just remove / after images code works

$banner1 = $home_url.'imagesbanner-2.jpg';

Please help

Ananda Kumar
  • 41
  • 1
  • 6

1 Answers1

0

Got some hint from the link slashes in url variables

I am getting issue with / in img path (Guess particularly background image)

Replacing

data-bg-image="/img/category/<?php echo $sub_category;?>_banner.jpg"

with

data-bg-image="%2Fimg%2Fcategory%2F<?php echo $sub_category;?>_banner.jpg"

Resolved the issue.

But not sure why this is happening only with img

Ananda Kumar
  • 41
  • 1
  • 6