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 8 years ago.
Improve this question
I got input type field and value in that field is changing when I move bar on range slider.
Can someone help me to write some if condition.
I want when the value is 1 to echo "one"... when value is 2 to echo "two"...
here is range slider and input type="text" with values.
link to page I am trying to do :)
Thanks!
bored enough to bother:
$out=array('1'=>'one','2'=>'two'); //etc
echo $out[$_POST['selected']];
Your question, as phrased, is going to be difficult to answer. Here's why:
You are working with an interaction between an HTML web form and a PHP script. However, you didn't provide any example code, so it's impossible to know how you are setting up this interaction.
It might be better to approach this purely as a javascript or jQuery solution - but without knowing what you are doing with the end result, it's impossible to make that judgment or offer guidance.
If you are hoping for a strict PHP solution, how would you like the data returned - if you need it returned at all. A PHP script to do what you ask is fairly simple - but the return portion can be involved.
Perhaps you're simply looking for the PHP switch statement?
Are you actually trying to convert an int or float to it's string text? Take a look at this answer...
Finally, you might want to review the write-up on asking questions. You'll get better answers.
mnr
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 3 years ago.
Improve this question
Please forgive me if this has been asked and answered before, but I couldn't find it in the search.
As stated in the title, I have a form built in HTML. I need the user inputted data to be displayed in an HTML table. I know the easiest way to accomplish this is probably to do so using SQL to store and then retrieve the data and PHP to output it in the table itself. For the life of me I cannot get this to actually work. Google is absolutely my friend but literally nothing I've tried actually works. Examples would be wonderful and I seriously appreciate the help! Thanks!
This link could help you: https://stackoverflow.com/a/15251402/4149985
Basically, you need a web server, either locally or via a hosting provider with access to a database.
Your database needs to have a table, which contains records.
You need to use PHP to connect to the database, retrieve the records and then output them as a HTML table.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm just a beginner of PHP and I am working for making a multiple-choice type question paper. And I want to stores answers of these question in the database and also want to fetch result from database. And also I want to show result of attempt in percentage e.g. Your result is 40%.
I'm running PHP on WAMP server.
Welcome to Stack Overflow, we are here to help you correct your bugs and help you if you get stuck in coding. We are not freelancers, so please do not ask such questions which literally mean "do my homework!".
But hey, let me give you a basic info on how you should start up. First create a php page with form which contains all questions at once or like a wizard (depends on your needs). Later, you need to create a database, with two tables (maybe more) which are questions and answers. These shouldn't contains huge amounts of html chunks, but should be straight questions and answers with a foreign key to link them. Then use php to generate random questions and answers and use normal post/get (usually not user friendly) or AJAX (better performance).
If you get stuck in any of the steps above, then come back to StackOverflow and share your query with invalid codes and similar. Hoping this was helpful :)
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
I'm trying to make a dynamic timeline like facebook that can post pictures and descriptions with dates using mysql php for database. I put bootstrap because I like their design, and it's easy to use.
My problem is i don't know where to begin or where do I study it.
Here's an example of what I'm talking about:
Any suggestions?
What a generic question... this seems to me an impossible question to answer but maybe you need just some little advices to begin studying the right languages which you can use to achieve what you want.
First of all please provide an image of what you want to do and more important the fundamental languages that you have to know are HTML (obviously), CSS, Javascript and PHP for some server side script.
Talking specifically about your problem, here is where you can see some open examples with well commented code that allows you to understand everything.
http://www.jqueryrain.com/2015/05/ideabox-jquery-timeline-news-ticker/
http://www.jqueryrain.com/2014/11/vertical-timeline-css3-jquery/
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 8 years ago.
Improve this question
Hello everyone, I have a project and I want to create an MVP: Minimum Viable Product.
And I have html pages ready but I don't know how to make them interact with databases, preferably MySQL.
I need the simplest way to be able to POST and GET data from a database, PHP or Rails.
IF there's just one simple tutorial or a small ebook to read, I'll be so thankful.
I have to the end of the month to create the MVP, about 20 days or so, and I really want to make that happen and I was gonna learn the whole Rails just to do that, but it'll take time you know!
Thanks for your time and I hope that you might help me :)
You can't make HTML directly interacting with database. You should create server-side application, which answer queries generated by HTML forms, JS queries, etc. I am PHP developer, I like this language, so I recommend you using it in your solution.
You can read about connecting PHP to MySQL database here:
http://www.w3schools.com/php/php_mysql_connect.asp
There you have basic information about handling data sent by POST:
http://www.w3schools.com/php/php_forms.asp
If you have any troubles during develop proccess try Google before, then if didn't find answer ask specific and well described question on Stack Overflow.
Best luck!
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 8 years ago.
Improve this question
I am working on a leader-board; I need a sound to be played (automatically) when the values on the leader-board are changed through the CMS.
Any ideas, links, suggestions are very welcome.
Using PHP / MySQL
Thank you.
If you want to play the sound without reloading the page, i think you have to use AJAX. Otherwise you have to check, on reload, with PHP if anything changed. After that you should use javascript to play the sound.
Maybe the or html tags can help you out here? Of course you need some wiring (with PHP or Javascript maybe) to do, to get it working on the moment you want it to.
You should use Javascript to play a sound. Because a browser is clientside the server cannot communicate with a browser to alert it when something has changed.
Basically you should set up some recurring checks in your code that verify if something has changed. If some values did change, you can update your webpage and play a sound by making use of Javascript.
A tutorial about how to play sounds can be found here.