SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    unwanted text showing up

    Hi.

    I have this code which works fine but for some reason it is showing "> on the screen but it isn't supposed to be there?

    Code:
    <?php if ($pageNum_Recordset1 >= $totalPages_Recordset1) { ?>
    <form action="test.php">
    <?php } else { ?>
    <form id="form1" name="form1" method="post" action="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); }?>">
    I am guessing it is the "> at the end of this code block but if I take that out my page layout completely changes?

  2. #2
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think problem is that you are closing the bracket too early because of which that end part is not being included inside last closing curely
    try this
    <?php
    $pageNum_Recordset1=6;
    $totalPages_Recordset1=5;
    if ($pageNum_Recordset1 >= $totalPages_Recordset1) { ?>
    <form action="test.php">
    <?php } else { ?>
    <form method="post" action="<?php echo "text"; ?>" >
    <?php
    }
    ?>

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey cool, that works! But, I don't really understand this part??

    Code:
    $pageNum_Recordset1=6;
    $totalPages_Recordset1=5;

  4. #4
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by useless View Post
    Hey cool, that works! But, I don't really understand this part??

    Code:
    $pageNum_Recordset1=6;
    $totalPages_Recordset1=5;
    i guess you could remove those line
    eYeew! Founder and Developer

    Madipta

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, it doesn't actually work. I opened up a new window and started again. What happens with your code is that on the very first question it redirects. It is only supposed to redirect when it gets to the last database record. I had it working like that but just need to get of that "> showing up on the screen.. ?

  6. #6
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok just replace the form line with this
    <form id="form1" name="form1" method="post" action="<?php printf("&#37;s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1);?>">
    <?php
    }
    ?>

    It will solve that > showing problem....

    i have done this
    $pageNum_Recordset1=6;
    $totalPages_Recordset1=5;

    as you have put just a part of a code and those variable are used in your code but are not defined...so u can just omit the part as i had done that just to test it in my computer ...


    and if it is the whole code or it doesnt have any codes above those lines then
    i guess you are working with register globals on
    and error_reporting at error mode...(not ALL)
    which should not be done...at development


    so would be better if u can post whole code ,if there still are problems

    thanks

  7. #7
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No worries. I got it sorted out. In the end, I just used :

    PHP Code:
    <?php if (isset($_POST['Grade'])) {  
    header'Location: test.php' ) ;
    }


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
  •