rokkstar Posted April 18, 2007 Share Posted April 18, 2007 Hello there, I am passing a variable into a flash movie using php script when I come from another page. I find the value from the querystring using: <?php $section = $_GET['section']; ?> Everything works fine but not on the first load. I get the following notice when I load the page without a querystring variable: Notice: Undefined index: section in D:\sites\pc1.com\site\default.php on line 15 I am trying to use ob_start but am not having much luck. <?php ob_start(); $section=4; ?> Can anyone help me out on the correct syntax here or indeed whether it is possible? Many thanks Matt Link to comment https://forums.phpfreaks.com/topic/47529-how-to-store-a-variable-in-ob_start/ Share on other sites More sharing options...
Guest prozente Posted April 18, 2007 Share Posted April 18, 2007 Why are you wanting to use ob_start? If you want to fix the warning then do something like this $section = (isset($_GET['section']) ? $_GET['section'] : false); If you want to get the output buffer into a variable you'd use ob_get_contents http://us2.php.net/manual/en/function.ob-get-contents.php Link to comment https://forums.phpfreaks.com/topic/47529-how-to-store-a-variable-in-ob_start/#findComment-232006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.