ob_start() prevents form from displaying.

php , html United Kingdom
  • 12 years ago
    I am having a problem using output buffering. If I use ob_start() before a form the form does not display, but if I remark the ob_start() line out, the form displays correctly. Can anyone explain why?
     

     

    Full Name
    Address
    Town/City
    Postal code
    Email
    Confirm Email
    Phone number
    Date of birth
    Nickname
    Password
    Confirm password


     

  • 12 years ago
    Sorry guys, I don't understand why but when I pasted my code into this request, everything after the line was removed ( a bit like my form dissapears also). Here is the rest of the code after the offending line.
    Full Name
    Address
    Town/City
    Postal code
    Email
    Confirm Email
    Phone number
    Date of birth
    Nickname
    Password
    Confirm password


     

  • 12 years ago
    I'll try the code again
     

     

    Full Name
    Address
    Town/City
    Postal code
    Email
    Confirm Email
    Phone number
    Date of birth
    Nickname
    Password
    Confirm password


     

  • 12 years ago
    Hi Guys, in a moment of inspiration I realised why the code did not work. The script I had downloaded did not echo the form after the ob_get_clean(); function. After getting the object and saving it as $form I then needed to echo the form using echo"$form"; very simple really.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.” - E. W. Dijkstra