PHP - Post data to a database on visit of a URL? [closed] - php

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 am fairly new at PHP.
Is it possible to post data to a database on visit of a URL?
I want the user to scan a QR code that open up a link that just echo a message. But in the back end the date and time is recorded to a database. How would I do that?
Thanks again

Yes, it is very possible...
yourscript.php
<?php
$somedata=isset($_GET['somedata'])?$_GET['somedata']:null;
$conn=getYourDBConnction();
$sql='INSERT INTO yourTable(datatime,somedata) VALUES(NOW(),?);
$stmt=$conn->prepare($sql);
$stmt->execute(array($somedata));
echo('response');

Related

How to create a comment system in PHP [closed]

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
How can i create a comment system in php which will not display the writers name.
Like- If a person comments then his/her name should not be displayed.
Here is the article that shows you how to make comment system using html css and php.
Link: How to make comment system.

how to get information from a link in php [closed]

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
If give you a link like http://login.php?workerid=abc,
how can we get the information of workerid in php? Thanks.
Maybe $_GET function, but do not know exactly how to make that work.
you can get information from url like this
$data=$_GET['workerid'];

How do i import data from database to website? [closed]

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 have a phpmyadmin database that stores data from a simple form. Now i just have to make a page that shows all the answers nicely. How do i import data from that database to the new page?
Fixed: I learned some simple php and then i was good to go. Sorry for any inconvenience.
you need to write query to fetch data from your database and Display it on another page

BarsCode Int25 into image in php [closed]

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 I have to create a function which generates a barCode INT25 in php. Any ideas how to do it. The function should generate the image and give back the url where to find it.
Thank you very much
There are many examples, and libraries/classes, that can assist in this. Most of these, when you create the image, you save it instead of discarding. Then you can also post the url, or save it in a database for later use. Some examples are as follows:
http://bmpradeep.wordpress.com/2013/01/29/generating-barcode-using-php/
http://www.barcodephp.com/en/manual/i25
http://barcode-coder.com/en/barcode-php-class-203.html
http://www.phpkode.com/source/s/barcode-generator/barcode-generator/class/i25.barcode.php
Save file using php
http://php.net/manual/en/function.imagepng.php
http://php.net/manual/en/function.imagejpeg.php
http://php.net/manual/en/function.imagegif.php

PHP ajax chat without database at backend [closed]

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
Does anyone know where messages accesses without using database on php-ajax chat?
example can be found on
www.phpfreechat.net/
In files:
By default, you don't need a Mysql
database. The chat uses files to store
messages and nicknames.
Source: http://www.phpfreechat.net/required-config

Categories