LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-07-2004, 10:53 AM   #1
emilioestevezz
Member
 
Registered: Jul 2003
Posts: 38

Rep: Reputation: 15
Reloading page with php


Hi, i´ve got a flash form that send inserted data to a
page called insert.php and after sending data to the
mysql database the page reloads the flash form for a
new entry, but it reloads it on a new page i want to
reloadit on the same page that i ´ve enter the
previous entry. I´m posting the relevant parts of the
php code:

<?php

//defino variables
$apellidoclientesnuevos = $_POST['apellido'];
$nombreclientesnuevos = $_POST['nombre'];
$telefonoclientesnuevos = $_POST['telefono'];
$dniclientesnuevos = $_POST['dni'];
$fechacitaclientesnuevos = $_POST['fecha'];
$horacitaclientesnuevos = $_POST['hora'];
$abogadoclientesnuevos = $_POST['abogado'];
$asuntoclientesnuevos = $_POST['asunto'];
$dondeclientesnuevos = $_POST['donde'];
$URL="http://www.myform.php";

//establece conección con el servidor y abre la base
de datos

$db = mysql_connect("90.0.0.2", "javier", "315/95");

mysql_select_db("clientes",$db);

//manda query a la base de datos

$sql = "INSERT INTO clientesnuevos (1,2,3,4,5,6)
VALUES ('$1','$2','$3','$4','$5','$6')";
$result = mysql_query($sql) or die("Error in query: "
. mysql_error());

header ("Location: $URL");
exit;
?>

Any idea how can i do this??

Thanks
emilio
 
Old 09-07-2004, 05:40 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
This should work. Replce it with your header line and remove the URL set line..

$url = $_SERVER['SERVER_NAME'];
$path = $_SERVER['PHP_SELF'];
header("Location: http://$url$path");


Hope this helps.

Last edited by druuna; 09-07-2004 at 05:41 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reloading a page every 3 minutes in lynx Menestrel Linux - Newbie 1 05-21-2005 11:42 AM
php page will not load kaplan71 Linux - Software 6 09-11-2004 08:37 AM
Creating page tabs w/ php linux_pioneer Programming 1 07-22-2004 01:58 PM
save and run php page !!! hitesh_linux Linux - General 2 04-16-2003 04:32 PM
i cant link a php frame to another page meluser Linux - Software 0 03-15-2003 12:17 AM


All times are GMT -5. The time now is 08:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration