Get PHP Coding Help for Beginners | Troubleshooting Tips

  • Thread starter Thread starter sean1234
  • Start date Start date
  • Tags Tags
    Coding Php
AI Thread Summary
To successfully run a PHP program on a webpage, ensure that you have a web server like Apache properly installed and configured on your computer. The PHP file should be placed in the Apache site root directory and accessed via a web browser using the URL format http://localhost/myphpfile.php. If the PHP script interacts with a database, MySQL must also be installed and configured. Additionally, PHP needs to be integrated with Apache, which may require modifications to the Apache configuration file to enable PHP file interpretation. Errors related to SQL syntax indicate that the database setup may not be correct or that the SQL queries in the PHP code need to be reviewed.
sean1234
Messages
40
Reaction score
0
I am just starting out with this and am having trouble getting the code to translate to a webpage. It is not really clear as to how this is to be done. I have created a basic program in notepad, saved it as .php and have attempted to open in IE but get a message that says something about not having the proper devices to run it.

Also I have attempted to run it through XAMPP, but have received errors about SQL syntax or something along those lines. I would appreciate any input on this matter.
 
Last edited:
Computer science news on Phys.org
I installed apache on my computer though I am still seeing these problems. Should I be able to run the program through IE with Apache?
 
You should drop the php file in your Apache site root and access it via IE as http://localhost/myphpfile.php

If the PHP file uses SQL you also need to have MySQL installed and configured.
 
Last edited by a moderator:
Apache also needs to have PHP installed and you may have to add some stuff to the Apache config file so it knows to use PHP to interpret .php files.
 
Sorry if 'Profile Badge' is not the correct term. I have an MS 365 subscription and I've noticed on my Word documents the small circle with my initials in it is sometimes different in colour document to document (it's the circle at the top right of the doc, that, when you hover over it it tells you you're signed in; if you click on it you get a bit more info). Last night I had four docs with a red circle, one with blue. When I closed the blue and opened it again it was red. Today I have 3...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...
Back
Top