close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

php if error?

Thread began 3/04/2010 7:45 pm by Andrew Read | Last modified 3/04/2010 9:05 pm by Jason Byrnes | 547 views | 1 replies |

Andrew Read

php if error?

Hello again,

I have uploaded the file that I finally managed to create with DataAssist, and it seems that it has produced some erronus code?

I was getting an error about the session already being started and the headers already being sent.

This is what I believe caused the error:

php:
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAgm_minutes;
//Searchpage: gm_minutes_Search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere "";
if (!
session_id()) session_start();
if ((isset(
$_GET["Search_x"]) && $_GET["Search_x"] != "")) {
  
$WADbSearch1 = new FilterDef;
  
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
  
//keyword array declarations

Should the following code not use braces?

php:
if (!session_id()) session_start();

like this?

php:
if (!session_id()) {session_start();}

Please advise.

Sign in to reply to this post

Jason ByrnesWebAssist

No, that line of code does not need braces, an if statement that only has one line for the action can be coded on one line without the braces.


the error you re referring to occurs if there is out put to the page before the session start function is used.

See the following [page for details on the cause and fix for this error:
148/

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...