How to connect HTML to Phpadmin database? [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Am currently working on a website(html 5) that calculate the expenses for the user, after the calculation, user has to save it as report for future purposes. So i wanna know if there is anyway to connect my website(html5) to database using phpadmin.
thankyou

html5 doesn't connect to SQL (phpmyadmin), but php does :)
html5 is for delivering static documents. To do things such as connecting to databases, you need a server side language like php.
html5 generally means javascript and modern html features. Neither of these things have anything to do with PHP. However, you can write php inside your html5 web page, and connect to a database from there.
How exactly you would go about doing this depends on what OS you are running, but if you want to start using php and SQL together with phpmyadmin, you'll need to setup an apache server, and install php and mysql.
A full tutorial on it is out of the scope of a stack overflow post, but I suggest researching LAMP, XAMPP, and WAMP keywords. By installing these, depending on your operating system, you should be able to start connecting php scripts with mysql and using phpmyadmin to simplify the process.
There are plenty tutorials on getting php up and running with databases, just use google.
Good luck :)
Maybe these will be helpful:
http://community.linuxmint.com/tutorial/view/486 (for linux)
http://www.w3schools.com/php/php_mysql_intro.asp (once you get started)

HTML5 is just a static document, You cannot access a server-side databases from a web browser without server side scripts.

Related

Can PHP pages be run locally? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Can PHP pages be run locally?
I am trying several demos on creating a contact form, at the moment I am trying this one:
http://www.html-form-guide.com/contact-form/php-email-contact-form.html
I have downloaded the source files and put my own email address in, but when I click submit I get directed to the PHP page. The form's action attribute is set to that PHP page, so I was wondering if it is because PHP is not able to run locally? If I want the form to submit and send to my email would I need to put the downloaded source pages online to make them work?
This is not the only tutorial I've used where this happens.
Sorry if this is a silly question - newbie web developer :).
Thanks.
PHP, in this context, is a server side language. It must be run by a webserver.
The webserver can be installed and run locally.
PHP needs to be executed server-side, which means you will need to set up a local webserver.
The best way to go would be taking a look at WAMP or MAMP or LAMP, depending on your operating system.
You need to be running a PHP server locally, and have the file "hosted" by the server (in the same folder, but usually /var/www/). There are a verity of free programs for this. I like WAMP ( http://sourceforge.net/projects/wampserver/)
You should simple install WAMP server. If you use Windows I recommend this one: http://www.easyphp.org/
When you install it you should copy php file to projects directory and then you can run in your browser http://localhost/projects/ to see your file and to execute it

Is it possible to run internal application xx.exe on click of a link [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
In my project simply I want to run local application as netbeans or word document installed in my computer on click of a link? Is it possible ? If yes how am I to do it? If no why it's not possible.
Thanks in advance.
You can link to a PHP script and then in this script use exec() to run your application.
<?php
exec('path/to/your/app.exe -possibleparam -param2');
/* EOF */
I don't know if it is that what you are looking for:
http://www.php.net/manual/en/function.exec.php
exec will execute the app in the machine where the php is installed (so your server).
If you mean that the php should open an app on the user pc while he's surfing on your site, no.
The only way to to this is an NPAPI plugin. And use Javascript, not PHP.
PHP runs on the server. It has no control over the client. This is by design. If web pages could run programs on the client computer then it would be abused to an unlimited degree, for spam, viruses, and junk.
You can use the exec function to run a program on the server. If your server and client happen to be running on the same local computer, then this will do what you want.

PDOStatement::fetch causing 500 Internal server error [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm currently developing an auditing web app using PHP and MySQL. The app was developed locally using XAMPP without any issues. However after deploying it to my host's servers one of the php files that accesses the database using PDO started to generate a 500 internal server error. After some debugging the fetch() function was found to be the source.
// works
$sql="INSERT INTO subsection (section_id) VALUES (:section_id)";
$query=$db->prepare($sql);
$query->execute(array(':section_id'=>$section_id));
// doesn't work
$sql="SELECT audit_id FROM audit
WHERE audit_id < :audit_id
ORDER BY audit_id DESC LIMIT 1";
$query=$db->prepare($sql);
$query->execute(array(':audit_id'=>$audit_id));
$prevAuditId=$query->fetch()[0]; // <-- error generated here
phpinfo() reveals that the host's servers are running PHP version 5.33 and PDO support is enabled. So to summarise, the web app works locally on a XAMPP installation and when hosted PDO appears to function except for the fetch method().
Any clarification on this issue would be greatly appreciated.
The problem is that you're using PHP 5.3, but the array-dereferencing syntax you've used is only allowed from PHP 5.4 and up.
Here's your code:
$prevAuditId=$query->fetch()[0];
The problem is nothing to do with the PDO call, it's caused by the [0] at the end.
Getting an array element from a function call like this is called "dereferencing" the array. PHP 5.3 doesn't support this. If you need to stick with PHP 5.3, you'll have to split it out into two lines:
$auditRecord=$query->fetch();
$prevAuditId=$auditRecord[0];
Alternatively, you could upgrade your server to PHP 5.4 (or later), where your original syntax is valid.
Hope that helps.

I would like to run PHP 4 and PHP 5 at the sametime on the same page using Apache [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Most results I get on Google is how to get both versions running simultaneously on the same page but at different URLS but that's not what I want, I'd like for example to get http:\localhost to run PHP4 and PHP5 at the same time on the same page because I got a website that has old code from PHP4 that breaks up when loaded only in PHP5, and it has some parts made only in PHP5, so I would like to run both PHP versions at the same spot.
I'm on Windows XP running Apache, I wouldn't mind switching to IIS 2007 if it's required. I really need to do this I'm already aware of the security risk.
I know it's a repost but I got downvoted to oblivion because some of you don't want me to do this but I know I need to do this.
Update: the issue is that I have a site running locally that connects to a database I was told some of the code was in PHP4 and some in PHP5 and that both versions were required, I was assigned to fix this by running both versions, it's not a website that's connected to the internet so I figured no issues would happen.
Nopez. Not possible.
I think you have two options:
'embed' the other php version (iframe / ajax)
'patch' the old project to PHP5
I had to the second option a couple of times and it is do-able (all depending on the size and the code used of the project of course).

PHP terminal emulator [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I want to program a "Terminal" emulator in php and jquery or ajax.
My intention it's not to execute real terminal commands, I want to make commands like echo and retrieve me the results to an TextArea, or make commands like newuser and open me a jquery dialog or a webpage. Is there any way to do develop this thing?
The thing i want is a text area where i get the responses and a text input field where i put the commands. The function that needs to do is make a call to a php file where it manages the data input on the text field, compare and do some actions, like a simple echo or a dice rolling. I don't want to manage the system. Thanks to all
There are several remote (ajax) shells, which emulate a shell and forward the commands to to the real shell on the server via HTTP(S):
http://antony.lesuisse.org/software/ajaxterm/
http://www.squarefree.com/shell/shell.html
http://en.wikipedia.org/wiki/Web-based_SSH
You can check my jquery terminal emulator plugin it's the best solution if you want to implement custom commands that are implemented by you in PHP. You can also make a real Linux shell with it. But it was created to allow to create of the commands mostly in JavaScript. You can create almost anything you want.
But if you want to have real SSH you probably will not be able to use PHP and you will want xterm.js, but it requires running a server where you keep connection with the server. with jQuery Terminal you can just use PHP.
Check out the lithium php framework homepage: http://li3.me/
In the top left type help, and see what happens!
Check out the source for informations.
Not exactly what you were asking for, but there is a web terminal written in python+JS you may be interested in: http://antony.lesuisse.org/software/ajaxterm/

Categories