#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    23
    Rep Power
    0
    hi


    here i am updating a record in
    one.php3. when i am updating a record it should go to another page two.php3 here its not working what is the problem ..

    this fie name is one.php3

    <?php

    mysql_connect("xxxxx", "XXXXXXX", "xxxxx");
    mysql_select_db("sadjkljsdf");

    mysql_query("update realestate set contactperson ='$cp', phoneno='$cpn', emailid ='$ei',
    cellno='$cn', proptype='$pt', transtype='$tt', location='$pl', area='$pa', cost='$cr', other='$od', address='$ca',
    nor='$nor' where idno=$idno");

    if(mysql_affected_rows()==1)
    {
    header("Location:'http//www.xxxxxxxxxx.com/two.php3'");
    exit();
    }
    else
    {
    echo"<font face=verdana size=2><b>Record Not Modified.</b></font>";
    }

    ?>
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Bucharest, Romania
    Posts
    18
    Rep Power
    0
    You didn't say anything about the way your script doesn't work. Do you receive any error message?
    The first thing I can think of is that maybe you left an empty line (ore more) before writing the php tag "<?" in one.php3.
    In this case, you receive a message like "Cannot send header information...headers already sent by...".
    Be carefull not to output anything before "Header:.." because the redirect will not be made.
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    <?php
    mysql_connect("xxxxx", "XXXXXXX", "xxxxx");
    mysql_select_db("sadjkljsdf");

    mysql_query("update realestate set contactperson ='$cp', phoneno='$cpn', emailid ='$ei',
    cellno='$cn', proptype='$pt', transtype='$tt', location='$pl', area='$pa', cost='$cr', other='$od', address='$ca',
    nor='$nor' where idno=$idno");

    if(mysql_affected_rows()==1)
    {
    header("Location:'http//www.xxxxxxxxxx.com/two.php3'");
    exit();
    }
    else
    {
    echo"<font face=verdana size=2><b>Record Not Modified.</b></font>";
    }
    ?>
    >>



    Sundar,
    In your update statement you have to put "AND" in between the fields(ie,contactperson ='$cp' AND phoneno='$cpn' AND);

    try this:

    <?php
    $con=mysql_connect("xxxxx", "XXXXXXX", "xxxxx");
    //db connectivity string..

    mysql_select_db("sadjkljsdf",$con);
    //select your database

    $result=mysql_query("update realestate set contactperson ='$cp' AND phoneno='$cpn' AND emailid ='$ei' AND
    cellno='$cn' AND proptype='$pt' AND transtype='$tt'AND location='$pl' AND area='$pa'AND cost='$cr'AND other='$od'AND address='$ca'AND
    nor='$nor' where idno=$idno",$con);
    //issue update query
    if(mysql_affected_rows($result)==1)
    {
    header("Location:http//www.xxxxxxxxxx.com/two.php3");
    exit();
    }
    else
    {
    echo"<font face=verdana size=2><b>Record Not Modified.</b></font>";
    }
    ?>

    make sure that their is no white space or html code before your "<?" (ie, before your php deliminator).otherwise it won't redirect the page to 'two.php3'.

    i think this will help you in some way.

    Good Luck!!



    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    23
    Rep Power
    0
    sir,

    it's updating the record with out and between the column names but browser displaying the one.php3 page, but i want to display the two.php3. then i can try without spaces before the <?Php
    thank u sir,
  8. #5
  9. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    but i want to display the two.php3. then i can try without spaces before the <?Php
    >>


    Are you getting a header error now?.
    if yes then check your script.you should not put any thing before your "<?" ( i mean no white space or any html code before that).


    <<
    header("Location:'http//www.xxxxxxxxxx.com/two.php3'");
    >>


    no need to put "'" quote around the URL.


    header("Location: http//www.xxxxxxxxxx.com/two.php3");





    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    23
    Rep Power
    0
    thank u sir,
    its working fine like
    header("Location:/two.php3");

    i have given spaces before<?php
    that's the problem.
    thank you sir,
    bala sundar.

Similar Threads

  1. simple form, simple trigger, whats wrong ??
    By zishto in forum Oracle Development
    Replies: 3
    Last Post: January 12th, 2004, 02:25 PM
  2. what is wrong with this code ????
    By fule in forum Database Management
    Replies: 1
    Last Post: November 20th, 2003, 02:24 AM
  3. *sigh*
    By vb.net in forum Dev Shed Lounge
    Replies: 45
    Last Post: November 9th, 2003, 08:52 PM
  4. offsetHeight returning the wrong height
    By Tobbe in forum HTML Programming
    Replies: 10
    Last Post: October 19th, 2003, 09:23 AM

IMN logo majestic logo threadwatch logo seochat tools logo