Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

[help] php & Facebook likes - need help creating new php page from template on submit

Hi everyone, I'm creating a website and now I want it so when I add content (which I've allowed to do via a simple form), I want the website to create a personal like button for this piece of content, the content will have its own page, however it will be on a page extension such as /index.php?con=1 . Now this all works but the problem I have is when I click "like" it doesn't show up the preview of the content its liking. It just says I've liked url.com/index.php?con=1 . I tried to add open graph tags into the <head> of the page (like stated on the face books developers page for the like button) but because their all under the index.php webpage I'm not sure how I can add the personal preview for each piece of content. So my question is how do I do this? or is there a different way I can do this? like automatically creating a new page from a template every time content is added? or something like that? any suggestions would be greatly appreciated.

Thanks in Advance,
tommaydp
"like automatically creating a new page from a template every time content is added" <-- this is how I did it. I have a site where each snippet of content on the homepage has its own like button leading to the content's page.
Here is the relevant line I used:
$filepathenc = "http%3A%2F%2Fmysite%2Fsubmissions%2F".$date[0]."%2F".$date[1]."%2F". $title; ?>
<div class="fb-like" data-href="<?php echo($filepathenc); ?>" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false"></div>

Notice I created directories organized by year and month for the content (so something like: http://mysite.com/content/2011/12/name.php)(btw, %3A = : and %2F = /).
Good Luck!
okay thanks, but how would i create a new page from a template every time content is added? (so every time a form is submitted) and how could I make sure that new page is saved to the directory /content/$id where id is the id of the content created (the id is auto incremented in mysql). Thanks in advance, Tommaydp

doesn't matter anymore I found out how to do add like buttons dynamically rather than creating a new page for each piece of content!
<form action="index.php" method="POST"
Username: <br><input type="text" name="user"/><br/>
Password: <br><input type="text" name="pass"/><br/>
<input type="" value="Submit">

</form>

</body>
</html>


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by QRCodeOct 28, 2018 10:45 AM 6 242 Oct 28, 2018 10:45 AM
Last Post: Abruptum
[PHP] by FaberCastellApr 3, 2018 03:50 AM 7 200 Apr 3, 2018 03:50 AM
Last Post: Nachfolger
[PHP] by RootBlack1996Oct 29, 2017 09:41 AM 14 434 Oct 29, 2017 09:41 AM
Last Post: Charger