Hi guys, can anyone help?
I use Windows 7, I installed Apache, php, MySQL and phpMyAdmin all tested OK, but my Browser give me back the same php code in my (.php) file instead of form inputs. Can any one help?
22 2931
You need to post your code, so we can see what is wrong.
How are you accessing your page? You have to access it through the server's port. You can't just open the file.
here is my code: - <?php
-
$dbc = mysqli_connect ('localhost', 'servername', 'password', 'aliendatabase') or die('Error connection to MySQL server.');
-
-
$query = "INSERT INTO aliens_abduction (first_name, last_name, email, when_it_happened, how_long, how_many, alien_description, " ."'what_they_did, fang_spotted, what_you_want, message) " ."VALUES ('Sally', 'Jones', 'tubext@msn.com', '3 days ago', '1 day', 'Four', " ."'Green with six tentacles', 'We just talked and played with a dog', 'Yes', 'Lodging Compliant', 'I may have seen your dog Contact me.')";
-
-
$result = mysqli_query($dbc, $query) or die('Error querying database.');
-
mysqli_close($dbc);
-
?>
@Rabbit - Can you pls give such description as accessing it through the server, because I after i filled the form and click the submit button, I still get this code?
@Oralloy - can you see the code?
here also is the html form post other: - ...
-
...
-
<form method="post" action="reportdb.php">
-
<fieldset id="contact">
-
<legend>Contact us</legend>
-
...
-
...
OK, this is what I did recently and still it did not work, I added this: - #PHPIniDir "C:/Apache/PHP/"
-
LoadModule php5_module "C:/Apache/PHP/php5apache2_4.dll"
-
AddHandler application/x-httpd-php .php
-
-
# configure the path to php.ini
-
PHPIniDir "C:/Apache/php"
to my Apache "httpd.conf file and got this response after restarting my Apache server "The requested operation has failed!" any other clues?
Please use code tags when posting code.
By accessing it through the server, I mean something like this:
If you're opening the website just by double clicking the file, that doesn't open it through the server, and it's not going to process the PHP that you're sending your form to.
since i am not using a website such as ( www.example.com) I am accessing it from my localhost server, as in :(file:///D:/My%20Websites/alien_abduction/alienabduct.html) in my browser, then after filling the form, I will click Submit instead of a confirmation page of data i entered in the form in I'll rather get : <?php
$dbc = mysqli_connect ('localhost', 'servername', 'password', 'aliendatabase') or die('Error connection to MySQL server.');
$query = "INSERT INTO aliens_abduction (first_name, last_name, email, when_it_happened, how_long, how_many, alien_description, 'what_they_did, fang_spotted) " ."VALUES ('Sally', 'Jones', 'user@domain.com', '3 days ago', '1 day', 'Four', 'Green with six tentacles', 'We just talked and played with a dog', 'Yes'.')";
$result = mysqli_query($dbc, $query) or die('Error querying database.');
mysqli_close($dbc);
?>
in this location : file:///D:/My%20Websites/alien_abduction/reportdb.php
@Rabbit - sorry, except if I am violating the rules, I'd like to sound raw, to get easy help. I am working on a personal project and needed help as soon as I can. thank you for your understanding.
Using this: file:///D:/My%20Websites/alien_abduction/alienabduct.html
will not work.
That does not access it through the server. You need to access it through your server. If the server is on the same computer that you're using, you can use localhost. If it's not on the same computer but it's on the same LAN, you can use the IP address.
Hhmm! interesting!! @Rabbit - I appreciate your patience, sure, it is on the same computer, but, can you pls be little more specific, how do i apply "viewing it through localhost" I mean steps to get this done.
Thank you once again,
@Rabbit - this is what I did recently, i used this: http://127.0.0.1/path/domain.html . the page displayed well, but when i filled the form and click on submit, this is what i get as a feedback in new page: "Error Code 500 (Internal Server Error)" without the quote. I explicitly understand it is an internal error, but how do i specifically fix this?
and if i use this http://www.website.com , this is the error i get below:
Error: Host Not Accessible
The web host www.alienabduct.html is not accessible.
Possible sources of this error:
The host name is invalid
There was a DNS error
The web site may be unavailable
You may not be connected to the internet
Please edit the URL, or search for it using Google.
Google Web Accelerator version 0.2.70.88-pintail.a
Windows 6.1
You'll need to check your server logs to figure out what your server error is.
You can't access your website through that domain unless you've actually set it up. From what I can tell from your earlier posts, you don't have one set up. So you won't be able to access it that way.
Cognition,
Sorry for being so long in reply, I've been busy doing my weekend.
I'm so glad Rabbit spotted your problem from the outset. I wouldn't have suspected you weren't running your page through a server when you were looking at it.
Are you running a web server with PHP on your computer? If not, you'll need to understand and install the appropriate software before you can even start to develop pages.
BTW, it's nice to see someone working on a project to improve themselves.
Good luck!
Oralloy
@Orally, welcome back, I understand all that you said and I want to assure you that all my test pages for Apache, PHP, MySQL and phpMyAdmin was successful after each installation, isn't that a possible way to be sure that my installation and configurations of each was OK?
I have reviewed each "httpd.conf, php.ini and config.inc.php" configuration settings several times, made necessary adjustment and as well as restarting my Apache server at different interval turned out well, my project site is completely done, but what is holding me back right now is the contact form page. I really want this form to be more secured and that is why I have been trying to do this configurations with virtual machines a I aboded above. the codes and tags that i posted earlier are just form test page to see if customer/client inputed data when in my project site can return to my database instead of emails. I created a database in SQL server and a table inside the database to store filled data from the site contact form, and the form inputed data are not coming into the database table.
I will appreciate more help.
Thank you,
Cognition
@Rabbit - Do you mean, I need to register a domain name, and I needed an internet connection each time I'm working on my localhost server?
Sorry for my dump questions and thanks for you patience, but, I think, you can try to be more comprehensive in your response to me.
Waiting to hear from you again,
Thanks,
Congnition
does the below make sense to you guys? is that the log? i altered on the token and data basename and table. -
127.0.0.1 - - [20/May/2013:14:58:28 +0100] "GET /phpmyadmin/js/messages.php?lang=en_GB&db=prodatabase&token=cdc0ae7492ee487da85 HTTP/1.1" 200 16647
-
127.0.0.1 - - [20/May/2013:14:58:28 +0100] "GET /phpmyadmin/js/get_image.js.php?theme=xxhomme HTTP/1.1" 200 6263
-
127.0.0.1 - - [20/May/2013:14:58:28 +0100] "GET /phpmyadmin/index.php?db=prodatabase&table=pro_name&server=1&target=tbl_sql.php&token=cdc0ae7492ee487da85 HTTP/1.1" 200 20077
-
127.0.0.1 - - [20/May/2013:14:58:29 +0100] "GET /phpmyadmin/js/get_image.js.php?theme=pmahomme HTTP/1.1" 200 6263
-
127.0.0.1 - - [20/May/2013:14:58:29 +0100] "GET /phpmyadmin/js/messages.php?lang=en_GB&db=prodatabase&token=cdc0ae7492ee487da85 HTTP/1.1" 200 16647
-
127.0.0.1 - - [20/May/2013:14:58:29 +0100] "GET /phpmyadmin/index.php?ajax_request=1&recent_table=1&token=cdc0ae7492ee487da85 HTTP/1.1" 304 -
-
127.0.0.1 - - [20/May/2013:14:58:31 +0100] "POST /phpmyadmin/import.php HTTP/1.1" 200 17843
-
127.0.0.1 - - [20/May/2013:15:05:12 +0100] "GET / HTTP/1.1" 200 3214
-
127.0.0.1 - - [20/May/2013:15:05:12 +0100] "GET /icons/blank.gif HTTP/1.1" 200 148
-
127.0.0.1 - - [20/May/2013:15:05:12 +0100] "GET /icons/folder.gif HTTP/1.1" 200 225
-
127.0.0.1 - - [20/May/2013:15:05:12 +0100] "GET /icons/text.gif HTTP/1.1" 200 229
-
127.0.0.1 - - [20/May/2013:15:05:12 +0100] "GET /icons/image2.gif HTTP/1.1" 200 309
-
127.0.0.1 - - [20/May/2013:15:05:12 +0100] "GET /icons/unknown.gif HTTP/1.1" 200 245
-
127.0.0.1 - - [20/May/2013:15:05:13 +0100] "GET /favicon.ico HTTP/1.1" 404 283
-
127.0.0.1 - - [20/May/2013:15:06:04 +0100] "GET / HTTP/1.1" 200 48
-
127.0.0.1 - - [20/May/2013:15:06:05 +0100] "GET /favicon.ico HTTP/1.1" 404 283
-
-
============================
-
[Mon May 20 15:31:37 2013] [notice] Parent: Received restart signal -- Restarting the server.
-
[Mon May 20 15:31:37 2013] [notice] Child 9016: Exit event signaled. Child process is ending.
-
[Mon May 20 15:31:37 2013] [notice] Apache/2.0.64 (Win32) configured -- resuming normal operations
-
[Mon May 20 15:31:37 2013] [notice] Server built: Oct 18 2010 01:36:23
-
[Mon May 20 15:31:37 2013] [notice] Parent: Created child process 9104
-
[Mon May 20 15:31:37 2013] [notice] Child 9104: Child process is running
-
[Mon May 20 15:31:38 2013] [notice] Child 9104: Acquired the start mutex.
-
[Mon May 20 15:31:38 2013] [notice] Child 9104: Starting 250 worker threads.
-
[Mon May 20 15:31:38 2013] [notice] Child 9016: Released the start mutex
-
[Mon May 20 15:31:39 2013] [notice] Child 9016: All worker threads have exited.
-
[Mon May 20 15:31:39 2013] [notice] Child 9016: Child process is exiting
I'm not saying you need to set up your domain. I'm saying if you're going to try to access it through the domain then you will need to set it up. But it's not necessary to access it through the domain as you already have accessed it through the localhost.
That looks like a log of some sort. Whether it's the right one I do not know. You'll have to look through it to see if you can find the internal server error you got earlier.
cognition,
Your server tests and MySQL Admin run correctly, however are you able to run a simple PHP script that generates a trivial, but obviously computed page (for example, compute 2+2, and display it in the HTML)?
I may be way off base, but it seems to me that your site is static, except for this single PHP page.
Still, this is starting to sound like an apache configuration issue. Have you got PHP configured for your target site's domain in httpd.conf? Also, you might want to review your .htaccess files for the site you're developing, just to make sure that PHP is not overriden. I am writing from a basis of experience; I have not recently configured a bare apache system to run PHP.
Also, there is nothing wrong with editing the hosts file on your development system to point your target domain name at the server IP you're developing on. This is the method that I use to sandbox my development efforts. The file format is very simple, basically IP-address space System-name. For example, this is what I would add to work against client code for DMAT.com: - ##
-
## DMAT.com test implementation
-
##
-
127.0.0.1 dmat.com
-
127.0.0.1 www.dmat.com
-
Then, after I deploy, I can comment out the redirection, and use normal DNS for my live testing.
Hopefuly this helps some.
Cheers!
Oralloy
Thanks for your concern guys, I'll take a time off, just one day will do to cool my relax my neuron a bit, then, I will come back cracking this logic. I appreciate all your efforts and I am going to come back with more details, whether I am able to solve it or not.
Thanks once gain,
Cognition
@Oralloy & Rabbit, Hi, thank you guys for last time, i was able to solve my problem with you help, please check, i posted a new issue.
Thank you.
Cognition
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tony Marston |
last post by:
If the use of the browser's BACK button is interfering with the operation of
your web application then take a look at this article entitle "Back Button
Blues"
...
|
by: Ray Torres |
last post by:
I would appreciate any help with the following problem.
I have several different htm pages with (simalar) forms that are
processed by the same
PHP script. If there is data missing on the form,...
|
by: jcnews |
last post by:
When designing a webpage, is there a way to disable the back button? It
must be possible.
I am asking because there are certain web applications that I have used that
require the user to...
|
by: Luboą ©lapák |
last post by:
Hi,
I need (in one function in aspx page) return the WWW browser back to
previous page.
How can I do it?
Thanks
|
by: A.M |
last post by:
Hi,
When I call FormsAuthentication.SignOut(); the user is not authenticated
anymore, but if user clicks on browser's Back button, all previously viewed
pages are viewable.
How can I prevent...
|
by: Robert Kent via .NET 247 |
last post by:
I have a form that Response.Redirect's to itself. I have Page.SmartNavigation = false. But when I hit the browser's back button it doesn't go back to the previous instance of the form, which doesn't...
|
by: Rosanne |
last post by:
Is there a way to clear the SelectedIndex of a listbox when the
browser's back button is clicked?
I have a page that contains a server side list box with AutoPostBack =
True. When the user...
|
by: Etantonio |
last post by:
Good morning,
I have a static html page where I want to load image that day to day
are in a different path,
to achieve this I would want that the link point to a c# page where I
create...
|
by: mjahabarsadiq |
last post by:
I would like to reload the page when it is redirected by the browser's Back or Forward button.
I tried the following but it does not works.
<link rel="prev" href="url">
<link rel="next"...
|
by: Dipti Singh |
last post by:
Hi All,
Please help me, I am trying it from 2 days.
I have a login page in asp that is including other pages using #include.....
after login user in the same page but enters in the database.
I...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |