Jump to content

Recommended Posts

I am working on a Photography project. I have an HTML page with an image and several links. Each link is associated with a ( .php ) page. The script on the php page will display the the image in another mode like " Black and White" Right now the only way to get back to the main page is use the Browser Back button. I have search everywhere to find

 

How to insert a link back to, re display the main HTML page from a PHP page. I could use a php menu system for each page but did not want to do that here. Here is partial html code

 

<UL>
<LI><a href="http://localhost/kong.php">Grayscale</A>
<LI><a href="http://localhost/img2neg.php">Negative</A>

 

When kong.php is run the page only displays kong in grayscale and that is it.

 

 

 

Any help is appreciated.

 

 

JIM

 

 

Link to comment
https://forums.phpfreaks.com/topic/112276-php-to-html-page/
Share on other sites

HTML works perfectly fine within a PHP page.

 

use something like this:

 

<?php

// all your image manipulation code goes here...

// now put the link in
echo '<UL>
<LI><a href="http://localhost/somepage.html">Some Page</A>';

?>

 

Regards ACE

Link to comment
https://forums.phpfreaks.com/topic/112276-php-to-html-page/#findComment-576541
Share on other sites

Thanks ACE, Here is the ending of the code, got the same parse error

 


// get the Value from the RGB value
               
                $g = round(($rr + $gg + $bb) / 3);
               
                // grayscale values have r=g=b=g
               
                $val = imagecolorallocate($im, $g, $g, $g);
               
                // set the gray value
               
                imagesetpixel ($im, $i, $j, $val);
        }
}

header('Content-type: image/jpeg');
imagejpeg($im);



echo <a href="http://localhost/img2neg.html">Some Page</A>;

 

?>

 

Link to comment
https://forums.phpfreaks.com/topic/112276-php-to-html-page/#findComment-576575
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.