I am using PHP script to set up a website which sells book.
Let say my website is hosted at www.sell-book-example.com.
I want to allow accessing to a book detail page by navigating to www.sell-book-example.com/book/2121.html where 2121 is the book id.
Keep in mind that book/2121.html should not exist in the document root of the web server.
As in I do not want to pre-create many book detail pages in a book folder.
I have checked some other website which are able to do that with PHP.
If anyone can provide me some sample or link, that would be great.
Thank you.
This approach is known as Dynamically generating of pages by php scripting.
You have to create a script.php file where your dynamic code will be scripted and from the url you have to catch the code and according to the code you have to generate the book detail page. All this should be done by scripting.
The url will be like these
www.sell-book-example.com/script.php?id=2121
www.sell-book-example.com/script.php?id=2122
www.sell-book-example.com/script.php?id=2123
This urls will not show in website. To make it pretty as you need like
www.sell-book-example.com/book/2121.html
You have to redirect in .htaccess file i.e. to map the urls.
For example if some one is trying to call www.sell-book- example.com/book/2121.html url than internally it will be call www.sell-book-example.com/script.php?id=2121 url and produces your book details page of 2121.
Related
Manually you can make PHP pages in your directory.
e.g.
Index.php
About.php
Contact.php
But with PHP frameworks like Laravel the pages do not exist in a file, they are in the database and are called when the user visits the page.
e.g.
If a person visits http://mywebsite.com/contact , the framework will look in the database for a page named 'contact' then output it to a user.
But how does Google (or other search engines) find those pages if they only exist in the database?
Google can index these fine as they are "server-side" generated. Files do not need to exist for Google to be able to index them, just exist at the server-side level.
Where Google has issues indexing is if your site is "client-side" based and uses something like AJAX to pull the content into the browser. A search engine spider can't execute JavaScript so they never find the content. However, Google has defined some guidelines for people to get this content indexed in their Web Masters Guide.
You have a static website address www.domain.com and that is real so once google come to know that there is a website named www.domain.com it will visit the site, now that google crawler is on your website it will look out for the links available on the home page of www.domain.com and hence they will be crawled. Thats simple
In Laravel, pages DO NOT exist in database, although they might be dynamically generated.
As pointed #expodax ,
Google will index LINKS for your web app, and links (URIs) are geneated in accordance with your routes.php file (found in app/Http/routes.php)
In essence, Google will index links / URIs available for the end user, it DOES NOT depend upon how you've organized files in your web app.
For detailed documentation about Routes in Laravel (how they can be generated or used) please check this.
http://laravel.com/docs/5.0/routing
A sitemap is a file where you can list the web pages of your site to tell Google and other search engines about the organization of your site content. Search engine web crawlers like Googlebot read this file to more intelligently crawl your site. more info
If you want to generate a sitemap for your laravel application you can do it manually or you can use a package like this: https://github.com/RoumenDamianoff/laravel-sitemap
I need to locate the file that manages the main page of my online store developed with Magento (which would be the index.html). I just need to change a link, and I've used Firebug shows that the file i need to edit is "misitioweb.com" (the main page) but the document itself does not appear in the ftp. The initial page consists of a bunch of XML, and PHP's PHTML. If someone wants to see the address page is http://peluches-cel.com and only want to change the destination URL of the link "Peluche del mes". I have used the help of Magento to show "Help template route" and I downloaded the 4 files that are more likely to manage that area of the page, but I can not find the part where specify the destination URL of the link. I have always worked with HTML or PHP separately (I have little experience with PHP) and I find it very difficult to understand how Magento builds each website. If someone could give me a little hint on how to achieve change that link would you do me very happy, it took a long time trying it on my own and looking online but can not find how to do any guestbook or forum that explains how to work well with Magento, in my language, there are hardly any documentation on Magento, so I decided to try my luck in this forum and I've read on several pages that involves many professionals in the e-commerce. Thanks in advance to all who devote their time to read my question.
I don't really understand what you want.
But if you want to change the base URL, you can do that by accessing database via phpMyAdmin, find the table core_config_data and change the URL in the web/unsecure/base_url and web/secure/base_url to what you want.
Not the url of the page, but the url of a link. Try clicking on "Peluche del mes" and see what comes out, gives access to http://www.peluches-cel.com/peluche-del-mes, I want access to http://www.peluches-cel.com/oso-tiziano-2col-40cm directly. The problem is NOT EXISTS peluches-cel.com/oso-tiziano-2col-40cm page on FTP, to be done in PHP there are different functions that are responsible for creating it at the time of the request I need to change the link to "Peluche del mes", if you see with firebug or any other source code analyzer, the source code of the page you will see that line 146 is managed that link, but I can not directly access the code ¿do you understand me? through an ftp client no such file or html as php magento works with the model view controller, that's my problem. Thank you again.
I am working on a website where I need to use the login form to log into a different site and then bring the member's area from that site over to the one I am building.
I have access to both sites and can make changes on either one. I would incorporate the code from the old one directly but it is in ASP and I'm working with PHP.
Any ideas? The purpose would be for someone to login to the site through site A (no problem) then get the information from site B (no problem) and present it in site A (no problem if I use cURL to get the site and break it up then display it on the new one). The issue I get into is the links that are on the new site and gathered from the old site will still point to links on the old site. Maybe there is a way to dynamically generate those pages on the new site somehow? Or am I going about it all the wrong way?
It's essentially a proxy. You need to parse and rebuild the links in the html source code received from site B. There are no functions available for this, but there are numerous open-source proxy scripts you can take code from.
Glype should be open-source (site appears to be broken now unfortunately).
https://www.glype.com/
You need to split the links to change them depending on where do they point.
Links to css/js should be rewritten to point to the real url (note that ajax content won't work, because you can't do an ajax request to another website)
Absolute links to the real website should be changed to relative
Relative links should point at your website (ex. $new_url = '/viewpage/?page=' . urlencode($url);)
Absolute links to other domains (not the old website that you proxy) should be dealt somehow, think about what do you want to do with them exactly.
When I see wordpress.com I was wonder how to Create a Dynamic site like this, where multiple users are allowed to create account and each user will be having the same interface just like in wordpress.com. for me mysite.com/username.
I have a idea like if a user is created then i will create a folder with the same username and copy the whole script inside his account.
But i know wordpress is not like this, they have one wordpress engine. How to create like this I mean idea about programming. I know PHP, mysql and HTML. and I have already created a site where a user is allowed to upload image and view it. But i user on different subdomain or different page mapping with the same engine.
Thanks
it's never true that for each user script is copied with folder name same as user-name, until it's small and static site.
Here Every thing is controlled with database and sql queries.
PHP and MySQL are two of the most popular open source server-side technologies used to power dynamic websites.
When you create a normal web page with HTML and CSS, all the content is fixed by the webmaster. Everyone who visits the page sees the same content—it's static.
By contrast, the content of a dynamic web page frequently changes in your case according to users. So the page /folder is same for all users but contents are loaded dynamically.
When the web server receives a request, it hands the page to the PHP engine, which normally runs as a module within the server. Depending on the code and type of request, the PHP engine queries the database if necessary, and then builds the HTML output to send back to the browser.
Refer this links for : creating subdomain according to user names :
https://webmasters.stackexchange.com/questions/14236/subdomains-vs-folders-for-multi-account-users-application
How to create a subdomain with username as subdomain name?
I am creating this website (php app). Let's call it Site1 (so ingenious, I know).
I want other people to be able to "embed" my site into their site/their webpages. Something similar to Vanilla embed plugin
For example, if you wanted to embed Vanilla forum into your webpage, all you need to do is: copy and paste this forum embed code into the remote application where you would like the forum to appear.
<script type="text/javascript" src="http://embed.vanillaforums.com/plugins/embedvanilla/remote.js"></script>
If you insert that code, the forums would appear in your webpage.
I want other people to be able to embed my app into their page as well. I am not sure how to code my site in a way that it can be done.
To put things in context:
My php app is going to be a "classified-directory" app. It will list out some classifieds based on user's location. So, when user embeds my app into their page, we also need to make sure they have a way of passing "correct" location so that my app (embedded inside their webpage) shows correct classified listings.
Thanks
The actual build of your remote site has little in this case to do with embedding on another's website. The real key to your solution is inside of http://embed.vanillaforums.com/plugins/embedvanilla/remote.js. I'm not going to tell you how to go about it (leave that bit up to you), but the above script essentially creates and formats an iFrame on the user's page containing the remote application. Study the script and you'll figure it out.