Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 11-02-2004, 06:06 PM Help me get started
Novice Talker

Posts: 5
Trades: 0
I am just learning PHP. I purchased an auctin in PHP. I have my site on desktop and imported the database into mysql. iI downloaded a triad called wamps with apache,PHP and MySQL. Problem is when I try to view in desktop I get folowing errors. I reviewed postings and problem should be that I didnt put the open session tag before everything but I did as you can see. below the errors. I think it is either something to do with the <? or config or install.php but cant figuew out what.

Can anyone give me an idea how to get it running so I can start to learn to code?

thanks

ERRORS:


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at c:\wamp\www\1-fleamart\index.php:2) in c:\wamp\www\1-fleamart\index.php on line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at c:\wamp\www\1-fleamart\index.php:2) in c:\wamp\www\1-fleamart\index.php on line 3

Fatal error: Call to undefined function mysql_connect() in c:\wamp\www\1-fleamart\config\config.php on line 7


my CODE



<p align="center"><?

session_start();

if (!file_exists("config/config.php")) header ("Location: install.php");

if ($_GET['option']=="logout") {

session_destroy();

header("Location: index.php");

}

include_once ("config/config.php");

### do the cron job if selected to run from phpprobid

if ($setts['cron_job']==2) {

$manualCron = TRUE;

include_once ("cron/cron1.php");

}

$getFeatItems=mysql_query("SELECT * FROM probid_auctions WHERE

hpfeat='Y' AND active=1 AND closed=0 AND deleted!=1 ORDER BY rand() LIMIT 0,".$layout['max_feat_hp']." ");

$nbFeatItems=mysql_num_rows($getFeatItems);

if ($layout['nb_feat_hp']>0) {

$j=floor($nbFeatItems/$layout['nb_feat_hp']);

$j++;

} else $notfeat="Y";

$fct=0;

$id = array();

$name = array();

$pic = array();

$maxbid = array();

$enddate = array();

$currency = array();


while ($hpFeatured=mysql_fetch_array($getFeatItems)) {

$id[$fct] = $hpFeatured['id'];

$name[$fct] = $hpFeatured['itemname'];

$pic[$fct] = $hpFeatured['picpath'];

$maxbid = array ($fct => $hpFeatured['maxbid']);

$enddate = array ($fct => $hpFeatured['enddate']);

$currency[$fct] = $hpFeatured['currency'];

$fct++;

}

include ("themes/".$setts['default_theme']."/header.php");

include ("themes/".$setts['default_theme']."/mainpage.php");

include ("themes/".$setts['default_theme']."/footer.php"); ?>

<a href="http://click.linksynergy.com/fs-bin/stat?id=dLxMoVOwIY4&offerid=65617.10000016&type=4& subid=0">

<IMG border=0 alt="10% Off All Toys @ eToys" src="images/eToys.jpg" align="right" width="468" height="59"></a><IMG border=0 width=1 height=1 alt=banner src="http://ad.linksynergy.com/fs-bin/show?id=dLxMoVOwIY4&bids=65617.10000016&type=4&sub id=0">

Last edited by fleart1; 11-02-2004 at 06:08 PM..
fleart1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-03-2004, 04:49 AM
labintador's Avatar
Skilled Talker

Posts: 96
Trades: 0
<p align="center"> <-- Make sure you have not outputted anything before calling header();

<?
session_start();

if (!file_exists("config/config.php")) header ("Location: install.php");

if ($_GET['option']=="logout") {

session_destroy();

header("Location: index.php");

}

include_once ("config/config.php");

### do the cron job if selected to run from phpprobid

if ($setts['cron_job']==2) {

$manualCron = TRUE;

include_once ("cron/cron1.php");

}

$getFeatItems=mysql_query("SELECT * FROM probid_auctions WHERE

hpfeat='Y' AND active=1 AND closed=0 AND deleted!=1 ORDER BY rand() LIMIT 0,".$layout['max_feat_hp']." ");

$nbFeatItems=mysql_num_rows($getFeatItems);

if ($layout['nb_feat_hp']>0) {

$j=floor($nbFeatItems/$layout['nb_feat_hp']);

$j++;

} else $notfeat="Y";

$fct=0;

$id = array();

$name = array();

$pic = array();

$maxbid = array();

$enddate = array();

$currency = array();


while ($hpFeatured=mysql_fetch_array($getFeatItems)) {

$id[$fct] = $hpFeatured['id'];

$name[$fct] = $hpFeatured['itemname'];

$pic[$fct] = $hpFeatured['picpath'];

$maxbid = array ($fct => $hpFeatured['maxbid']);

$enddate = array ($fct => $hpFeatured['enddate']);

$currency[$fct] = $hpFeatured['currency'];

$fct++;

}

include ("themes/".$setts['default_theme']."/header.php");

include ("themes/".$setts['default_theme']."/mainpage.php");

include ("themes/".$setts['default_theme']."/footer.php"); ?>

<a href="http://click.linksynergy.com/fs-bin/stat?id=dLxMoVOwIY4&offerid=65617.10000016&type=4& subid=0">

<IMG border=0 alt="10% Off All Toys @ eToys" src="images/eToys.jpg" align="right" width="468" height="59"></a><IMG border=0 width=1 height=1 alt=banner src="http://ad.linksynergy.com/fs-bin/show?id=dLxMoVOwIY4&bids=65617.10000016&type=4&sub id=0">
labintador is offline
Reply With Quote
View Public Profile
 
Old 11-03-2004, 10:13 AM
Skilled Talker

Posts: 73
Trades: 0
Try this.

Code:
<?

session_start();
?>

<p align="center">
<?
if (!file_exists("config/config.php")) header ("Location: install.php");

if ($_GET['option']=="logout") {

session_destroy();

header("Location: index.php");

}

include_once ("config/config.php");

### do the cron job if selected to run from phpprobid

if ($setts['cron_job']==2) {

$manualCron = TRUE;

include_once ("cron/cron1.php");

}

$getFeatItems=mysql_query("SELECT * FROM probid_auctions WHERE 

hpfeat='Y' AND active=1 AND closed=0 AND deleted!=1 ORDER BY rand() LIMIT 0,".$layout['max_feat_hp']." ");

$nbFeatItems=mysql_num_rows($getFeatItems);

if ($layout['nb_feat_hp']>0) {

$j=floor($nbFeatItems/$layout['nb_feat_hp']);

$j++;

} else $notfeat="Y";

$fct=0;

$id = array();

$name = array();

$pic = array();

$maxbid = array();

$enddate = array();

$currency = array();


while ($hpFeatured=mysql_fetch_array($getFeatItems)) {

$id[$fct] = $hpFeatured['id'];

$name[$fct] = $hpFeatured['itemname'];

$pic[$fct] = $hpFeatured['picpath'];

$maxbid = array ($fct => $hpFeatured['maxbid']);

$enddate = array ($fct => $hpFeatured['enddate']);

$currency[$fct] = $hpFeatured['currency'];

$fct++;

}

include ("themes/".$setts['default_theme']."/header.php"); 

include ("themes/".$setts['default_theme']."/mainpage.php"); 

include ("themes/".$setts['default_theme']."/footer.php"); ?>

<a href="http://click.linksynergy.com/fs-bin/stat?id=dLxMoVOwIY4&offerid=65617.10000016&type=4&subid=0">

<IMG border=0 alt="10% Off All Toys @ eToys" src="images/eToys.jpg" align="right" width="468" height="59"></a><IMG border=0 width=1 height=1 alt=banner src="http://ad.linksynergy.com/fs-bin/show?id=dLxMoVOwIY4&bids=65617.10000016&type=4&subid=0">
Make sure there are no lines before:
<?

session_start();
?>
__________________

Please login or register to view this content. Registration is FREE
Find-A-Web-Host is offline
Reply With Quote
View Public Profile Visit Find-A-Web-Host's homepage!
 
Reply     « Reply to Help me get started
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13312 seconds with 12 queries