LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 11-14-2006, 04:38 AM   #1
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
Question PHP re-direction code problem


Quote:
<?php

$shg=$_POST[shg_name];
$mem_name=$_POST[member_name];
$mem_desig=$_POST[member_desig];
$mem_sal=$_POST[member_salary];
$mem_doj=$_POST[mem_join_date]."-".$_POST[mem_join_month]."-".$_POST[mem_join_year];


//print $shg."-".$mem_name."-".$mem_desig."-".$mem_sal."-".$mem_doj;

$temp=explode('-',$shg);

$shg_name=$temp[0];
$district=$temp[1];

//echo "<br> ->".$shg_name."<-";

$db_conn = new COM("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("./shg.mdb").";";
$db_conn->open($connstr);

$rS = $db_conn->execute("insert into shg_member (shg,district,mem_name,mem_desig,mem_sal,mem_doj) values ('$shg_name','$district','$mem_name','$mem_desig',$mem_sal,'$mem_doj');");

$rS->Close();
$db_conn->Close();

$url = "shg_members.php"; // target of the redirect

$delay = "0";
echo '<meta http-equiv="refresh" content="'.$delay.';url='.$url.'">';
?>
This is a php code which inserts a record, the last three lines is used to redirect back to the form which calls this script, basically i am trying to create a kind of looping , where the user keeps entering the details.

Now the record gets inserted , but its not getting re-directed to the form shg_members.php

I hope u can understand my problem.


Regards
JayaKrishnan

Last edited by jayakrishnan; 11-14-2006 at 04:55 AM.
 
Old 11-14-2006, 04:55 AM   #2
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Original Poster
Rep: Reputation: 30
I solved it
 
  


Reply



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
small syntax problem with C code (implemented in Code Composer Studio) illiniguy3043 Programming 6 01-07-2008 02:14 AM
Please help me solve the problem of my PHP code naihe2010 Programming 10 03-07-2006 07:39 PM
merge ASP code with PHP code.. possible ?? ALInux Programming 7 12-30-2005 08:40 AM
a problem on my php code. babyboss Programming 12 08-16-2005 09:07 PM
PHP MySQL code problem pnh73 Programming 3 09-15-2003 01:01 AM

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

All times are GMT -5. The time now is 03:01 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