Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About gmz1023

  • Rank
  1. Setcookie Header Already Sent

    thanks guys! fixed it
  2. Setcookie Header Already Sent

    Hey guys. I've googled the ###### out of this error and still can't get it to work. i get this error Warning: Cannot modify header information - headers already sent by (output started at /home1/secregco/public_html/test/inc/functions.php:3) in /home1/secregco/public_html/test/login.php on line 24Warning: Cannot modify header information - headers already sent by (output started at test/inc/functions.php:3) in /test/login.php on line 25 whenever i try to log in to my site. it does send me to the correct page afterwords but the fact that i'm getting an error isn't good. (duh).this is the functions.php <?php function redirect($parm,$title="") {?><meta http-equiv="refresh" content="2;url=<?php print($parm); ?>"><link href="assetts/misc.css" rel="stylesheet" type="text/css"><body bgcolor="#fff" text="#ffffff"><table id="please"> <tr> <th>System Message</th> </tr> <tr> <td> Please wait while we redirect you. </td> </tr> <?php }?></table> this is the login.php <?php require("inc/functions.php");if((!isset($_GET["user"])) && (!isset($_GET["pass"])) ){redirect("index.php"); exit;}$user=$_GET["user"];$pass=$_GET["pass"];$fp=fopen("inc/users.db","r");$userdata=array();$redirect="";while (($userdata = fgetcsv($fp, 1000, ",")) !== FALSE){if (($userdata[0]==$user) && ($userdata[1]==$pass)){ $redirect=$userdata[2]; }}fclose($fp);if ($redirect==""){redirect("index.php","Security Check : Fail");}else{setcookie("user",$user,time()+3600,"/"); setcookie("pass",$pass,time()+3600,"/");redirect($redirect,"index.php?hmb=wru");}exit;?><body><pre>User entered :<?php print ($user . "/" . $pass); if ($redirect<>"") {print("OK -> ".$redirect); } else {print("KO -> index"); } for ($i=0;$i<count($userdata);$i++) { print($userdata[0] . "|" . $userdata[1] . "|" . $userdata[2] . "\n" ); } ?></pre> anyhelp would be appreciated.
  3. Switch Question

    Yes thats what i mean. i can't get it to work correct though. i've got a quick work around i'm using right now. so i might be fine without it though lol
  4. Switch Question

    Okay. Hi y'all i'm rather new to PHP so please excuse my stupidity.I'm currently working with a Switch and i was wondering how to--if possible at all--add a second variable into the same page. for instanceI want to be able to type this into my browser:www.mysite.com/index.php?scs=blahand get a certain section of my site. and likewise i woudl like to type:www.mysite.com/index.php?atp=blahand get a different part. I've already got both variables set up but the problem is i have a Default set up on the first variable that needs to stay. the switch code looks like this $scs = $_GET['scs'];@include('pt1.php');switch($scs){default:@include('vm9.php');break;case vstr:@include('vst/v1.php');break;}$atp = $_GET['atp'];switch($atp){ case credits: @include('atp/credits.php'); break;} thanks in advance for the help.
  5. Php Multiple Pages Per One File

    Hey y'all,i'm working on a website right now and i have a quick question about PHP.so lets say i have a code like thisCODE<?php$cmd = $_GET['cmd'];switch($cmd){case "page1":@include('page1.php');break;case "page2":@include('page2.php');break;case "page3":@include('page3.php');break;}?>and i want to make it so that instead of having to program the codes for the websites in manually it would just go off of the link it self, how would i do that?
  6. Printing What Shouldn't Be

    Okay, so i'm new to CF. so i'm probably funking it up somewhere. but when i put a code down like this: <CFQUERY name="data" datasource="MyDB"> SELECT MyField FROM MyDB ORDER BY MyField</CFQUERY> it actually prits out SELECT MyField FROM MyDB ORDER BY MyField so what am i doing wrong?
  7. Problem With Php

    Its probably something i just dragged over from scripting for the game Doom3 lol...thanks pointing out those errors, however i'm still getting the same problem... i'm just gonna rewrite the whole script.
  8. Problem With Php

    Okay--so i've been working on a PHP login script (and i know its probably not secure, doesnt need to be). however i'm just now getting an error from it.heres the login codeheres the error code <?php require("i_nc/functions.php"); if ((!isset($_GET["user"])) && (!isset($_GET["pass"])) ) { redirect("index.php","Security Check : Hacker Attempt"); exit; } $user=$_GET["user"]; $pass=$_GET["pass"]; $fp=fopen("i_nc/users.db","r"); $userdata=array(); $redirect=""; while (($userdata = fgetcsv($fp, 1000, ",")) !== FALSE) { if (($userdata[0]==$user) && ($userdata[1]==$pass)) { $redirect=$userdata[2]; } } fclose($fp); if ($redirect=="") { redirect("index.php","Security Check : Fail"); } else { setcookie("user",$user,time()+3600,"/"); setcookie("pass",$pass,time()+3600,"/"); redirect($redirect,"Security Check : Success"); } exit;?><html><head><title>Security check</title></head><body><pre> User entered : <?php print ($user . "/" . $pass) if ($redirect<>"") {print("OK -> ".$redirect); } else {print("KO -> index"); } for ($i=0;$i<count($userdata);$i++) { print($userdata[0] . "|" . $userdata[1] . "|" . $userdata[2] . "\n" ); }?></pre></body></html> User entered : "") {print("OK -> ".$redirect); } else {print("KO -> index"); } for ($i=0;$i i realize its probably something stupid i've done, but hey... i cant figure it out lol
  9. multiple password question

    how would i even start with that? i under stand everything up until the script part...
  10. multiple password question

    Okay, so i've got my website set up with one form on it. and i want it so that by entering a different password you get sent to a different page. Like if i put in: Zoom, it would take the user to Zoom.php or if i typed in blah it would take me to Blah.php