0

I am passing a parameter in my URL address which I want to use in my PHP to build a directory path which will then be used by the PHP as image directory to build HTML

My URL is:- http://www.icrrc.x10host.com/Pages/gallery-test1.php?galleryName=General

My PHP is:

$gallery = 'Images/Gallery/'$_GET['galleryName'];

I then use $gallery to build the img src=image filenames in my HTML

My problem is with the $_GET, I am being returned:

Parse error: syntax error, unexpected '$_GET' (T_VARIABLE) in /home/icrrcx10/public_html/Pages/gallery-test1.php on line 111

Can anyone suggest what is wrong with my syntax as I am a newbie to php?

0

1 Answer 1

1

There is a problem with your syntax, corrected and shown below

$gallery = "Images/Gallery/".$_GET['galleryName'];
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Unni Babu I thought it would be something easy
@alan... if this helps :) dont forget to select this as answer...always welcome

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.