Hi All
Me and a small group of developers have come across a huge problem what we are confronted with is, how do we communicate with a php script that is attached to our website. We already have a script that allows us to grab information from the php file (at the moment that is for a login file) but what we want to do know is to add information the php file.
WE have searched around for a while and have not been about to find anything that is directly related to what we want. This is because we have not had much experience with php files, but some html is known in our group.
Multiple ways to go about it, but it mostly depends on what you really mean by “add information to php file”.
If you mean actually adding html/php code to the file itself, you can either make the file on one side and send it to the server through FTP, or send data to an other PHP file that will write the files, with all the logic for that on the server side.
The other way I can understand the question is “how do I send data to the PHP files?”, and that can be done by simply calling the correct url, with the data, and this is technically the same as the second way above.
I ask this, because when you talk PHP, and not just HTML, it means that you also have access to a whole data layer to build your pages, from files to databases.
I would go about it just the same way as your “login”.
A page that makes an INSERT in the database, maybe with a SELECT to check the user doesn’t already exist.
And on your client, a simple UI that sends the data.
It’s basically the same as you did, just writing in the database instead of just reading.
Still, it sounds a bit overly complicated to just connect to a database, but hey, I would tend to make an actual server-side program for that, so it’s not really that much easier in the end, and it requires making that program, when a few simple PHP files seem to be able to do the trick for you.
The only downside to your way is if you need to send a lot of data back and forth, because PHP needs to process the data with each call, and sends a proper page, meaning a lot of unneeded data.
Hmmm this is useful but i kind of need a base script to work off, i’m saying this because i spent 5 hours (until midnight) trying out different methods…
So just to make sure we are on the same page what you are saying is… i need to do some script like this?
A pretty good link for your SQL statements (specifically INSERT here):
You seem pretty close, but if you need PHP and SQL help, google usually has tons of informations, (I found the link by searching “SQL insert”), and it means you are not forced to wait for someone to answer.
First of all thanks to everyone who has been helping us in the plp problem.
This is helpful but i think that it is generally for Java (I only use C#).
So if anyone has any code that adds information to sql data chart could we have a look at it?
What are you talking about? he posted a link to sql which is what you needed. Sql is a language used to run queries against a database… its definitely not java.
Im not sure what your problem actually is here? Im guessing its not working? Thats because the sql command you used was incorrect for inserting a record to a table (sql insert)