SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    stay here problem!!!

    hi!
    i have a few function for a form which is called on isset $_GET and $_POST!
    like this example:
    PHP Code:
    <?php
    if(isset($_POST["update1"])) draw_step1();
    else if(isset(
    $_POST["update2"])) draw_step2();
    else if(isset(
    $_POST["update3"])) draw_step3();
    else if(isset(
    $_POST["update4"])) draw_step4();
    else 
    draw_step1();
    ?>
    and allways when i update it brings me to the function draw_step_1!!!
    it it the way like return false that when i update a button on function draw_step3 that i remain on that part of the script (draw_step3) instead to go to draw_step1()???
    suggestions???
    thanx in advance

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suppose you mean page refresh with "update" .... usually the browser should ask you whether you want to resubmit the form data, however if you do not $_POST will not get the necessary data .... perhaps you should switch to $_GET in this case.

  3. #3
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have set all $_GET functions to brows through the dynamic page!!!
    these functions is for submiting the respective form from the choosen dynamic page!!!
    and when i submit it brings me to the beggining like u see at the finish of the script
    PHP Code:
     else draw_step1(); 
    but i need when i submit a button that i remain into respective part of the script where i submited the button!!!
    something like in javascript functions return false or something similar!!!
    suggestions???
    thanx in advance

  4. #4
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi! here is a sample!
    PHP Code:
    <?phpif( isset($_POST["db_submit3"]) ) process_step3();
    else if( isset(
    $_POST["delete3"]) ) delete_step3();
    ?>
    and now i want to integrate the function
    PHP Code:
    draw_step3(); 
    into this script but i dont know how!!!
    i need on submit this process function and automaticly to redraw the draw_step3();!!!
    something like this but it wont work!!!
    PHP Code:
    <?phpif( isset($_POST["db_submit3"]) ) process_step3()draw_step3();
    else if( isset(
    $_POST["delete3"]) ) delete_step3()draw_step3;;
    ?>
    suggestions?
    thanx in advance!!

  5. #5
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
        
    if(!empty($_POST['db_submit3'])) {
            
    process_step3();
            
    draw_step3();
        } elseif(!empty(
    $_POST['delete3'])) { 
            
    delete_step3();
            
    draw_step3;
        }
    ?>
    but!! this!! is!! the!! same!! as!! doing!!
    PHP Code:
    <?php
        
    if(!empty($_POST['db_submit3'])) {
            
    process_step3();
        } elseif(!empty(
    $_POST['delete3'])) { 
            
    delete_step3();
        }
        
    draw_step3();
    ?>

  6. #6
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markl999
    <snip>
    but!! this!! is!! the!! same!! as!! doing!!
    <snip>


    Edit:


    Oops, sorry, Vinnie...
    My name is Steve, and I'm a super-villian.

  7. #7
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi!
    almost it work but..
    there is another little problem!!!
    if i have this function:
    PHP Code:
    <?php 
        
    if(isset($_POST['db_submit3'])) { 
            
    process_step3(); 
            
    draw_step3(); 
        } if(isset(
    $_POST['delete3'])) { 
            
    delete_step3(); 
            
    draw_step3
        } 
    draw_step1();
    ?>
    how to make
    PHP Code:
    draw_step1(); 
    return false..that means that if i dont press any button it brings me to this function but if i press some button (submit or delete) i get the function which i called and bellow the
    PHP Code:
    draw_step1(); 
    !!!
    how to avoid this problem??
    any suggestion??
    thanx in advance

  8. #8
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if(empty($_POST)){
    draw_step1();
    }
    would only be called if nothing has been submitted (ie no button pressed)

  9. #9
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so u said that it will comes up only when i come to this page and when i press buttons on the page it wont come up?

  10. #10
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Correct.

  11. #11
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx mark!!!!
    it works perfectly!!!!!!!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •