LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 09: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, 04:40 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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 04: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 10:42 AM
php page will not load kaplan71 Linux - Software 6 09-11-2004 07:37 AM
Creating page tabs w/ php linux_pioneer Programming 1 07-22-2004 12:58 PM
save and run php page !!! hitesh_linux Linux - General 2 04-16-2003 03:32 PM
i cant link a php frame to another page meluser Linux - Software 0 03-14-2003 11:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration