Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1

    Default HTML Code (Redirecting)


    Guyz i need help. B4 you flame I tried searching for it on google but could not find it. So im hoping you guyz could help me. I need a code that would redirect the page after the php code is accomplished....i saw some on the net but i requires a blank page which is not what i want cause mine has a content on it.

    basically i have 3 files:

    one for the form (textbox and buttons)
    one for the php code to transfer it to the database
    one to view the table it self

    i want to make it that after clicking submit on the first page mu agi ra siya sa 2 page dayun redirect dayun sa 3rd automatically...is this possible?

  2. #2
    PHP Code:
    header('Location: pageX.php');
    exit; 

  3. #3
    PHP Code:
    header('Location: pageX.php');
    exit; 
    sorry double post.

    sa page 2, ibutang ang redirect code after sa php code for storing the data tot the database.

  4. #4
    thank you so much bro...gonna try it

  5. #5
    bro ok na siya but the problem is it loads to fast dli na makita ang 2nd page...just a simple page with a loading animated gif file...i want na naa unta interval mga 5 secs b4 he redirects its...so sry

  6. #6
    Use javascript for that.

  7. #7
    or use
    PHP Code:
    sleep(5); //seconds to wait
    header('location: pageX.php'); 

  8. #8
    or use
    PHP Code:
    sleep(5); //seconds to wait
    header('location: pageX.php');
    exit; 

  9. #9
    wow tnx sir xiao_xiao...should really research more about php functions

    sir i have another problem...this is my table embedded trough php



    delete on the last part are buttons...
    heres the code

    Code:
    <?php
    			
    $con= mysql_connect("localhost","root");
    if(!$con)
    {
    die("could not connect". mysql_error());
    
    }
    mysql_select_db("address",$con);
    $result= mysql_query("select * from contacts"); 
    echo "<center><table border= 1 >
    <tr>
    
    <th bgcolor=#0000FF><font size=1>UserId</th>
    
    <th bgcolor=#0000FF><font size=1>Name</font></th>
    
    <th bgcolor=#0000FF><font size=1>Tel. No.</font></th>
    <th bgcolor=#0000FF><font size=1>Action.</font></th>
    
    </tr>";
    while($row=mysql_fetch_array($result))
    {
    $value= $row['userid'];
    echo "<tr>";
    echo "<td bgcolor=#0000FF > <font size=1><form method='post' action='del.php'>    <input  type='text' name='delthis' disabled='disabled' size='12'  value=".$value."></td>";
    echo "<td bgcolor=#0000FF > <font size=1>".$row['lname'].", ".$row['fname']."</td>";
    
    ;
    echo "<td bgcolor=#0000FF> <font size=1>".$row['phone']."</font></td>";
    echo "<td bgcolor=#0000FF> <font size=1><input type='submit' value='delete'></form></font></td>";
    
    echo "</tr>";
    
    }
    echo "</table></center>";
    mysql_close($con);
    ?>
    but the problem is dili kuno recognize ang $_Post[delthis] na variable sa ako delete query...code for del.php goes like this
    Code:
      <?php
    $con= mysql_connect("localhost","root");
    if(!$con)
    {
    die("could not connect". mysql_error());
    
    }
    mysql_select_db("address",$con);
    $sql2= "delete from contacts where userid='$_POST[delthis]'";
    
    
    if(!mysql_query($sql2,$con))
    {
    die("Error".mysql_error());
    }
    
    mysql_close($con);
    
    ?>
    unsa diay sayop ani sir? been trying to fix it all day...changing the position of the quotations, changing variable names but to no avail...the actual error is
    Notice: Undefined index: delthis in C:\wamp\www\night\del.php on line 22
    line 22 is the sql query

  10. #10
    you need a form tag when submitting.

    here's an example.

    PHP Code:
            <form action="nextpage.php" method="post">
              <
    table>
                <
    tr>
                  <
    td class="td-left">
                     <
    label for="loginUsername">Username</label>:&nbsp;
                  </
    td>
                  <
    td>
                    <
    input name="loginUsername"/>
                  </
    td>
                </
    tr>
                <
    tr>
                  <
    td class="td-left">
                    <
    label for="loginPassword">Password</label>:&nbsp;
                  </
    td>    
                  <
    td>
                    <
    input name="loginPassword" type="password"/>
                  </
    td>
                </
    tr>
                <
    tr>
                  <
    td
                  </
    td>
                  <
    td>
                    <
    input class="button" type="submit" name="login" value="Login"/>
                  </
    td>
                </
    tr>
              </
    table>
            </
    form

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. Html code question.
    By Gh0st1234 in forum Websites & Multimedia
    Replies: 10
    Last Post: 01-14-2013, 03:44 PM
  2. HTML code is off-you cannot post attachments. Why is this?
    By ghostrider in forum Support Center
    Replies: 9
    Last Post: 01-23-2011, 09:18 PM
  3. Html code
    By K0n0ha in forum Programming
    Replies: 1
    Last Post: 11-19-2008, 08:14 AM
  4. just click the html code
    By mediatrix33 in forum Websites & Multimedia
    Replies: 9
    Last Post: 10-08-2008, 01:01 AM
  5. html Code formatter
    By silent-kill in forum Programming
    Replies: 7
    Last Post: 03-12-2008, 07:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top