473,320 Members | 1,904 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,320 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 2344
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
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...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.