lost array information?

They have: 461 posts

Joined: Jul 2003

i think my brain went on vacation and forgot to inform me. i can't find any error here, yet the information in the display side.. the information retrieved from the db, not all of it is not being displayed... the issue here is that it USED to work anf that i know those feilds exist AND have information (from checking the db directly)

for some reason the time it was sent and the message itself are both lost.

any hints as to what i'm doing wrong will be greatly appreciated

<?php
     
}else{ # it's ok to let you write a message, or to send it
       
if(isset($_POST['message'])){ # we're sending a site message
         
$message=clean($_POST['message']); # get rid of \"bad\" characters
         
$sendmsg=mysql_query(\"INSERT INTO msgs (to_id, from_id, from_un, sent, message) VALUES ('$toid', '$uid', '$un', NOW(), '$message')\", $db);
          if(mysql_affected_rows(
$db)){ # it was sent
            bgnmsgpg('Site Message Sent');
            echo \"<p>Message Sent to
$to<br />Click <a href=\\"3\\" onclick=\\"window.close();\\">here</a> to close this window</p>\";
            clspg();
          }
        }else{ # set up the message interface
         
$msg1=''; $msg2=''; $when='';
          if(isset(
$_GET['mid'])){ # there is a sent message
           
$mid=$_GET['mid'];  # message id number
           
$frmsginf=mysql_query(\"SELECT message,from_un,from_id,UNIX_TIMESTAMP(sent) FROM msgs WHERE msg_id='$mid' AND to_id='$toid'\", $db); # only the person it's sent TO may see
           
$msginf=mysql_fetch_array($frmsginf);  # message info
           
$vmsg=mysql_query(\"UPDATE msgs SET viewed='1' WHERE msg_id='$mid'\", $db); # set to viewed
           
$when=\"Message Sent At: \".gmdate($utds, ($msginf['UNIX_TIMESTAMP(sent)']+($gmto*60*60)));  # when was it sent? (get the unix timestamp of the time from mysql, add the gmt offset, in seconds, and format the way the user wants to see the dates)
           
$pto=strtolower($msginf['from_un']); # name lowercase for the pictures
           
$msg1='       <tr><td colspan=\"5\">'.codeparse($msginf['message']).'</td></tr>'; # message to show the user
           
$msg2=\"<blockquote class=\"bb-quote-body\"><p class=\"bb-quote\"><strong>$to wrote:</strong></p> {$msginf['message']}</blockquote>\"; # reply box
          }
          bgnmsgpg('Reading/Sending FYDim'); # start the page
          // this heredoc creates the body
          echo <<<END
    <form action=\"
{$_SERVER['PHP_SELF']}\" method=\"POST\" onReset=\"window.close();\">
      <input id=\"to\" name=\"to\" type=\"hidden\" value=\"
$to\">
     
$tsnwb1
        <tbody>
          <tr>
            <td rowspan=\"3\" class=\"smthmb\"><a href=\"profile.php?un=
{$msginf['from_un']}\" target=\"profile\"><img alt=\"{$msginf
['from_un']}\" class=\"smthmb\" src=\"pic.php?pic=main.$pto.jpg&amp;fn=ltn\" /></a></td>
            <td colspan=\"2\">Message To/From: <a href=\"profile.php?un=
{$msginf['from_un']}\" target=\"profile\">$to</a></td>
            <td colspan=\"2\"><a href=\"block.php?pest=
{$msginf['from_un']}\" target=\"_self\">Block User</a></td>
          </tr>
          <tr>
            <td colspan=\"3\">
$when</td>
            <td ><a href=\"code.php\" target=\"code\">SiteCode</a> On</td>
          </tr>
          <tr>
            <td><input type=\"submit\" value=\"Send Mail\" /></td>
            <td><input type=\"reset\" value=\"Close Window\" /></td>
            <td colspan=\"2\"><a name=\"#desire\" href=\"#desire\" onclick=\"window.open('adddesire.php?fun=
{$msginf['from_un']}&fu
in=
$toid', 'desire', 'height=196,width=288');\">Add Desire</a></td>
          </tr>
$msg1
          <tr>
            <td colspan=\"5\"><textarea cols=\"59\" id=\"message\" name=\"message\" rows=\"5\">
$msg2</textarea></td>
          </tr>
        </tbody>
      </table>
    </form>
END;
          clspg(); # close the page
        }
?>
thanx in advance, josh

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

They have: 461 posts

Joined: Jul 2003

the host it's erroring on:
PHP4 scripting (version 4.3.3 currently)
current MySQL version is: 4.0.16-standard

host it works perfectly on:
php 4.2.2
mysql 3.23.58

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

two questions...

Is the mysql_query() call for $frmsginf erroring?
Is $msginf being populated?

They have: 461 posts

Joined: Jul 2003

i thought about those. kept inserting
echo "debgug:variable: $variable...mysql error: '.mysql_errno($db).': '.mysql_error($db).'';
and adding any new variables and then getting any error info and moving it down.
once i got below $msginf i didn't get anything for that on the deployment server, but i didn't get any errors either.
i double checked the feild names. i know the feilds are correct. i double checked the fact the information is there. the EXACT same query in the mysql command line interface gets results.

i'm thinking there's something i don't know about the sql set up causing it not to return the information

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

So is it the mysql_query() or mysql_fetch_array() that's not returning a value?

Here's a question... do you have any PHP scripts that are successfully querying the DB? If not, I'd look into the configure settings for php.

Mark Hensler
If there is no answer on Google, then there is no question.

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

It could be a simple problem with the upload of the script via FTP. If it was loaded as binary instead of ascii, you can get some weirdness sometimes.

You might also do a phpinfo() on both machines to see if any of the php.ini setup variables are different that might be causing problems as Mark has mentioned.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 461 posts

Joined: Jul 2003

pretty much all my scripts query the db. i think there's only one that doesn't, but that actually calls a function in an include that does. everything else looks to be functinong fine (only mail hasn't been tested on the deployment server as of now). the error checking returns no errors from either the query or the fetch call. the query through the command line works. so my gut feeling is that it is the fetch array call.

there are a number of other calls tot he batabase in that script, including querys, and fetch arrays and even a num rows, all of which work correctly.

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

They have: 461 posts

Joined: Jul 2003

changing the line
$msginf=mysql_fetch_array($frmsginf);
to
$msginf=mysql_fetch_array($frmsginf);
foreach($msginf as $key=>$value){ echo "key: $key ---> value: $value"; }
gets the error:
Warning: Invalid argument supplied for foreach() in /home/dcfydllc/www/message.php on line 33
which tells me that there's an issue with the mysql_fetch_array call.

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Out of curiosity, does mysql_fetch_assoc() work in place of mysql_fetch_array()?

They have: 461 posts

Joined: Jul 2003

didn't try that. let me go switch it out.

nope. no difference. the array is not being poulated.

i don'tknow it having the entire script might help, here it is without debugging lines (and with mark's suggesstion)

<?php
include(\"/home/dcfydllc/includes/fyd.incs.php\"); # includes file
$un=$_COOKIE['un']; $pw=$_COOKIE['pw']; $to=''; $gmto=$_COOKIE['gmto']; $utds=$_COOKIE['utds']; # display information
if(isset(
$_POST['to'])){ $to=$_POST['to']; }else{ $to=$_GET['to']; } # set who the im is going to

$db=mysql_connect($host, $login2, $pass2) or die(\"cannot access mysql\"); # connect to the db
$fyd=mysql_select_db($dbname, $db) or die(\"cannot access db\"); # get the db
$toinf=mysql_query(\"SELECT uid,msgs FROM users WHERE username='$to'\", $db); # does the person it's going to accept ims?
if(mysql_num_rows(
$toinf)){ # we found the user
 
$getto=mysql_fetch_array($toinf); $toid=$getto['uid']; $msgs=$getto['msgs']; #get the user info
  if(
$msgs){ # they accept ims
   
$verify=mysql_query(\"SELECT uid FROM users WHERE username='$un' AND password='$pw'\", $db); # verify the one sending
    if(mysql_num_rows(
$verify)){ # user is verified
     
$getuid=mysql_fetch_array($verify); $uid=$getuid['uid']; # who is this?
     
$checkblock=mysql_query(\"SELECT pun FROM pests WHERE uid='$to' AND puid='$uid'\", $db); # is the sender blocked?
      if(mysql_num_rows(
$checkblock)){ # user has blocked you
        bgnmsgpg('BLOCKED'); echo \"<h1>
$to has blocked you</h1>\"; clspg(); # let the user know (s)he is blocked
      }else{ # it's ok to let you write a message, or to send it
        if(isset(
$_POST['message'])){ # we're sending a site message
         
$message=clean($_POST['message']); # remove any html
         
$sendmsg=mysql_query(\"INSERT INTO msgs (to_id, from_id, from_un, sent, message) VALUES ('$toid', '$uid', '$un', NOW(), '$message')\", $db); # insert message into db
          if(mysql_affected_rows(
$db)){ # it was sent
            bgnmsgpg('Site Message Sent');
            echo \"<p>Message Sent to
$to<br />Click <a href=\\"3\\" onclick=\\"window.close();\\">here</a> to close this window</p>\";
            clspg();
          } # user knows it was sent
        }else{ # set up the message interface
         
$msg1=''; $msg2=''; $when=''; #default variables
          if(isset(
$_GET['mid'])){ # there is a sent message
           
$mid=$_GET['mid']; #get message id number
           
$frmsginf=mysql_query(\"SELECT message,from_un,from_id,UNIX_TIMESTAMP(sent) FROM msgs WHERE msg_id='$mid' AND to_id='$toid'\", $db); # only the person it's sent TO may see
           
$msginf=mysql_fetch_assoc($frmsginf); # get the message and such
           
$vmsg=mysql_query(\"UPDATE msgs SET viewed='1' WHERE msg_id='$mid'\", $db); # set message as viewd
           
$when=\"Message Sent At: \".gmdate($utds, ($msginf['UNIX_TIMESTAMP(sent)']+($gmto*60*60))); # set when the message was sent
           
$pto=strtolower($msginf['from_un']); # get username who sent message (and reply will be to) and format for use calling the user's thumbnail
           
$msg1='       <tr><td colspan=\"5\">'.codeparse($msginf['message']).'</td></tr>'; # make the message line (if applicable)
           
$msg2=\"<blockquote class=\"bb-quote-body\"><p class=\"bb-quote\"><strong>$to wrote:</strong></p> {$msginf['message']}</blockquote>\"; # set initial response text
          }
          bgnmsgpg('Reading/Sending FYDim');
          echo <<<END
    <form action=\"
{$_SERVER['PHP_SELF']}\" method=\"POST\" onReset=\"window.close();\">
      <input id=\"to\" name=\"to\" type=\"hidden\" value=\"
$to\">
     
$tsnwb1
        <tbody>
          <tr>
            <td rowspan=\"3\" class=\"smthmb\"><a href=\"profile.php?un=
{$msginf['from_un']}\" target=\"profile\"><img alt=\"{$msgin\
f['from_un']}\" class=\"smthmb\" src=\"pic.php?pic=main.$pto.jpg&amp;fn=ltn\" /></a></td>
            <td colspan=\"2\">Message To/From: <a href=\"profile.php?un=
{$msginf['from_un']}\" target=\"profile\">$to</a></td>
            <td colspan=\"2\"><a href=\"block.php?pest=
{$msginf['from_un']}\" target=\"_self\">Block User</a></td>
          </tr>
          <tr>
            <td colspan=\"3\">
$when</td>
            <td ><a href=\"code.php\" target=\"code\">SiteCode</a> On</td>
          </tr>
          <tr>
            <td><input type=\"submit\" value=\"Send Mail\" /></td>
            <td><input type=\"reset\" value=\"Close Window\" /></td>
            <td colspan=\"2\"><a name=\"#desire\" href=\"#desire\" onclick=\"window.open('adddesire.php?fun=
{$msginf['from_un']}&f\
uin=
$toid', 'desire', 'height=196,width=288');\">Add Desire</a></td>
          </tr>
$msg1
          <tr>
            <td colspan=\"5\"><textarea cols=\"59\" id=\"message\" name=\"message\" rows=\"5\">
$msg2</textarea></td>
          </tr>
        </tbody>
      </table>
    </form>
END;
          clspg();
        }
      }
    }else{ # un/pw don't match
      bgnmsgpg('verification failure');
      echo '<p>Verification failure. Please make sure you are <a href=\"login.php\">Logged In</a></p>';
      clspg();
    }
  }else{ # the user has ims turned off
    bgnmsgpg(\"
$to does not accept site messages\"); echo \"<p>$to has site messaging turned off</p>\"; clspg();
  }
}else{ # no user
  bgnmsgpg(\"Error sending sitemail to
$to\");
  echo '<p>Unable to find user in database. Please try back later</p>';
  clspg();
}
?>

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Have you printed out the query for $frmsginf? Just to make sure that it is what you expect it to be.

They have: 461 posts

Joined: Jul 2003

well... here's with debugging lines...

<?php
[dcfydllc@seed www]$ cat message.php

include(\"/home/dcfydllc/includes/fyd.incs.php\"); # includes file
$un=$_COOKIE['un']; $pw=$_COOKIE['pw']; $to=''; $gmto=$_COOKIE['gmto']; $utds=$_COOKIE['utds'];
if(isset(
$_POST['to'])){ $to=$_POST['to']; }else{ $to=$_GET['to']; }

$db=mysql_connect($host, $login2, $pass2) or die(\"cannot access mysql\"); # connect to the db
$fyd=mysql_select_db($dbname, $db) or die(\"cannot access db\"); # get the db
$toinf=mysql_query(\"SELECT uid,msgs FROM users WHERE username='$to'\", $db);
if(mysql_num_rows(
$toinf)){ # we found the user
 
$getto=mysql_fetch_array($toinf); $toid=$getto['uid']; $msgs=$getto['msgs'];
  if(
$msgs){ # they accept ims
   
$verify=mysql_query(\"SELECT uid FROM users WHERE username='$un' AND password='$pw'\", $db);
    if(mysql_num_rows(
$verify)){ # user is verified
     
$getuid=mysql_fetch_array($verify); $uid=$getuid['uid']; # who is this?
     
$checkblock=mysql_query(\"SELECT pun FROM pests WHERE uid='$toid' AND puid='$uid'\", $db);
      if(mysql_num_rows(
$checkblock)){ # user has blocked you
        bgnmsgpg('BLOCKED'); echo \"<h1>
$to has blocked you</h1>\"; clspg();
      }else{ # it's ok to let you write a message, or to send it
        if(isset(
$_POST['message'])){ # we're sending a site message
         
$message=clean($_POST['message']);
         
$sendmsg=mysql_query(\"INSERT INTO msgs (to_id, from_id, from_un, sent, message) VALUES ('$toid', '$uid', '$un', NOW(), '$message')\", $db);
          if(mysql_affected_rows(
$db)){ # it was sent
            bgnmsgpg('Site Message Sent');
            echo \"<p>Message Sent to
$to<br />Click <a href=\\"3\\" onclick=\\"window.close();\\">here</a> to close this window</p>\";
            clspg();
          }
        }else{ # set up the message interface
         
$msg1=''; $msg2=''; $when=''; $debug='';
          if(isset(
$_GET['mid'])){ # there is a sent message
           
$mid=$_GET['mid']; # what message number is this?
           
$sql=\"SELECT message,from_un,from_id,UNIX_TIMESTAMP(sent) FROM msgs WHERE msg_id='$mid' AND to_id='$toid';\"; # sql query
           
$frmsginf=mysql_query($sql, $db); # only the person it's sent TO may see
           
$debug.=\"<p>sql: $sql<br>frmsginf: $frmsginf<br>error: \".mysql_errno($db).': '.mysql_error($db);
           
$msginf=mysql_fetch_array($frmsginf);
           
$debug.=\"<br>msginf $msginf<br>error: \".mysql_errno($db).': '.mysql_error($db).'</p>';
           
$vmsg=mysql_query(\"UPDATE msgs SET viewed='1' WHERE msg_id='$mid'\", $db);
           
$when=\"Message Sent At: \".gmdate($utds, ($msginf['UNIX_TIMESTAMP(sent)']+($gmto*60*60)));
           
$pto=strtolower($msginf['from_un']);
           
$msg1='       <tr><td colspan=\"5\">'.codeparse($msginf['message']).'</td></tr>';
           
$msg2=\"<blockquote class=\"bb-quote-body\"><p class=\"bb-quote\"><strong>$to wrote:</strong></p> {$msginf['message']}</blockquote>\";
          }
          bgnmsgpg('Reading/Sending FYDim');
          echo <<<END
$debug
    <form action=\"
{$_SERVER['PHP_SELF']}\" method=\"POST\" onReset=\"window.close();\">
      <input id=\"to\" name=\"to\" type=\"hidden\" value=\"
$to\">
     
$tsnwb1
        <tbody>
          <tr>
            <td rowspan=\"3\" class=\"smthmb\"><a href=\"profile.php?un=
{$msginf['from_un']}\" target=\"profile\"><img alt=\"{$msginf['from_un']}\" class=\"smthmb\" src=\"pic.php?pic=main.$pto.jpg&amp;fn=ltn\" /></a></td>
            <td colspan=\"2\">Message To/From: <a href=\"profile.php?un=
{$msginf['from_un']}\" target=\"profile\">$to</a></td>
            <td colspan=\"2\"><a href=\"block.php?pest=
{$msginf['from_un']}\" target=\"_self\">Block User</a></td>
          </tr>
          <tr>
            <td colspan=\"3\">
$when</td>
            <td ><a href=\"code.php\" target=\"code\">SiteCode</a> On</td>
          </tr>
          <tr>
            <td><input type=\"submit\" value=\"Send Mail\" /></td>
            <td><input type=\"reset\" value=\"Close Window\" /></td>
            <td colspan=\"2\"><a name=\"#desire\" href=\"#desire\" onclick=\"window.open('adddesire.php?fun=
{$msginf['from_un']}&fuin=$toid', 'desire', 'height=196,width=288');\">Add Desire</a></td>
          </tr>
$msg1
          <tr>
            <td colspan=\"5\"><textarea cols=\"59\" id=\"message\" name=\"message\" rows=\"5\">
$msg2</textarea></td>
          </tr>
        </tbody>
      </table>
    </form>
END;
          clspg();
        }
      }
    }else{ # un/pw don't match
      bgnmsgpg('verification failure');
      echo '<p>Verification failure. Please make sure you are <a href=\"login.php\">Logged In</a></p>';
      clspg();
    }
  }else{ # the user has ims turned off
    bgnmsgpg(\"
$to does not accept site messages\"); echo \"<p>$to has site messaging turned off</p>\"; clspg();
  }
}else{ # no user
  bgnmsgpg(\"Error sending sitemail to
$to\");
  echo '<p>Unable to find user in database. Please try back later</p>';
  clspg();
}
[dcfydllc@seed www]$
?>
and the result
Quote: sql: SELECT message,from_un,from_id,UNIX_TIMESTAMP(sent) FROM msgs WHERE msg_id='1' AND to_id='47';
frmsginf: Resource id #10
error: 0:
msginf
error: 0:

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

They have: 461 posts

Joined: Jul 2003

figured it out whe i looked at something. whenn i typed it into the command line, i was typing it over, not cutting and pasting. i noticed i kept flipping something so the uid was mine and not sammys. the reason it worked on the dev server is that i was testing by sendning to myself. i have the to and from id dlipped. by using uid and not toid in the call, it works.

as you can see, this is the corrected version if you'd like to see. it's actually so simple and i was just so close to the code i kept missing it. i mised it for about 36 hours before posting it and saw it as i copied over the text into the command line jsut now.

<?php
[dcfydllc@seed dcfydllc]$ cat www/message.php

include(\"/home/dcfydllc/includes/fyd.incs.php\"); # includes file
$un=$_COOKIE['un']; $pw=$_COOKIE['pw']; $to=''; $gmto=$_COOKIE['gmto']; $utds=$_COOKIE['utds'];
if(isset(
$_POST['to'])){ $to=$_POST['to']; }else{ $to=$_GET['to']; }

$db=mysql_connect($host, $login2, $pass2) or die(\"cannot access mysql\"); # connect to the db
$fyd=mysql_select_db($dbname, $db) or die(\"cannot access db\"); # get the db
$toinf=mysql_query(\"SELECT uid,msgs FROM users WHERE username='$to'\", $db);
if(mysql_num_rows(
$toinf)){ # we found the user
 
$getto=mysql_fetch_array($toinf); $toid=$getto['uid']; $msgs=$getto['msgs'];
  if(
$msgs){ # they accept ims
   
$verify=mysql_query(\"SELECT uid FROM users WHERE username='$un' AND password='$pw'\", $db);
    if(mysql_num_rows(
$verify)){ # user is verified
     
$getuid=mysql_fetch_array($verify); $uid=$getuid['uid']; # who is this?
     
$checkblock=mysql_query(\"SELECT pun FROM pests WHERE uid='$toid' AND puid='$uid'\", $db);
      if(mysql_num_rows(
$checkblock)){ # user has blocked you
        bgnmsgpg('BLOCKED'); echo \"<h1>
$to has blocked you</h1>\"; clspg();
      }else{ # it's ok to let you write a message, or to send it
        if(isset(
$_POST['message'])){ # we're sending a site message
         
$message=clean($_POST['message']);
         
$sendmsg=mysql_query(\"INSERT INTO msgs (to_id, from_id, from_un, sent, message) VALUES ('$toid', '$uid', '$un', NOW(), '$message')\", $db);
          if(mysql_affected_rows(
$db)){ # it was sent
            bgnmsgpg('Site Message Sent');
            echo \"<p>Message Sent to
$to<br />Click <a href=\\"3\\" onclick=\\"window.close();\\">here</a> to close this window</p>\";
            clspg();
          }
        }else{ # set up the message interface
         
$msg1=''; $msg2=''; $when=''; $debug='';
          if(isset(
$_GET['mid'])){ # there is a sent message
           
$mid=$_GET['mid']; # what message number is this?
           
$sql=\"SELECT message,from_un,from_id,UNIX_TIMESTAMP(sent) FROM msgs WHERE msg_id='$mid' AND to_id='$uid';\"; # sql query-- use uid and not toid because toid is who the REPLY is to. not the user getting THIS message
           
$frmsginf=mysql_query($sql, $db); # only the person it's sent TO may see
           
$msginf=mysql_fetch_array($frmsginf);
           
$vmsg=mysql_query(\"UPDATE msgs SET viewed='1' WHERE msg_id='$mid'\", $db);
           
$when=\"Message Sent At: \".gmdate($utds, ($msginf['UNIX_TIMESTAMP(sent)']+($gmto*60*60)));
           
$pto=strtolower($msginf['from_un']);
           
$msg1='       <tr><td colspan=\"5\">'.codeparse($msginf['message']).'</td></tr>';
           
$msg2=\"<blockquote class=\"bb-quote-body\"><p class=\"bb-quote\"><strong>$to wrote:</strong></p> {$msginf['message']}</blockquote>\";
          }
          bgnmsgpg('Reading/Sending FYDim');
          echo <<<END
    <form action=\"
{$_SERVER['PHP_SELF']}\" method=\"POST\" onReset=\"window.close();\">
      <input id=\"to\" name=\"to\" type=\"hidden\" value=\"
$to\">
     
$tsnwb1
        <tbody>
          <tr>
            <td rowspan=\"3\" class=\"smthmb\"><a href=\"profile.php?un=
{$msginf['from_un']}\" target=\"profile\"><img alt=\"{$msginf['from_un']}\" class=\"smthmb\" src=\"pic.php?pic=main.$pto.jpg&amp;fn=ltn\" /></a></td>
            <td colspan=\"2\">Message To/From: <a href=\"profile.php?un=
{$msginf['from_un']}\" target=\"profile\">$to</a></td>
            <td colspan=\"2\"><a href=\"block.php?pest=
{$msginf['from_un']}\" target=\"_self\">Block User</a></td>
          </tr>
          <tr>
            <td colspan=\"3\">
$when</td>
            <td ><a href=\"code.php\" target=\"code\">SiteCode</a> On</td>
          </tr>
          <tr>
            <td><input type=\"submit\" value=\"Send Mail\" /></td>
            <td><input type=\"reset\" value=\"Close Window\" /></td>
            <td colspan=\"2\"><a name=\"#desire\" href=\"#desire\" onclick=\"window.open('adddesire.php?fun=
{$msginf['from_un']}&fuin=$toid', 'desire', 'height=196,width=288');\">Add Desire</a></td>
          </tr>
$msg1
          <tr>
            <td colspan=\"5\"><textarea cols=\"59\" id=\"message\" name=\"message\" rows=\"5\">
$msg2</textarea></td>
          </tr>
        </tbody>
      </table>
    </form>
END;
          clspg();
        }
      }
    }else{ # un/pw don't match
      bgnmsgpg('verification failure');
      echo '<p>Verification failure. Please make sure you are <a href=\"login.php\">Logged In</a></p>';
      clspg();
    }
  }else{ # the user has ims turned off
    bgnmsgpg(\"
$to does not accept site messages\"); echo \"<p>$to has site messaging turned off</p>\"; clspg();
  }
}else{ # no user
  bgnmsgpg(\"Error sending sitemail to
$to\");
  echo '<p>Unable to find user in database. Please try back later</p>';
  clspg();
}
[dcfydllc@seed dcfydllc]$
?>

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

The simplest mistakes cause the biggest headaches.

They have: 461 posts

Joined: Jul 2003

yeah. this is why i like to work with a partner. simple things that go unnoticed because you're too close will often be caught by the partenre, thus saving you the headache.

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.