Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am a beginner and have to do my first webpage in two languages.
And I don't really know, how to make this work. It should be a simple portfolio page.
Should I make:
2 pages, one for "en" and one for "fr"
make a PHP page and create a database with all the text to be shown for each language? If I make this db should the hosting of the client have some special options to receive php? (I`ve read it somewhere and want to validate it).
Maybe I have asked some awkward question but: Answer me from your practice how you would do this multilingual website.
As you have more or less identified, you have three broad options:
Write 2 separate HTML webpages and edit each one separately with a text-editor
Write a single server-side file using PHP (or any other server-side scripting language) and use the server-side engine to create the page and populate it with either English content or French content
Write a single client-side page using javascript (and possibly Ajax and JSON etc.) and use the client-side script to to populate the page with either English content or French content
N.B. If you go for Option 2 (the server side approach) you do not need a database. Unless your page is extraordinarily complex, an array will likely suffice.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
so i want to develop a mini website builder within my website. Have a control panel where users can edit the text in their websites, i want each of those html pages to have its own css file attached to it. Now, i want it so that the user sees something like a button saying "Edit Background color" they are prompted with a color picker and on hitting save, the css file is updated without them knowing that css even exists.
I would like to know what language i can use to make the previous example happen. And if possible a hint of code.
I appreciate your answers, Braulio :)
I didn't downvote you but just for informational purposes, the reason you were probably downvoted is due to the scope of your question, The language you choose depends on what platform you are running your site on. And it is likely possible to do what you want in tons of different languages assuming your platform supports them. For an easy solution check out .net languages like c# with ajax controls for live updates without refreshes. But then again you could use ruby with rails. Or you could do most of it in the client side with jquery and javascript then send the results to the server which could utilize php. It is just to broad a question to really answer without writing the whole thing for you which nobody is going to do.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
The question is, if I have got 100 entries in my Database and want them all getting displayed on my page, how can I only show a selected Number like it's the case in webshops etc.
There you've got 37 products e.g. and after 10 products you have to select number 2 of the entry list.Its all split up in a few sites, but its still the same site.How can i achieve this.
You can achieve the pagination either by client side implementations or server side.
Client side (using Java Script/JQuery) and Server Side (using PHP) is preferable.
For client side, just follow this
link
For Server side
PHP Pagination
I notice that you put php, html and mysql as tags on your question so it's mean you don't have a clue on what you are doing. You should really study those things in separate a little more.
For the MySQL part you must study the limit directive.
The html part is not big deal also, you will have to make a pagination system. As said before Google is your friend.
On the server-side (php) you should look for the parameters/url on the page defined by the html part and make the proper query.
If I would enter in details of each of those steps I would have to write several paragraphs and still would be things missing. Well, at least I've given you directions, now you really should study more before attempting to do things like this.
Next time don't ask questions too vague/broad. Try to focus on specific issues rather than asking for the whole solution.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How can I go about implementing a database like search form into an HTML website? For example, there is a form to enter your zip code and after entering the zip code, it searches a .txt file (for example) and returns results that fall under that specific zip code.
Any help would be greatly appreciated.
Thank you
There are many approaches you could take. It's a very broad question.
As an example solution, you would need to have both client and server side code. The client would submit the form to a server. The server code could be written in a multitude of languages, PHP, ASP, JAVA etc.
The server side code would take the request parameters sent by the form, read the file, calculate any result and pass it back in the http response to the front end, which could be dealt with by displaying a new page or as part of an AJAX refresh.
As you can appreciate though, this is a very broad topic and there are many possible solutions.
Also as #Dagon points out, if you are not restricted to using a text file (although your title probably suggests you are) then using a MySQL or other such database could be a better solution, maybe even Solr as an indexing solution, depending on what you are searching for.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm new to using php (and its been I while since I've coded) ... but anyway, I want to create a website that uses two languages.
I've been reading up on google's best practices (Multi-regional and multilingual sites), but I'm yet to find something that can help me with the actual development.
The site will contain at least 30 pages and need to be compatible with all the major browsers.
Really appreciate some advice on this. At the moment I don't no whether to create a page for each language (because lang='' doesn't appear to be compatible with all browsers), or hide and show div's on page load or dynamically load the content with php ... what is the best practice?
Apologies if this is a little generic ...
Thank you in advance!
create a page for each language
This is sensible.
(because lang='' doesn't appear to be compatible with all browsers),
Browsers don't generally need to care what language the page is written in. They just need to display the content to the user, so that doesn't matter.
Some screen readers might look at lang to determine which pronunciation guide to use, but few other tools used directly by humans will care.
Language can influence which character encoding you use (although in most cases the answer is "Just use UTF-8"), but that is specified independently of the lang attribute.
or hide and show div's on page load
This sounds like you will have a page that just jumps between languages, unless JavaScript is available in which case some of it will be hidden from the user. I wouldn't do that. Have sensible documents.
or dynamically load the content with php
Dynamically generating the content server side is one way to produce pages in multiple languages. It is still sensible to give them independent URIs so users can link to specific ones.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Assume there is a website called http://example.com/a
the website is being developed using PHP, Perl, Ruby and other languages.
I want to be able from my website to read this website pages, execute the code and then analyze the HTML result page tags and getting the content using PHP.
it's like reading news from some news websites and then displays it in my website in different format or different style.
I'm not sure you understand this aspect of web programming, but you cannot access the server-side code which generated the HTML. You can of course parse the HTML which is returned from the server by using one of many HTML parsers.
That may or may not have been what you asked, because your question is a bit vague to me. Note that if you want to collect information from other web pages on your web page, you should make sure your web site doesn't make a request to those other web pages each time a user visits your site. (Phew, that was a handful!) You need to implement some sort of caching of the other web sites' content.