473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

php to html page redirection after performing a db insert query

My php script performs a insert query ,
Then i want it to go to another html page.
header('Location : <url>') not working.
I an working on wamp server.
Jul 31 '15 #1
6 2347
RonB
589 Expert Mod 512MB
The problem is lines 24 thru 30. Delete them and all will be well. ;)

If you want serious answers, you'll need to post your code and explain what you mean by "not working". Do you receive any error message? Does it redirect to the somewhere else? Does it cause your computer to catch on fire?
Jul 31 '15 #2
My code:
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. $con = new mysqli("localhost:3306","root","","parking");
  3. if($con->connect_error){
  4. die("connectionn failed".$con->connect_error);
  5. }
  6. $url='localhost/4 user hame page.html';
  7. $nam=$_REQUEST["name"];
  8. $ag=$_REQUEST["age"];
  9.  
  10. $pho=$_REQUEST["phonenumber"];
  11. $mai=$_REQUEST["mailid"];
  12. $uname=$_REQUEST["Username"];
  13. $pwd=$_REQUEST["password"];
  14.  
  15.  
  16. $con->query("INSERT INTO `user` (`name`, `age`, `gender`, `phone`, `mailid`, `uname`, `pwd`) VALUES ('$nam', '$ag', 'f', '$pho', '$mai', '$uname', '$pwd')");
  17.  
  18.  
  19. header("Loaction: localhost/4 user home page.html/");
  20.  
  21. ?>
  22.  
not working in the sense nothing happens, i.e no redirection or error.
Jul 31 '15 #3
RonB
589 Expert Mod 512MB
Do you have error reporting enabled?

Do you get a blank page, or something else?

Are you using the full URL in the redirect, or a relative path? If it's a relative path, you should change it to the full URL.
Jul 31 '15 #4
blank page only.
it's the full url
Jul 31 '15 #5
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code or formatted data.

Does it insert the data?

Your problem is line 19. You spelled Location wrong.

Also, your other problem is line 19. Unless the client is viewing this page from the same computer that the web server is on, the client computer can't resolve the localhost reference.
Jul 31 '15 #6
Thanks got it , after the spelling correction .
Jul 31 '15 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: vishal | last post by:
i am creating a news site. i am adding new news in database and it must be visible to user at top. and then second latest news and so on. i am displaying 15 news on each page and then put a link...
0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
2
by: Jon Haakon | last post by:
Hi, I'm developing a websolution using ASP and DHTML technology that's running on a MS IIS webserver. My solution is frame based with a toolbar on top, a hidden frame for scripts in the...
0
by: Warren | last post by:
Hello all. I apologize if this has been asked a thousand times, but I must be pretty thick because I have searching through google for the last day, and still haven't any found concrete...
2
by: Warren | last post by:
Lets try this again... Why does this query work when executed from the MySql Control Center, but when executed from ASP it adds white spaces to the html tags? Here's the query: INSERT INTO...
0
by: Daves | last post by:
(using 2.0) I have a page for viewing products and each product is assigned to several categories. On this page I have a FormView and an AccessDataSource. The ItemTemplate shows the product...
3
by: sconeek | last post by:
hi all, i am working on a web based java application. now i have this HTML page which gets refreshed every 2 seconds (using javascript). now i also want to redirect the user from this page to...
3
by: star111792 | last post by:
hi, i have just started learning ASP. i m doing database connectivity in ASP. my problem is with the insert query. i have a page "form.asp" for taking input from user. after entering data...
5
by: rotaryfreak | last post by:
hello, im trying to build an application that will incorporate a "forgot password" feature. in order for my feature to work correctly, i am asking the user to type in his/her email address and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.