[PHP] mail()

2002-03-19 Thread Jennifer

Hi guys,

I'm new to PHP and i'm trying to set it up so that i can use the mail() 
function to send emails. I'm using Mac OS X 10.1.3, PHP  4.1.2 and 
Apache/1.3.20.

I've copied the php.ini-dist to usr/local/lib and renamed it php.ini

I have also uncommented the following lines from the httpd.conf -
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

The server was also restarted using the command:
sudo apachectl graceful

When i run my .php file containing:

?php

$to=[EMAIL PROTECTED];
$from=[EMAIL PROTECTED];
$subject=Hi;
$message=this message;
mail($to, $subject, $message, $from\r\nX-Priority: 1 (Highest));

?
... nothing seems to happen ei. the mail was not sent.

Can anyone suggest anything that i could do to try and rectify this 
problem.
Thanks in advance.

-jen-



Re: [PHP] mail()

2002-03-19 Thread Jennifer

sorry...i should have mentioned also that I am not using the internal 
mail server but i am using an external mail server

On Wednesday, March 20, 2002, at 05:24 PM, Jennifer wrote:

 Hi guys,

 I'm new to PHP and i'm trying to set it up so that i can use the mail() 
 function to send emails. I'm using Mac OS X 10.1.3, PHP  4.1.2 and 
 Apache/1.3.20.

 I've copied the php.ini-dist to usr/local/lib and renamed it php.ini

 I have also uncommented the following lines from the httpd.conf -
 AddType application/x-httpd-php .php .phtml
 AddType application/x-httpd-php-source .phps

 The server was also restarted using the command:
 sudo apachectl graceful

 When i run my .php file containing:

 ?php

 $to=[EMAIL PROTECTED];
 $from=[EMAIL PROTECTED];
 $subject=Hi;
 $message=this message;
 mail($to, $subject, $message, $from\r\nX-Priority: 1 (Highest));

 ?
 ... nothing seems to happen ei. the mail was not sent.

 Can anyone suggest anything that i could do to try and rectify this 
 problem.
 Thanks in advance.

 -jen-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] fopen failing to connect

2002-05-15 Thread jennifer

Hello

I have a script which uses fopen( ).  It works on my local machine which has
php and apache on a windows platform as well as on another server
(php/apache) which is windows based.  However, when I have the same script on
a unix machine (php/apache), the fopen gives me the following error:


Warning: php_hostconnect: connect failed in
/usr/local/apache/htdocs/514parser.php on line 135

Warning:
fopen(http://www.thedeal.com/NASApp/cs/ContentServer?pagename=TheDeal/xmlfeed;,
r) - Bad file number in /usr/local/apache/htdocs/514parser.php on line 135
Any suggestions?

-jennifer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] fopen failing to connect

2002-05-15 Thread Jennifer

i looked at the php.ini file and f wrapper is configured. thanks for the
suggestion. i am still looking for any suggestions anyone has. thanks.

-jennifer

Miguel Cruz wrote:

 Sounds like maybe the fopen url wrapper is not installed. I've never taken
 any particular steps to install it, so I'm not sure how that would come
 about.

 miguel

 On Wed, 15 May 2002, jennifer jefferson wrote:
  thanks for looking. my guess is that it could be a
  server configuration issue. i am really not sure. the
  actual script works just not on the server i need
  it to work on. maybe it has something to do with the
  .ini file or the installation. i am not very familiar
  with that. does this sound likely as a problem?
  thanks.
 
  -jennifer
 
  --- Kevin Stone [EMAIL PROTECTED] wrote:
   Jennifer, works just fine here..
  
   -
   $fp =
  
  fopen(http://www.thedeal.com/NASApp/cs/ContentServer?pagename=TheDeal/xmlfe
   ed,r);
   if ($fp !== FALSE)
echo The file exists!;
   else
   echo The file does not exist;
   -
  
   This prints The file exists! so it may be
   something else in your code
   cuasing the problem.  And when I read the file it
   displays a bunch of
   numbers.  Don't know what you could be doing wrong
   but if you continue to
   experiece problems post some more of your code and
   maybe we can decipher the
   error from that.
  
   -Kevin
 
  __
  Do You Yahoo!?
  LAUNCH - Your Yahoo! Music Experience
  http://launch.yahoo.com
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How to add a new color to JPEG

2001-07-17 Thread Jennifer



Jennifer wrote:
 it seems to ignore the color that I specify and always came out
 grey. (Of course now if I use ImageColorClosest(), some colors
 work because they are in my image.)
 
 
 Any idea on how solutions?
 


Oops.  I didn't read far enough.  I found the following in a
separate thread.


 I experienced the same, but i use following workaround: 
 Create a new Jpeg, Allocate your colours, and copy your original jpg
 into the new one. then you have all the colours you have allocated in
 your new pic...

So now my question is, how do I copy one image into another?

I see ImageCopy(), but it mentions copying a part of the image,
so do I have to use GetImageSize to determine the size of the src
image first?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Whitespace in Emails

2006-12-12 Thread jennifer
I'm experiencing a strange problem and difficult to diagnose because  
it's random. I have built an application that sends out an email with  
a nice amount of text (don't have exact char count, but could get it).


On the html email, a random whitespace appears in the content, but  
always toward the end pointing to a possible character count issue.


See below for examples of how the space wanders and is random:

1- Th ere are several things being discussed in this email.
2- There are se veral things being discussed in this email.
3- There are severa l things being discussed in this email.

This whitepace issue happens after the email is sent.

Anybody have any ideas?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] TTF Support

2001-04-10 Thread Jennifer

How do I find out if my installation supports this?

I am on a virtual server, and I know my host has Apache installed
with mod_php4

Is there something that I can check to see if the FreeType
library is there when I only have a virtual server?

And if it wasn't installed, is there any way that I can do this
locally without having root access?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] What is Dynamic Library support

2001-04-12 Thread Jennifer

When I do phpinfo() on my server one of the things it says is

PHP_DL
Dynamic Library support enabled.

What does that mean?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] is_null

2001-04-12 Thread Jennifer

I wanted to use is_null, but it isn't available in my version
(4.0B2)

What would be an equivalent?  I'm fairly new to PHP.

I was using isset, but sometimes it is set to Null.

Null values are unacceptable, but zero is a perfectly acceptable
value for what I want.

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Sessions

2001-04-29 Thread Jennifer

I have been doing a few test pages trying to figure out how
sessions work.

The SID is not being automatically added to my urls so I assume
that means that php was not compiled with -enable-trans-sid  (I'm
on a virtual server so I can't access php.ini)

So that means that I need to add ?=SID? to all my urls,
correct?

Can I change the value of session_name() and still have the above
work for the new session name?

I tried it and the session_name was changed to the new value, but
then SID seemed to be empty after that.  Is there something I am
missing or is that the way it is supposed to work?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] session_register()

2001-05-02 Thread Jennifer

I have been racking my brain with this for hours and I am not
getting anywhere.

session_register doesn't seem to be registering my variables.

Several questions to see if I am even on the right track.

Do you need to register a variable with the session before you
assign it a value?  

session_register should return true if the variable was
successfully registered?

The variable name and it's value should be written to the file
with the same name as session_id()?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] session_register()

2001-05-03 Thread Jennifer



Warren Vail wrote:
 
 When the session_register is executed the session contents are partially
 updated.
 Your first test actually executed the session_register that posted the
 variable with 0 string length, because the variable had not yet been
 initialized (the bad return is the only indication of this).

Ok.  I changed the script below to set the variable before
registering it and it makes no difference to the output.

 
 You can identify what actually happened by viewing the session file contents
 after your two pages are displayed.

I mentioned that already.  The file is empty.


Jennifer


 Johnson, Kirk wrote:
 
   -Original Message-
   From: Jennifer [mailto:[EMAIL PROTECTED]]
   Do you need to register a variable with the session before you
   assign it a value?
 
  Not in my experience.
 
   session_register should return true if the variable was
   successfully registered?
 
  It returns 1.
 
   The variable name and it's value should be written to the file
   with the same name as session_id()?
 
  Yes, here's a sample from a session file: superUser|s:3:Yes;
  Here's a sample session filename: sess_01bc2e24aa5291300887948f0af74899
 
 This is all what I thought, but I am still having problems and I
 don't have a clue what I am missing. Here's an example that I
 have been paying with for testing.
 
 page1.php contains
 ?php
 session_start();
 echo session id is .session_id().br\n;
 if (session_register(testing)) {
 echo session_register worked.br\n;
 }
 else {
 echo session_register did not workbr\n;
 }
 if (session_is_registered(testing)) {
 echo testing is a registered variablebr\n;
 }
 else {
 echo testing is not a registered variablebr\n;
 }
 $testing = Let's see if this works.;
 ?
 a href=page2.php??=SID?Go to next page./a
 
 The output of the above page, gives me
 session id is e35c2893382e28a14fa0455302edb06e
 session_register did not work
 testing is a registered variable
 Go to next page.
 
 and page2.php contains
 ?php
 session_start();
 echo session id is .session_id().br\n;
 echo Testing: $testingbr\n;
 ?
 
 The output of page2 gives me
 session id is e35c2893382e28a14fa0455302edb06e
 Testing:
 
 I am totally confused.  First off, why isn't it registering the
 variable? There is a file named e35c2893382e28a14fa0455302edb06e
 in my /tmp directory, but it is empty.
 
 Second, if it isn't registering the variable then why is
 session_is_registered(testing) returning true?
 
 Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Working with numbers

2001-05-03 Thread Jennifer

I have a shopping cart that allows decimal points for quantities.
I like it like that, but would like to remove any trailing zeros
and if the quantity is not a fraction I would like to remove the
decimal point too.

What would be the easiest way to do this?  I don't see any
function that would make it easy.

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] session_register()

2001-05-03 Thread Jennifer

This is bad, bad, bad.  I tried using another browser as you
suggested (since I was using Netscape 4.7) and the
session_register worked.  I still got different results than you
though.

Read throughout for more comments.

Johnson, Kirk wrote:
 
 Jennifer, there are at least two of us totally confused. I did a copy and
 paste of your code and got the expected results:
 
 session id is afb1f9e27afc752f7d9e96e096ca2209
 session_register worked.
 testing is a registered variable

Using IE 5, I got the same results here as with NS4.7

session id is e49f9b5ddb39388ab48c45dd4f14b00c
session_register did not work
testing is a registered variable
Go to next page.

*But*  It did work. So why did session_register return false?

 
 with the contents of /tmp/sess_afb1f9e27afc752f7d9e96e096ca2209 being:
 
 testing|s:24:Let's see if this works.;

This is the contents of my session file too *when* I use IE for
my browser.



 1. What browser are you using? I, and others, have seen erratic results with
 sessions using Netscape 4.x. If this is your browser, try your code with
 another browser, if possible.

This appears to be the problem.  Now what?  So I have to forget
about sessions or forget about the multitude of NS 4.x users that
still exist?



 2. This is a longshot, but who is PHP running as? By default, it is nobody.
 In any case, check that whomever PHP is running as has write permission to
 /tmp.

I had thought of that one.  I increased the permissions to be
world writable and it had no effect.

Thank you for helping me find the problem, now I just wish there
was an easy solution.  Arggg.

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] session_register() - Netscape workaround?

2001-05-05 Thread Jennifer



Johnson, Kirk wrote:
 
  -Original Message-
  From: Jennifer [mailto:[EMAIL PROTECTED]]
  Subject: Re: [PHP] session_register()
 
   1. What browser are you using? I, and others, have seen
  erratic results with
   sessions using Netscape 4.x. If this is your browser, try
  your code with
   another browser, if possible.
 
  This appears to be the problem.  Now what?  So I have to forget
  about sessions or forget about the multitude of NS 4.x users that
  still exist?
 
 At least 3 of us have reported this problem here on this list. No one seems
 to have an answer. On the up side, it seems to be erratic, Netscape 4.x
 sometimes works. Realistically, this affects less than 10% of your visitors.
 So I don't know what else to say, except good luck!
 


I thought of a workaraound for Netscape and would like some
feedback on how to do it and whether it is a good idea.

I manually edited the session file and Netscape was able to read
the variable on subsequent pages.  It just can't seem to write
it.

So I thought, until Netscape 4.x is more of a gonner, I could
have my own custom_session_register() function that can open the
file and write the info manually.

2 questions.
1) Is there some reason that this would be a bad idea?

2) What is the format of the file? My file contents are
testing|s:24:Let's see if this works.;

So that is
variable_name|what is the s for? scalar
maybe?:value_length?:value in quotes;

And I'm assuming that a newline delimits the variables? Sorry,
haven't tried a test with more than one variable yet.

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] session_register() - Netscape workaround?

2001-05-05 Thread Jennifer



Jennifer wrote:
 I thought of a workaraound for Netscape and would like some
 feedback on how to do it and whether it is a good idea.
 
 I manually edited the session file and Netscape was able to read
 the variable on subsequent pages.  It just can't seem to write
 it.
 
 So I thought, until Netscape 4.x is more of a gonner, I could
 have my own custom_session_register() function that can open the
 file and write the info manually.
 
 2 questions.
 1) Is there some reason that this would be a bad idea?


I would still really like to know this answer.


 
 2) What is the format of the file? My file contents are
 testing|s:24:Let's see if this works.;
 
I think I figured this out. 

variable_name|variable_type*:length*:value*;

*variable_type is the first letter of the type

*length can be diferent things depending on the variable type. 
I've only tried a few, but here is what I have gathered thus
far.  If type is string, then length is the length of the value,
pretty simple. If type is integer then there is no length and it
is skipped altogether rather than being left blank.  If type is
array, then length is the number of elements.

*value can also vary depending on type.  If type is string, then
it is simply the value quoted, if the type is integer then it is
simply the value. If type is array, then each element of the
array is described by type and length etc.  After trying a few,
it's not too difficult to see the pattern.


Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] passing variables to a sql statement

2003-01-18 Thread jennifer
hi, i'm hoping someone can help me out here - im trying to pass a variable from a 
string in the href tag, however my sql breaks when i put a var in the statment.
when i replace $foo with a number, the page works fine. can someone please tell me 
what im doing wrong?

here is the error i get:

Warning: Supplied argument is not a valid MySQL result resource in 
/home/villany2k1/www.villany2k1.com/htdocs/projects/projects_descrip.php on line 11



here is my code:

?php
$hostName=localhost;
$userName=;
$password=;
$database= projects;
$tableName=project_descrip;

$descripQuery = SELECT descrip from project_descrip where rowid=$foo;
mysql_connect($hostName, $userName, $password);
$descripResult = mysql_db_query($database,$descripQuery);
   while($row = mysql_fetch_object($descripResult)){

$foo = $row-descrip;

echo(font face=verdana size=1);
echo(a href='projects_descrip.php?rowid=$foobar' . $foo/a .  | );
echo(/font);

  }


?

thanks in advance, 
jennifer



[PHP] connecting to a txt file - newbie

2002-10-10 Thread jennifer

good morning, im having some issues with the simple task of pulling from a
txt file.

my code is:

html
 head
  titlejob app/title
 /headdb
body
?php

if(!$file=fopen(text.txt, r)) {
  echo(couldnt open the file);
} else {
  $text = fread($file, 100);
  fclose($file);
}
?
  /body
/html

and the txt file contains one line of bogus txt. you can see my results
here: http://www.villany2k1.com/text.php.

if anyone has any info as to what i am doing wrong, i would really
appreciate it.

thanks so much
jennifer
([EMAIL PROTECTED])



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Conversion between dates and weeknumbers

2001-03-20 Thread Jennifer Woodhead

I think you can do it using
strftime

%V - The ISO 8601:1988 week number of the current year as a decimal number,
range 01 to 53, where week 1 is the first week that has at least 4 days in
the current year, and with Monday as the first day of the week. 

%W - week number of the current year as a decimal number, starting with the
first Monday as the first day of the first week 


-Original Message-
From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
Sent: 20 March 2001 09:03
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Conversion between dates and weeknumbers


How about use PEAR/Date/Calc.php?

Regards,
--
Yasuo Ohgaki

"Michel Groenenstijn" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello everybody,

 I need to convert between dates and weeknumbers, with PHP.  Converting a
 given date to a weeknumber can be done with MySQL, but I don't know how
 to go the other way around. I need a function like
 get_dates_in_week($weeknumber). A function to convert between a date and
 a weeknumber without using mysql would help too...

 Can anyone help?

 Thanx!
 Michel


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Random number Question

2002-03-12 Thread Jennifer Downey

Hi all,

I having a hard time understanding why this won't work. I have a form which
is suppose to pass the guess to the script. Here it is:

the form is guess.php:

form action=number.php method=post
The computer has picked a number between 1 and 10. Guess the number and you
win!BR


Enter your guess:
input type=text size=3
INPUT TYPE=submit VALUE=Submit my number NAME=guess
/form


The script is number.php:

?php
echoThe number is:;

srand((double)microtime()*100);
$number = rand(1,10);

echo $number;

if($guess = = $number) {
 echoBRYou have won!;
 }else{
 print(BRSorry that wasn't the answer);

}
?

Any help would be appreciated.

Thanks in advance
Jennifer Downey



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] DHTML Trouble please help

2002-03-13 Thread Jennifer Downey

Hi all,

I am no DHTML expert and don't even know the language also didn't know where
to post this. But after today I am going to learn.

I downloaded a tetris game from Dynamic Drive:
http://www.dynamicdrive.com/dynamicindex12/tetris/index.htm

Have a look. I would add it here but it's too long.

I want to add the high score to a users data in the database.

Would one of you DHTML and PHP Gurues (SP) please point out what section of
the code I would use to get the high score.

I would like to (I can do this part if someone would show what I use from
the DHTML) echo or print the score to the bottom of the browser window and
then have that added to the db.


TIA
GC







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] MySQL and indexes

2002-03-18 Thread Jennifer Downey

Hi all,

Just wondering, does a table have to have an index? If so what should I
consider when making a colum an index?

Here is the table I am using but I can't get php to update it.
Is it because there is no index?


CREATE TABLE wt_pet (
  petid varchar(100) default NULL,
  pet_user int(10) NOT NULL default '0',
  petname varchar(50) NOT NULL default '',
  pet_sex enum('Male','Female') NOT NULL default 'Male',
  pet_equip varchar(50) NOT NULL default '',
  pet_state varchar(20) NOT NULL default '',
  pet_hunger varchar(20) NOT NULL default '',
  pet_date date NOT NULL default '-00-00',
  num_pets int(1) NOT NULL default '0',
  ) TYPE=MyISAM;


Thanks
Jennifer Downey



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Getting user name in text area

2002-03-28 Thread Jennifer Downey

Hi all,

Here is what I have and what I am trying to do.

I would like the user name to be printed in the  Username text box but can't
seem to get it there.
I don't want the user to have to type there username in, just click the
submit button and it is entered into the db.
Can anyone show me what I have done wrong?

$query=SELECT name FROM users WHERE uid={$session[uid]};
$ret = mysql_query($query);
while(list($name)=
mysql_fetch_row($ret))
print(BRBRBR$name);


?
table ALIGN=center WIDTH=80%tr
tdform ACTION=?php  echo($PHP_SELF);? METHOD=post
?
print tdbrUsername: input type=\text\ value=\$name\
name=\u_name\ size=30/td/trtrtd;
print input TYPE=\submit\ name=\action\ VALUE=\Submit my
entry\/centerbrbr;
?
/form/td/tr
/table
?
if($action = Submit my entry){
if (!empty($name)){
$enter = insert into entry (id, user_name) values ('','$u_name');
mysql_query($enter) or die(mysql_error());
}
}


TIA
Jennifer



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Closing curly brackets?

2002-04-12 Thread Jennifer Downey

Hi everyone,

I have a question about this code. The way it sits now it always shows the
last record in the table.
in other words if the user has 6 items, like:
item id 1
item id 2
item id 5
item id 6
item id 7
item id 8

it will only show the last record item id 8.

I believe it has something to do with the first while statement's closing
curly bracker
But I can't seem to get it in the right place.

Can someone spot the mistake and show me how to fix it.
see also comments in code.



$id = $HTTP_GET_VARS[id];


$query = SELECT id, name, image, quantity, type FROM
{$config[prefix]}_my_items WHERE uid={$session[uid]} ORDER BY id;
$ret = mysql_query($query);
 while($row = mysql_fetch_array($ret))
{
$iid = $row['id'];
$image = $row['image'];
$name = $row['name'];
$quantity = $row['quantity'];
$type = $row['type'];


if($iid == $id)
{
$display_block =CENTERimg src=$image border=0brfont size =
2$nameBR$quantityBR$type/font/CENTER;
echo $display_blockBRBR;
if($type == food)
//if book or weapon is present then set an option and include in the form
later
{$thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION;
}else{
//if any other type is present then set a blank
$thisoption=;}
}
}



//check if form has been submitted
if($submit){

   if($sort == 'shop')
 {
 echo This item has been taken care ofBR;

// We are selecting user id to insert into the users items.
$db=SELECT  uid FROM {$config[prefix]}_users WHERE
uid={$session[uid]};
$ret = mysql_query($db);
while(list($db)=mysql_fetch_row($ret))
{ $user = $db;
echo Your user ID is $userBR;
}


echo You have $quantity of this item and it's id is $iidBR;


}
// it seems like the first while statement's closing curly bracket should go
here but if I put it here I get a pars error.
}else{
//if the form has not been submitted run the following


?
FORM ACTION=?echo$PHP_SELF;? METHOD=post
SELECT NAME=sort SIZE=1 
?echo $thisoption;?
OPTION VALUE=shopPut in my shop/OPTION
OPTION VALUE=lockerPut into my Footlocker/OPTION
OPTION VALUE=discardDiscard this item/OPTION
OPTION VALUE=donateDonate this item/OPTION
/SELECT
INPUT TYPE=submit VALUE=Submit NAME=submit 
/FORM
?
}
//if I put the first while statement's closing curly bracket here it works
great except it prints multiple dropdown lists on the page.

I have tried the bracket in numerous places but I can't find the right spot.





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Closing curly brackets?

2002-04-12 Thread Jennifer Downey

My apologies for putting this in the wrong list.

Jennifer

Jennifer Downey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi everyone,

 I have a question about this code. The way it sits now it always shows the
 last record in the table.
 in other words if the user has 6 items, like:
 item id 1
 item id 2
 item id 5
 item id 6
 item id 7
 item id 8

 it will only show the last record item id 8.

 I believe it has something to do with the first while statement's closing
 curly bracker
 But I can't seem to get it in the right place.

 Can someone spot the mistake and show me how to fix it.
 see also comments in code.



 $id = $HTTP_GET_VARS[id];


 $query = SELECT id, name, image, quantity, type FROM
 {$config[prefix]}_my_items WHERE uid={$session[uid]} ORDER BY id;
 $ret = mysql_query($query);
  while($row = mysql_fetch_array($ret))
 {
 $iid = $row['id'];
 $image = $row['image'];
 $name = $row['name'];
 $quantity = $row['quantity'];
 $type = $row['type'];


 if($iid == $id)
 {
 $display_block =CENTERimg src=$image border=0brfont size =
 2$nameBR$quantityBR$type/font/CENTER;
 echo $display_blockBRBR;
 if($type == food)
 //if book or weapon is present then set an option and include in the form
 later
 {$thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION;
 }else{
 //if any other type is present then set a blank
 $thisoption=;}
 }
 }



 //check if form has been submitted
 if($submit){

if($sort == 'shop')
  {
  echo This item has been taken care ofBR;

 // We are selecting user id to insert into the users items.
 $db=SELECT  uid FROM {$config[prefix]}_users WHERE
 uid={$session[uid]};
 $ret = mysql_query($db);
 while(list($db)=mysql_fetch_row($ret))
 { $user = $db;
 echo Your user ID is $userBR;
 }


 echo You have $quantity of this item and it's id is $iidBR;


 }
 // it seems like the first while statement's closing curly bracket should
go
 here but if I put it here I get a pars error.
 }else{
 //if the form has not been submitted run the following


 ?
 FORM ACTION=?echo$PHP_SELF;? METHOD=post
 SELECT NAME=sort SIZE=1 
 ?echo $thisoption;?
 OPTION VALUE=shopPut in my shop/OPTION
 OPTION VALUE=lockerPut into my Footlocker/OPTION
 OPTION VALUE=discardDiscard this item/OPTION
 OPTION VALUE=donateDonate this item/OPTION
 /SELECT
 INPUT TYPE=submit VALUE=Submit NAME=submit 
 /FORM
 ?
 }
 //if I put the first while statement's closing curly bracket here it works
 great except it prints multiple dropdown lists on the page.

 I have tried the bracket in numerous places but I can't find the right
spot.





 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Closing curly brackets?

2002-04-13 Thread Jennifer Downey

Well as I have seen lot's of people get yelled at if they post in the wrong
list. So rather than letting that happen and risk not getting any help I
thought I would apologize and send it to the right list.

Anyway the file you sent is it in the correct format? I have asked about a
tutorial on proper code formatting and got back a tutorial that was
extremely hard to understand. While lots of people have screamed at me for
my  coding format no one has supplied an understandable answer. That is
until this morning.

From Paul Burney :

Hi Jennifer,

The first thing you should do is properly indent your code.  If you do so,
you'll be sure to find the missing bracket.  Basically, for each new block,
tab out again.  It really helps to use a programmer's editor with syntax
highlighting like vim or BBEdit.

Thought that was the best tutorial I could ever get. Short and sweet and oh
so easy to understand.
I am using HTML_Kit as it has the same features as all the othere editors
(color coding and such) but it also has a lot more I can get plugins for
anything I would ever need. Except a formatting tutorial ;)

I will use your code as an example of formatting.
It doesn't work as far as the script goes as it returns multiple:
Warning: Supplied argument is not a valid MySQL result resource.

So I am going to study your formatting and start at the beginning.

But thank you for your time and help! :)

You have been a great help, look at my new signature.

Thanks again
Jennifer



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP MySQL Hosting services

2002-04-13 Thread Jennifer Downey

Hi everyone,

I am wondering if anyone has a good hosting service? I am currently with
Aletia which has an excellant package good tech support but sometimes not
very functional servers.

My site has gone down at least 3 times within the last 20 days. Too many for
me.

It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course
PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at least
15 POP3 email accounts, cron support.

Thanks
Jennifer
--
The sleeper has awaken






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Using one submit button

2002-04-16 Thread Jennifer Downey

Hi all,

I thought I was going to give php a break today but I can't it's too
adicting.

I am having a little problem with a submit button in which it is suppose to
update records from a form.

Here is the code





echo BRBRa href=\locker.php\My Locker/a | a
href=\myshop.php\My Shop/a | a href=\items.php\My
Items/aBRBR;
echo TABLE BORDER='0' WIDTH='95%' CELLPADDING='0' CELLSPACING='0'TRTD
width=20%Bfont size=2Image/font/B/TDTD width=30%Bfont
size=2Name/font/B/TDTD width=20%Bfont
size=2CENTERQuantity/CENTER/font/B/TDTD width=30%Bfont
size=2CENTERRemove Item/CENTER/font/B/TDTD width=30%Bfont
size=2CENTERPrice/CENTER/font/B/TD/TR/table;
echo FORM action='$PHP_SELF' METHOD='post';

 $query = SELECT uid, id, name, image, type, quantity FROM
{$config[prefix]}_shop WHERE uid = {$session[uid]};
 $ret = mysql_query($query);
 while($row = mysql_fetch_array($ret))
{
 $uid = $row['uid'];
 $id = $row['id'];
 $name = $row['name'];
 $image = $row['image'];
 $iquantity = $row['quantity'];
 $itype = $row['type'];


 echo TABLE BORDER='0' WIDTH='95%' CELLPADDING='0'
CELLSPACING='0'TR;
 echo TD width=20%img src='$image'/TD;
 echo TD width=30%font size=2$name/font/TD;
 echo TD width=20%font
size=2CENTER$iquantity/CENTER/font/TD;
 echo TD width=30%font size=2CENTERa
href='$PHP_SELF?id=$idremove=yes'X/a/CENTER/font/TD;
 echo TD width=30%font size=2CENTERinput type=\text\
value=\\ name=\price\ size='6'
MAXLENGTH='8'BR/a/CENTER/font/TD;
 echo /TD/TR/TABLE;

 echo input=\hidden\ name=\remove\ value=\yes\;
}
echo CENTERINPUT TYPE=\submit\ NAME=\update\ VALUE=\Updat
Prices\;
echo /form;
 if($update)
{
 $query = UPDATE {$config[prefix]}_shop SET price = '$price'
where uid = {$session[uid]};
 $ret = mysql_query($query);
}








What I need this to do is update the price in the db table.
if I have on item it is fine. If I have two items it won't update the first
items price but will the second. if I try to enter a price in the first
items textbox it doesn't update and then deletes the second item's price.

If I have 15 items and using one submit button how do I get this to update
all items that are listed?

TIA
Jennifer

--
The sleeper has awaken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Using one submit button

2002-04-16 Thread Jennifer Downey

Do you mean something like this?

   if($update)
{
 $iprice = $price[price];
   $query = UPDATE {$config[prefix]}_shop SET price = $iprice where uid =
{$session[uid]} AND id = $id;
   $ret = mysql_query($query);
}

Martin Towell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 user price[] as the name
 you'll also need to pass the ids as $id[]
 so you know which one you're updating

 -Original Message-
 From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 17, 2002 11:51 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Using one submit button


 Hi all,

 I thought I was going to give php a break today but I can't it's too
 adicting.

 I am having a little problem with a submit button in which it is suppose
to
 update records from a form.

 Here is the code

 --
--
 


 echo BRBRa href=\locker.php\My Locker/a | a
 href=\myshop.php\My Shop/a | a href=\items.php\My
 Items/aBRBR;
 echo TABLE BORDER='0' WIDTH='95%' CELLPADDING='0'
CELLSPACING='0'TRTD
 width=20%Bfont size=2Image/font/B/TDTD width=30%Bfont
 size=2Name/font/B/TDTD width=20%Bfont
 size=2CENTERQuantity/CENTER/font/B/TDTD width=30%Bfont
 size=2CENTERRemove Item/CENTER/font/B/TDTD width=30%Bfont
 size=2CENTERPrice/CENTER/font/B/TD/TR/table;
 echo FORM action='$PHP_SELF' METHOD='post';

  $query = SELECT uid, id, name, image, type, quantity FROM
 {$config[prefix]}_shop WHERE uid = {$session[uid]};
  $ret = mysql_query($query);
  while($row = mysql_fetch_array($ret))
 {
  $uid = $row['uid'];
  $id = $row['id'];
  $name = $row['name'];
  $image = $row['image'];
  $iquantity = $row['quantity'];
  $itype = $row['type'];


  echo TABLE BORDER='0' WIDTH='95%' CELLPADDING='0'
 CELLSPACING='0'TR;
  echo TD width=20%img src='$image'/TD;
  echo TD width=30%font size=2$name/font/TD;
  echo TD width=20%font
 size=2CENTER$iquantity/CENTER/font/TD;
  echo TD width=30%font size=2CENTERa
 href='$PHP_SELF?id=$idremove=yes'X/a/CENTER/font/TD;
  echo TD width=30%font size=2CENTERinput type=\text\
 value=\\ name=\price\ size='6'
 MAXLENGTH='8'BR/a/CENTER/font/TD;
  echo /TD/TR/TABLE;

  echo input=\hidden\ name=\remove\ value=\yes\;
 }
 echo CENTERINPUT TYPE=\submit\ NAME=\update\ VALUE=\Updat
 Prices\;
 echo /form;
  if($update)
 {
  $query = UPDATE {$config[prefix]}_shop SET price = '$price'
 where uid = {$session[uid]};
  $ret = mysql_query($query);
 }



 --
--
 



 What I need this to do is update the price in the db table.
 if I have on item it is fine. If I have two items it won't update the
first
 items price but will the second. if I try to enter a price in the first
 items textbox it doesn't update and then deletes the second item's price.

 If I have 15 items and using one submit button how do I get this to update
 all items that are listed?

 TIA
 Jennifer

 --
 The sleeper has awaken


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Using one submit button

2002-04-17 Thread Jennifer Downey

Thank you Jason and Kevin for your time and help.

Does this look like what I should have?

if(isset($update))
for ($i=0; $icount($id); $i++)
{
if ($id[$i] == $row[id])
{


 $query = UPDATE {$config[prefix]}_shop SET price = $price[$i]
where uid = {$session[uid]} AND id = $id[$i];
 $ret = mysql_query($query) or die(mysql_error());
}
else
{

 echo TD width=30%font size=2CENTERinput=\hidden\
name=\id[$i]\ value=\$id\input type=\text\ value=\\
name=\price[$i]\ size='8' MAXLENGTH='8'BR/a/CENTER/font/TD;

Jennifer

Kevin Stone [EMAIL PROTECTED] wrote in message
004301c1e633$e1e20090$6601a8c0@kevin">news:004301c1e633$e1e20090$6601a8c0@kevin...
 -
 I picked up your question soon after you submited it then my internet went
 down so I wasn't able to send it.  Looks like it's been answered by
someone
 else since then but here you go anyway.  I didn't want to feel as though
I'd
 wasted my time.  :D
 -kevin
 -

 Looks like you want to extract the values from the $price array in the
same
 order as you extracted the associated rows from the database.  At first
 glance I can say you aren't passing enough information to be able to
 determine an order for updating. You'll need to send the product ids along
 with the prices and then create a counter to loop through the ids array
and
 test each case.

 I would sugget you build an $id[] list the same way as the $price[] list
but
 generate them as hidden fields.  Then within the if(isset($update))
 statement loop through all $id values for each itteration of the while
 loop...

 for ($i=0; $icount($id); $i++)
 {
 if ($id[$i] == $row[id])
 {
 // we know that there are the same number of ids as there are
prices
 so we can use $i for the $price index as well.
 $query = UPDATE $table SET price = $price[$i] WHERE id =
$id[$i];
 // do update..
 }
 }

 -Kevin

 - Original Message -
 From: Jennifer Downey [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 17, 2002 10:11 AM
 Subject: [PHP] Re: Using one submit button


  I have no takers on this one?
 
  Just to let you know I have been working on this to here is some new
code.
  What I need this to do is update the price in the db table.
   if I have on item it is fine. If I have two items it won't update the
 first
   items price but will the second. if I try to enter a price in the first
   items textbox it doesn't update and then deletes the second item's
price.
 
   If I have 15 items and using one submit button how do I get this to
 update
   all items that are listed?
 
  $query = SELECT uid, id, name, image, type, quantity, price FROM
  {$config[prefix]}_shop WHERE uid = {$session[uid]};
 $ret = mysql_query($query);
 while($row = mysql_fetch_array($ret))
  {
 $uid = $row['uid'];
 $id = $row['id'];
 $name = $row['name'];
 $image = $row['image'];
 $iquantity = $row['quantity'];
 $itype = $row['type'];
 $iprice = $row['price'];
 
  if($update)
  {
   $eprice = '$price[]';
   $query = UPDATE {$config[prefix]}_shop SET price = '$eprice'
  where uid = {$session[uid]} AND id = '$id';
   $ret = mysql_query($query) or die(mysql_error());
  }
  else
  {
 
   echo TABLE BORDER='0' WIDTH='95%' CELLPADDING='0'
  CELLSPACING='0'TR;
   echo TD width=20%img src='$image'/TD;
   echo TD width=30%font size=2$name/font/TD;
   echo TD width=20%font
  size=2CENTER$iquantity/CENTER/font/TD;
   echo TD width=30%font size=2CENTERa
  href='$PHP_SELF?id=$idremove=yes'X/a/CENTER/font/TD;
   echo TD width=30%font size=2CENTERinput
type=\text\
  value=\\ name=\price[]\ size='8'
  MAXLENGTH='8'BR/a/CENTER/font/TD;
   echo /TD/TR/TABLE;
 echo input=\hidden\ name=\remove\ value=\yes\;
  }
  }
  echo CENTERINPUT TYPE=\submit\ NAME=\update\ VALUE=\Updat
  Prices\;
  echo /form;
  Jennifer Downey [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Hi all,
  
   I thought I was going to give php a break today but I can't it's too
   adicting.
  
   I am having a little problem with a submit button in which it is
suppose
  to
   update records from a form.
  
   Here is the code
  
 

 --
  --
   
  
  
   echo BRBRa href=\locker.php\My Locker/a | a
   href=\myshop.php\My Shop/a | a href=\items.php\My
   Items/aBRBR;
   echo TABLE BORDER='0' WIDTH='95%' CELLPADDING='0'
  CELLSPACING='0'TRTD
   width=20%Bfont size=2Image/font/B/TDTD width=30%Bfont
   size=2Name/font/B/TDTD width=20%Bfont
   size=2CENTERQuantity/CENTER/font/B/TDTD width=30%Bfont
   size=2CENTERRemove Item/CENTER/font/B/TDTD
 width=30%Bfont
   size=2CENTERPrice/CENTER/font/B/TD/TR/table;
   echo FORM action='$PHP_SELF' METHOD='post';
  
$query = SELECT uid, id, name, image, type, quantity FROM
   {$conf

Re: [PHP] Re: Using one submit button

2002-04-17 Thread Jennifer Downey

Thank you Jason and Kevin for your time and help.

Does this look like what I should have?

if(isset($update))
for ($i=0; $icount($id); $i++)
{
if ($id[$i] == $row[id])
{


 $query = UPDATE {$config[prefix]}_shop SET price = $price[$i]
where uid = {$session[uid]} AND id = $id[$i];
 $ret = mysql_query($query) or die(mysql_error());
}
else
{

 echo TD width=30%font size=2CENTERinput=\hidden\
name=\id[$i]\ value=\$id\input type=\text\ value=\\
name=\price[$i]\ size='8' MAXLENGTH='8'BR/a/CENTER/font/TD;

Jennifer

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Thursday 18 April 2002 00:11, Jennifer Downey wrote:
  I have no takers on this one?
 
  Just to let you know I have been working on this to here is some new
code.
  What I need this to do is update the price in the db table.
   if I have on item it is fine. If I have two items it won't update the
  first items price but will the second. if I try to enter a price in the
  first items textbox it doesn't update and then deletes the second item's
  price.
 
   If I have 15 items and using one submit button how do I get this to
update
   all items that are listed?
 
  $query = SELECT uid, id, name, image, type, quantity, price FROM
  {$config[prefix]}_shop WHERE uid = {$session[uid]};
 $ret = mysql_query($query);
 while($row = mysql_fetch_array($ret))
  {
 $uid = $row['uid'];
 $id = $row['id'];
 $name = $row['name'];
 $image = $row['image'];
 $iquantity = $row['quantity'];
 $itype = $row['type'];
 $iprice = $row['price'];
 
  if($update)
  {
   $eprice = '$price[]';

 I don't know what else is wrong with your code, but this is *definitely*
 going to cause problems.

 I assume you mean:

   $eprice = $price[];

 But even this is wrong. You should probably be keeping a counter, eg $i,
then
 use:

   $eprice = $price[$i];

 [snip]

  value=\\ name=\price[]\ size='8'

   value=\\ name=\price[$i]\ size='8'

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 We have a equal opportunity Calculus class -- it's fully integrated.
 */


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] If else question

2002-04-23 Thread Jennifer Downey

Hi all,

I am wondering. When you use an if else statement and a condition exists
isn't the if part suppose to stop?
Then if the condition doesn't exist it is suppose to do something else?

I am wondering because I have a form that goes something like this.

select such and such from the table
if that condition  1
echo that it can't be found
else
echo the form

But in this case even if the condition  1 it still echoes the form.
I am not understanding this.


Thanks for your time and help
Jennifer




--
The sleeper has awaken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey


 If and else expect to be followed by exactly 1 statement. To aggregate
 multiple statements as one, surround them with {curly braces}. I'm
 guessing you didn't do that, and you're seeing the execution of all but
 the first of the statements following the else.

 So it should be:

   if ($var1)
 echo can't be found;
   else
   {
 echo first line of form;
 echo second line of form;
   }
This is what I have:

if($quantity  1)
{
echo Sorry I can't seem to locate this item;
}
else
{
do this
}
So yes I have done exactly as you have stated and it still shows the form.

Jennifer


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey

It shows both.

Natalie Leotta [EMAIL PROTECTED] wrote in message
7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG...
 Does it show the message and the form or just the message?

 -Natalie

 -Original Message-
 From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 23, 2002 12:23 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] If else question



  If and else expect to be followed by exactly 1 statement. To aggregate
  multiple statements as one, surround them with {curly braces}. I'm
  guessing you didn't do that, and you're seeing the execution of all
  but the first of the statements following the else.
 
  So it should be:
 
if ($var1)
  echo can't be found;
else
{
  echo first line of form;
  echo second line of form;
}
 This is what I have:

 if($quantity  1)
 {
 echo Sorry I can't seem to locate this item;
 }
 else
 {
 do this
 }
 So yes I have done exactly as you have stated and it still shows the form.

 Jennifer


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Browser cache

2002-04-23 Thread Jennifer Downey

PLEASE TAKE THIS OUT OF MY THREAD.
I am trying to get an answer to my question. Not yours.

Thank you
Jennifer
Stuart Dallas [EMAIL PROTECTED] wrote in message
000d01c1eae5$96243450$de01420a@stuart">news:000d01c1eae5$96243450$de01420a@stuart...
 José León Serna [EMAIL PROTECTED] wrote:
  Hello:
  How could I disable the browser cache?, I have a script that
  generates an image and shows it via IMG SRC=myimage. The problem
  is if I change the image, the browser doesn't reflect the changes
  until I push refresh. I supose is sending a header, but which header?

 Headers aren't the best way since some browsers do a great job of ignoring
 them (or at least appearing to). The best way I've found to make sure the
 content is retrieved from the server is to add ?n to the URL replacing
 randomnumber with a random number (I usually use the return value from
 time()).

 HTH,
 Stuart



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey


I just looked at my hosting service thinkg it may have been because they
just upgraded to 4.1 php. so I dumped my database and loaded it to my
machine at home and find that it does the same thing.

I have 4.06 php on win me my hosting service is 4.1 php on redhat linux so
I'm thinking that is not the case.

I have used this code through out my site and this is the only part it does
this on and I am not understanding why.

Jennifer




Natalie Leotta [EMAIL PROTECTED] wrote in message
7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG...
 My officemate and I talked about this and the only thing he could come up
 with was a possible problem with your parser.  Are you using a beta
version
 or something unusual?  I don't know if you have a way to know this - the
 programmers didn't set up PHP where I work, but I know our web server is
 apache and it's on a unix box.  I've never run into this problem before.
 Have you had it happen in other programs?  Have you ever used this code in
 another program?  If it's consistently incorrect then it may be a problem
 with your parser.  That's not really my area of expertise, but it's
 something you could look into if no one else has any better ideas :-)

 -Natalie

 -Original Message-
 From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 23, 2002 12:26 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] If else question


 It shows both.

 Natalie Leotta [EMAIL PROTECTED] wrote in message
 7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG...
  Does it show the message and the form or just the message?
 
  -Natalie
 
  -Original Message-
  From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, April 23, 2002 12:23 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] If else question
 
 
 
   If and else expect to be followed by exactly 1 statement. To
   aggregate multiple statements as one, surround them with {curly
   braces}. I'm guessing you didn't do that, and you're seeing the
   execution of all but the first of the statements following the else.
  
   So it should be:
  
 if ($var1)
   echo can't be found;
 else
 {
   echo first line of form;
   echo second line of form;
 }
  This is what I have:
 
  if($quantity  1)
  {
  echo Sorry I can't seem to locate this item;
  }
  else
  {
  do this
  }
  So yes I have done exactly as you have stated and it still shows the
  form.
 
  Jennifer
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey

No this is the first if statement but there are nested if's after that. I'd
post the code but everyone yells at me about my coding style.
If you promise not to yell I will post it.

Jennifer
-Bd- [EMAIL PROTECTED] wrote in message
001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]...
 Is this a nested if? (inside another if statement?)




 - Original Message -
 From: Jennifer Downey [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, April 23, 2002 1:05 PM
 Subject: Re: [PHP] If else question


 
  I just looked at my hosting service thinkg it may have been because they
  just upgraded to 4.1 php. so I dumped my database and loaded it to my
  machine at home and find that it does the same thing.
 
  I have 4.06 php on win me my hosting service is 4.1 php on redhat linux
so
  I'm thinking that is not the case.
 
  I have used this code through out my site and this is the only part it
 does
  this on and I am not understanding why.
 
  Jennifer
 
 
 
 
  Natalie Leotta [EMAIL PROTECTED] wrote in message
  7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG...
   My officemate and I talked about this and the only thing he could come
 up
   with was a possible problem with your parser.  Are you using a beta
  version
   or something unusual?  I don't know if you have a way to know this -
the
   programmers didn't set up PHP where I work, but I know our web server
is
   apache and it's on a unix box.  I've never run into this problem
before.
   Have you had it happen in other programs?  Have you ever used this
code
 in
   another program?  If it's consistently incorrect then it may be a
 problem
   with your parser.  That's not really my area of expertise, but it's
   something you could look into if no one else has any better ideas :-)
  
   -Natalie
  
   -Original Message-
   From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, April 23, 2002 12:26 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] If else question
  
  
   It shows both.
  
   Natalie Leotta [EMAIL PROTECTED] wrote in message
   7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG...
Does it show the message and the form or just the message?
   
-Natalie
   
-Original Message-
From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 12:23 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] If else question
   
   
   
 If and else expect to be followed by exactly 1 statement. To
 aggregate multiple statements as one, surround them with {curly
 braces}. I'm guessing you didn't do that, and you're seeing the
 execution of all but the first of the statements following the
else.

 So it should be:

   if ($var1)
 echo can't be found;
   else
   {
 echo first line of form;
 echo second line of form;
   }
This is what I have:
   
if($quantity  1)
{
echo Sorry I can't seem to locate this item;
}
else
{
do this
}
So yes I have done exactly as you have stated and it still shows the
    form.
   
Jennifer
   
   
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
  
  
   ---
   Outgoing mail is certified Virus Free.
   Checked by AVG anti-virus system (http://www.grisoft.com).
   Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey

Ok you asked for it.
Don't say I didn't warn you.

session_start();
$query = SELECT name FROM {$config[prefix]}_users WHERE
uid={$session[uid]};
$ret = mysql_query($query);
while($row = mysql_fetch_array($ret))
{

$user = $row['name'];



$query = SELECT uid, id, iname, image, quantity, type FROM
{$config[prefix]}_my_items WHERE uid={$session[uid]} AND id = '$id'
ORDER BY id;
$ret = mysql_query($query);
while($row = mysql_fetch_array($ret))
{
  $uiid = $row['uid'];
 $iid = $row['id'];
  $image = $row['image'];
  $iname = $row['iname'];
  $quantity = $row['quantity'];
  $type = $row['type'];
// this is the problem if statement. Please don't yell at me for my style.
It is easy for me to read so I'm sorry if it's not for you.
if($quantity  1)
{
echo Sorry I can't seem to locate this item;
}
else
{

session_register(uiid);
session_register(iid);
session_register(image);
session_register(iname);
session_register(quantity);
session_register(type);


   if($iid == $id)
   {

$display_block .=CENTERimg src=$image border=0brfont size =
2$inameBR$quantityBR$typeBR/font/CENTER;

echo $display_blockBRBR;

  if($type == food)
  //if the item food is present then set an option and include in the
form later
  {
   $thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION;
  }
 else
{
//if book or weapon is present then set a blank
$thisoption=;
   }
  }
}
}
}
//check if form has been submitted
if($submit)
{

}
else
{

//if the form has not been submitted run the following


   echo FORM ACTION='$PHP_SELF' METHOD='post';
   echo SELECT NAME='sort' SIZE='1' ;
   echo $thisoption;
   echo OPTION VALUE='shop'Put in my shop/OPTION;
   echo OPTION VALUE='locker'Put into my Footlocker/OPTION;
   echo OPTION VALUE='discard'Discard this item/OPTION;
   echo OPTION VALUE='donate'Donate this item/OPTION;
   echo /SELECT;
   echo INPUT TYPE='submit' VALUE='Submit' NAME='submit';
   echo /FORM;


}

Jennifer



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey

You  are on the right track.
-Bd- [EMAIL PROTECTED] wrote in message
00a301c1eaf3$b181a260$[EMAIL PROTECTED]">news:00a301c1eaf3$b181a260$[EMAIL PROTECTED]...
 am i off on the wrong track here? i thought the original problem was that
 both clauses in the if statement were exectuting (the 'if' and the
'else')?






  Now, we're getting somewhere!!!
 
  First, have you printed out $query to ensure it contains what you
 expected?
  Show us.
 
  Second, are you certain the mysql_query() is successful?  I ask, because
 you
  don't have the or die() that SHOULD be on all queries.
 
  Third, have you printed out all the values fetched via
mysql_fetch_array()
  to ensure they contain valid data?
 
  - Original Message -
  From: Jennifer Downey [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, April 23, 2002 12:48 PM
  Subject: Re: [PHP] If else question
 
 
  Ok you asked for it.
  Don't say I didn't warn you.
 
  session_start();
  $query = SELECT name FROM {$config[prefix]}_users WHERE
  uid={$session[uid]};
  $ret = mysql_query($query);
  while($row = mysql_fetch_array($ret))
  {
 
  $user = $row['name'];
 
 
 
  $query = SELECT uid, id, iname, image, quantity, type FROM
  {$config[prefix]}_my_items WHERE uid={$session[uid]} AND id = '$id'
  ORDER BY id;
  $ret = mysql_query($query);
  while($row = mysql_fetch_array($ret))
  {
$uiid = $row['uid'];
   $iid = $row['id'];
$image = $row['image'];
$iname = $row['iname'];
$quantity = $row['quantity'];
$type = $row['type'];
  // this is the problem if statement. Please don't yell at me for my
style.
  It is easy for me to read so I'm sorry if it's not for you.
  if($quantity  1)
  {
  echo Sorry I can't seem to locate this item;
  }
  else
  {
 
  session_register(uiid);
  session_register(iid);
  session_register(image);
  session_register(iname);
  session_register(quantity);
  session_register(type);
 
 
 if($iid == $id)
 {
 
  $display_block .=CENTERimg src=$image border=0brfont size =
  2$inameBR$quantityBR$typeBR/font/CENTER;
 
  echo $display_blockBRBR;
 
if($type == food)
file://if the item food is present then set an option and include
in
  the
  form later
{
 $thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION;
}
   else
  {
  file://if book or weapon is present then set a blank
  $thisoption=;
 }
}
  }
  }
  }
  file://check if form has been submitted
  if($submit)
  {
 
  }
  else
  {
 
  file://if the form has not been submitted run the following
 
 
 echo FORM ACTION='$PHP_SELF' METHOD='post';
 echo SELECT NAME='sort' SIZE='1' ;
 echo $thisoption;
 echo OPTION VALUE='shop'Put in my shop/OPTION;
 echo OPTION VALUE='locker'Put into my Footlocker/OPTION;
 echo OPTION VALUE='discard'Discard this item/OPTION;
 echo OPTION VALUE='donate'Donate this item/OPTION;
 echo /SELECT;
 echo INPUT TYPE='submit' VALUE='Submit' NAME='submit';
 echo /FORM;
 
 
  }
 
  Jennifer




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey

Ok I have hard coded $quantity so it does = 0 and else still prints.
Maxim Maletsky ) [EMAIL PROTECTED] wrote in message
004701c1eaf1$c915c6b0$92e3021a@machine52">news:004701c1eaf1$c915c6b0$92e3021a@machine52...

 Try this, Jennifer:

 Without messing the rest of your code, change the line:

 $quantity = $row['quantity'];

 With this one:

 $quantity = 0;

 In other words: hardcode it for testing.

 If else always prints, then you are missing something in your query.
 Otherwise you've got something wrong in your code.





 Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 www.PHPBeginner.com   // where PHP Begins




 -Original Message-
 From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 23, 2002 7:48 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] If else question


 Ok you asked for it.
 Don't say I didn't warn you.

 session_start();
 $query = SELECT name FROM {$config[prefix]}_users WHERE
 uid={$session[uid]}; $ret = mysql_query($query); while($row =
 mysql_fetch_array($ret)) {

 $user = $row['name'];



 $query = SELECT uid, id, iname, image, quantity, type FROM
 {$config[prefix]}_my_items WHERE uid={$session[uid]} AND id = '$id'
 ORDER BY id; $ret = mysql_query($query); while($row =
 mysql_fetch_array($ret)) {
   $uiid = $row['uid'];
  $iid = $row['id'];
   $image = $row['image'];
   $iname = $row['iname'];
   $quantity = $row['quantity'];
   $type = $row['type'];
 // this is the problem if statement. Please don't yell at me for my
 style. It is easy for me to read so I'm sorry if it's not for you.
 if($quantity  1) { echo Sorry I can't seem to locate this item; }
 else {

 session_register(uiid);
 session_register(iid);
 session_register(image);
 session_register(iname);
 session_register(quantity);
 session_register(type);


if($iid == $id)
{

 $display_block .=CENTERimg src=$image border=0brfont size =
 2$inameBR$quantityBR$typeBR/font/CENTER;

 echo $display_blockBRBR;

   if($type == food)
   //if the item food is present then set an option and include in
 the form later
   {
$thisoption=OPTION VALUE=\feed\Feed my pet\n/OPTION;
   }
  else
 {
 //if book or weapon is present then set a blank
 $thisoption=;
}
   }
 }
 }
 }
 //check if form has been submitted
 if($submit)
 {

 }
 else
 {

 //if the form has not been submitted run the following


echo FORM ACTION='$PHP_SELF' METHOD='post';
echo SELECT NAME='sort' SIZE='1' ;
echo $thisoption;
echo OPTION VALUE='shop'Put in my shop/OPTION;
echo OPTION VALUE='locker'Put into my Footlocker/OPTION;
echo OPTION VALUE='discard'Discard this item/OPTION;
echo OPTION VALUE='donate'Donate this item/OPTION;
echo /SELECT;
echo INPUT TYPE='submit' VALUE='Submit' NAME='submit';
echo /FORM;


 }

 Jennifer



 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If else question

2002-04-23 Thread Jennifer Downey

I have it. I actually got it!

I had the if statement in the wrong place.

Here is what I did:

if($quantity 1)
{
 echo Sorry I can't seem to locate this item;
}
else
{
//check if form has been submitted
if($submit)
{
}
else
{

//if the form has not been submitted run the following


   echo FORM ACTION='sortitems.php'METHOD='post';
   echo SELECT NAME='sort' SIZE='1' ;
   echo $thisoption;
   echo OPTION VALUE='shop'Put in my shop/OPTION;
   echo OPTION VALUE='locker'Put into my Footlocker/OPTION;
   echo OPTION VALUE='discard'Discard this item/OPTION;
   echo OPTION VALUE='donate'Donate this item/OPTION;
   echo /SELECT;
   echo INPUT TYPE='submit' VALUE='Submit' NAME='submit';
   echo /FORM;
}
}
}

and it worked perfectly!

Thank you ALL for your time and help!
Jennifer

P.S. You people are wonderfull!




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] SQL Warning

2002-04-23 Thread Jennifer Downey

Hi all,

Would you please direct your attention to this URL

http://testphp.netfirms.com/code1.html

Look at the bottom where the big orange commented syntax is and explain what
is going on there?


Thanks
Jennifer
--
The sleeper has awaken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Redirect

2002-04-25 Thread Jennifer Downey

Hi to all,

I am wondering if there are other ways to redirect users other than using
header()?

I have a script that if the user doesn't have enough money to buy an item
then it directs to one page and if they do then it directs them back to the
referring page.

Is this possible?


Thanks
Jennifer

--
The sleeper has awaken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mail() through a form

2002-04-26 Thread Jennifer Downey

Hello to all,

I have a mail script with a set of options in a dropdown list that I'm
hoping you can help with.
Here is the part I wish to get working then after that I can do the rest

What I need this to do is send the users name, email address, the option in
the drop down list, and the message. I can't seem to get it to do this could
someone point out what I have done wrong?

$query = SELECT * FROM {$config[prefix]}_users WHERE uid =
{$session[uid]};
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$name = $row['name'];
$email = $row['email'];
if($submit)
{
if($automail == 'abuse')
{
$From = $name;
$to = [EMAIL PROTECTED];
mail( $to, $From, $email, $message );
}
else
{
else
{
echoFORM ACTION='$PHP_SELF' METHOD='POST' TITLE='contact';

echo brbrbrbrbrYour User Name: $name;
echo brbrYour Email Address: $emailbrDid your emailbrchange? a
href='myaccount.php'Click hereBRBR/a;

echo This is a ;
echo SELECT NAME='automail' SIZE='1';
echo OPTION VALUE='abuse'Abuse/OPTION;
echo OPTION VALUE='bug'Bug/OPTION;
echo OPTION VALUE='job'Employment/OPTION;
echo /SELECT ReportBR;

echo The message isBR;
echo TEXTAREA NAME='message'  ROWS='10' COLS='40';
echo /TEXTAREA;
echo BRINPUT TYPE='submit' VALUE='Send Report' NAME='submit';

echo /FORM;
}

Thanks
Jennifer

--
The sleeper has awaken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Columns not displaying as they should

2002-05-01 Thread Jennifer Downey

Hi to everyone,

I am having trouble with this snip and wonder if you might help?

This is suppose to display the items 5 accross the browser instead it
displays them down like this:

item 1
item 2
item 3

I want them displayed like this:

item1 item 2 item 3

but for some odd reason it wont any ideas why?

if ($main == shop)
{
$get_shop_data = mysql_fetch_array(mysql_query(SELECT * FROM wt_items WHERE
id = '$shopid'));
$get_items = mysql_query(SELECT * FROM wt_instock WHERE shop = '$shopid'
AND howmany  '0');
while ($items_result = mysql_fetch_array($get_items))
{
$item_info = mysql_fetch_array(mysql_query(SELECT * FROM wt_items WHERE id
= '$items_result[item]'));
$column++;

$display_block =a
href=$php_self?main=buyitemitemid=$items_result[id]img
src=images/items/$item_info[image] height=75 width=75BRB
$item_info[name]/B/aBR $items_result[howmany] in stockBRCost:
$items_result[price]BR
;
echo table cellSpacing=0 cellPadding=0 width=\100%\ border=0trtd
width = \100\$display_block/td;

 if ($column  5)
 {
  echo /trtr;
  $column = 1;
 }
   echo/table;
}
}

Thanks for your time and help
Jennifer
--
The sleeper has awaken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] strtotime failure

2002-05-07 Thread Koenig, Jennifer

Hallo,

Why would strtotime fail (i.e. return a -1)?  I check the type with gettype,
which tells me that the argument I'm passing in is a string.  I cast it to a
string before passing it in, with the same results (returns a -1).  The only
thing that seems to do anything is to settype it to string before calling
strtotime, which ends up with bizarre results.

The arguments I'm passing in are, for example 11:00, 13:00, 14:30, etc, and
are coming out of a database.  Only SOME of this data results in a -1 when I
call strtotime on it.  Other records (the same numbers - 11:00, 13:00, etc.)
come out fine.

Could the data that's failing strtotime have been corrupted on data-entry?
Why does is_string on this data tell me it's a string?

--Jennifer Koenig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] strtotime failure -- nevermind!! :)

2002-05-07 Thread Koenig, Jennifer

It was staring me right in the face - the data that wasn't working was typed
(by Europeans) as 6.30 instead of 6:30.  So it was a string whose format was
unacceptable as a Unix timestamp format.

--Jennifer Koenig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] fopen failing to connect

2002-05-15 Thread jennifer jefferson

thanks for looking. my guess is that it could be a
server configuration issue. i am really not sure. the
actual script works just not on the server i need
it to work on. maybe it has something to do with the
.ini file or the installation. i am not very familiar
with that. does this sound likely as a problem?
thanks.

-jennifer

--- Kevin Stone [EMAIL PROTECTED] wrote:
 Jennifer, works just fine here..
 
 -
 $fp =

fopen(http://www.thedeal.com/NASApp/cs/ContentServer?pagename=TheDeal/xmlfe
 ed,r);
 if ($fp !== FALSE)
  echo The file exists!;
 else
 echo The file does not exist;
 -
 
 This prints The file exists! so it may be
 something else in your code
 cuasing the problem.  And when I read the file it
 displays a bunch of
 numbers.  Don't know what you could be doing wrong
 but if you continue to
 experiece problems post some more of your code and
 maybe we can decipher the
 error from that.
 
 -Kevin

__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MySql injections (related question)

2005-05-12 Thread Jennifer Goodie
 -- Original message --
From: Richard Lynch [EMAIL PROTECTED]
 On Thu, May 12, 2005 4:43 pm, Chris Shiflett said:
   From me:
  The fact that it uses the character set of your current connection to
  MySQL means that what your escaping function considers to be a single
  quote is exactly what your database considers to be a single quote. If
  these things don't match, your escaping function can miss something that
  your database interprets, opening you up to an SQL injection attack.
 
 Under the following pre-conditions:
 1. C Locale / English in MySQL data
 2. No intention to ever switch natural language, nor database.
 
 is there any real benefit to spending man hours I really can't afford for
 legacy code to switch from Magic Quotes to mysql_real_escape_string -- and
 make no mistake, it would be a TON of man hours.

I believe it also takes into account special characters like _ and %, which 
addslashes does not.  In certain instances if you do not escape special 
characters, such as the wildcards I mentioned, the results that you get can 
differ from what you intended.  One instance this comes into play is a search 
form used by a non-technical user.  You should probably check that though, it 
has been a while since I have looked into it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Avoiding NOTICEs on Array References

2005-01-26 Thread Jennifer Goodie
 -- Original message --
From: Tom Rawson [EMAIL PROTECTED]
 I have many places where I use references like this:
 
   if ($fields['flags']['someflag']) ...
 
 or perhaps
 
   if ($_POST['checkboxfieldname']) ...
 
 If there is no value for 'someflag', or if the check box was not 
 checked -- both of which are often the case -- these generate errors at 
 level E_NOTICE.  Is there any way to prevent references to missing 
 array elements from generating errors without turning off all E_NOTICE 
 notifications?

if (isset($fields['flags']['someflag'])  $fields['flags']['someflag'])
if (isset($_POST['checkboxfieldname'])   $_POST['checkboxfieldname']) 

The  short-circuits, so the second part of the conditional only gets 
evaluated if the first part is true.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Parsing search strings from referer urls?

2005-01-26 Thread Jennifer Goodie

 -- Original message --
From: Jason Barnett [EMAIL PROTECTED]
 T.J. Mahaffey wrote:
  First time post, please be gentle.
 
 You will probably find parse_url() to be useful:
 http://www.php.net/manual/en/function.parse-url.php
 
 ?php
 
 $url = 
 http://username:[EMAIL 
 PROTECTED]/path?arg=valuearg2=valuearg3=value3#anchor
 ;
 
 $parts = parse_url($url);
 $args = explode('', $parts['query']);
 
 for($i = 0; $i  sizeof($args); $i++) {
list($key, $value) = explode('=', $args[$i]);
$query[$key] = urldecode($value);
 }
 
 print_r($query);
 
 ?
parse_str will take care of turning the query string into key/value pairs
http://us2.php.net/manual/en/function.parse-str.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Secure system calls -- how

2005-02-08 Thread Jennifer Goodie
 -- Original message --
From: Niels [EMAIL PROTECTED]
 Hi list,
 
 I'm doing an intranet website for managing users. I need to be able to
 change passwords, move files and folders around and that kind of thing.
 What is the best way?
 

I wouldn't use system calls to move files around.  PHP has built in file system 
functions.  Why shell out to do something that is built in?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Secure system calls -- how

2005-02-08 Thread Jennifer Goodie
 -- Original message --
From: Niels [EMAIL PROTECTED]
 Jennifer Goodie wrote:
 
  I wouldn't use system calls to move files around.  PHP has built in file
  system functions.  Why shell out to do something that is built in?
 
 Well, the apache user really shouldn't have access to the entire file system
 -- that's the problem.

Should web applications have access to areas on the file system that the apache 
user doesn't?  I personally only allow my web applications access to certain 
areas on purpose and set my permissions to accomplish this.  If I need to be a 
user other than nobody to do something I don't want my web applications doing 
it.  Of course, I work in an environment where I have root access to dedicated 
servers and a sysadmin that listens to what I want, so your experience may be 
different.  I admittedly do not have a lot of experience getting around the 
problems caused by shared hosting.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP and MySQL bug

2003-01-06 Thread Jennifer Goodie
It would be helpful if you posted that error.  You can get it by changing
the die to

$queryr = mysql_query($query) or die(mysql_error());

Without knowing the error, you problem will be harder for everyone to debug.


-Original Message-
From: Nuno Lopes [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 10:09 AM
To: MySQL List; [EMAIL PROTECTED]
Subject: Re: PHP and MySQL bug

The problem is if I close the connection and reopen it the query is done,
but if I remain with the same connection has the previous query, mysql
returns an error.


- Original Message -
From: Larry Brown [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Sunday, January 05, 2003 4:16 PM
Subject: Re:PHP and MySQL bug


 Try replacing the following line...

 @MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't
 work

 With...

 $query = UPDATE d SET h='$h' WERE id='$id';
 $queryr = mysql_query($query) or die(The sql statement does not
execute);

 if(mysql_affected_rows() !== 1)
 {
die(The sql statement is successfully run however either h did not
 change or there is an internal error.  Try executing the sql from the
 command line to make sure it otherwise works.);
 }

 and see which is coming back.


 Larry S. Brown
 Dimension Networks, Inc.
 (727) 723-8388




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] MySQL/PHP problem.

2003-07-22 Thread Jennifer Goodie
Off the top of my head, try using OR in your query rather than AND

 day=\2\ or day=\3\

day probably won't equal both 2 and 3, which is why you are getting 0.
Also, if you group by item name, you are going to get the total for each
itemname, is that what you want, or just the overall total?

 -Original Message-
 From: Phillip Blancher [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 22, 2003 2:09 PM
 To: PHP List
 Subject: [PHP] MySQL/PHP problem.


 I am trying to count in mySQL the number of entries in the field
 day where day=2 or 3.

 Then I want to check just to see if that returned a value greater
 than 0 or not.

 I am using the code below, but having a problem, I keep getting 0
 as the total

 What am i doing wrong.


$dbqueryshipping1 = select *, COUNT(day) from
 tempuserpurchase where day=\2\ and day=\3\ GROUP BY itemname;
 $resultshipping1 =
 mysql_db_query($dbname,$dbqueryshipping1);
 if(mysql_error()!=){echo mysql_error();}
$shipping1 = mysql_fetch_array($resultshipping1);



 Thanks in advance,

 Phil



 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.501 / Virus Database: 299 - Release Date: 7/14/2003



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] newbY prob

2003-07-23 Thread Jennifer Goodie

 ! am trying to count the number of items in this table. The table
 has one field in it.

 The code I am using is:

 $dbquerymeal = select COUNT(*) from mealtype;
 $resultmeal = mysql_db_query($dbname,$dbqueryshipping1);
 if(mysql_error()!=){echo mysql_error();}
 $mealcount = mysql_fetch_row($resultmeal);
 echo $mealcount;

 The result I am getting is:

 Query was empty
 Warning: mysql_fetch_row(): supplied argument is not a valid
 MySQL result resource in search.php

 Any suggestions?

Where is  $dbqueryshipping1 set?  I see $bdquerymeal, but not
$dbqueryshipping1.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Include Problems

2003-07-24 Thread Jennifer Goodie
Without seeing what you have in your includes, it will be hard to determine
where your scope is messed up.

 ?php
  $subnav = home;
  include(incHeader.php);
 ?

 !--- CONTENT AREA ---

 The content would go here.

 !--- END CONTENT AREA ---

 ?php include (incFooter.php); ?

 Now, when I try to reference the subnav variable in the inHeader.php or
 incFooter.php files, it comes up blank.  I am basically trying to
 adjust the
 navigation on each page depending on the page I am on.  I am just learning
 PHP, have programmed in ColdFusion for years and in ColdFusion
 this was not
 a problem.  Any ideas?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] File upload?

2003-07-24 Thread Jennifer Goodie
 $uploaddir = 'C:\Inetpub\wwwroot\pix';
 $filnamn=$_FILES['userfile']['name'];

 I thought of just adding a backslash at the very end of the $uploaddir
 variable but that just leaves me with this error-message instead:

 Parse error: parse error, unexpected T_STRING in
 c:\inetpub\wwwroot\alterdb\upload2.php on line 25

 Line 25 happens to be that $filnamn line you can see above.

 I'm at a loss as to what could be the problem so any suggestions
 to where to
 look?


Since a ' comes right after the \ it is escaping it.  Instead escape the \
so it is interpreted as \ and not the escape character.
$uploaddir = 'C:\Inetpub\wwwroot\pix\\';


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Bizarre SQl, if issue....

2003-07-29 Thread Jennifer Goodie
 Actually, what you see is *exactly* the code being used. Nothing
 has changed
 about it.  And whether the variable is regarded as a string or a
 number, it
 gives me the same stupid issue.  Not recognizing it as a True
 statement. :\

 Is there any way possible that this could be the client's server?
  I had to
 beg to get 'em to recompile to 4.1.2 from 4.0.3.  There are using
 a version
 of Linux I don't recognize (it isn't redhat or mandrake), but it
 looks like
 their kernel is up to date.

 On my redhat server (with php 4.3.3), the same code responds
 properly (i.e.
 that $vthere ==0 is true).


Database set up is the same on both servers?  If they are using the same
remote database server, do both webservers have perms to select from the
database and table you are trying to use?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Weird Problem

2003-07-29 Thread Jennifer Goodie
 I have the following chunk of code:

   $sql = SELECT setting from settings where name='display_rows';
   include(connect.inc.php);
   print $sql;
   $row = mysql_fetch_row($result);
   $path = $row[0];
   print $path;

 It always prints out 1

 But if I run the code at the sql command prompt, it prints out 25,
 which is the correct value.

 Does anyone have any ideas why im having this problem??


Are you actually executing the query?  I don't see a mysql_query() anywhere
and it would be anti-intuituve to have that in your connection include.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Weird Problem

2003-07-29 Thread Jennifer Goodie
 The only setting contained in that table is the one im calling for,
 and its value is 25.


see what print_r($row) outputs, then you'll at least know what is in the
array.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] MySQL query/PHP logic?

2003-07-29 Thread Jennifer Goodie
 select * from main
   left join fof on main.id = fof.id
   left join pub on main.id = pub.id
   left join gov on main.id = gov.id
   left join med on main.id = med.id
   left join ngo on main.id = ngo.id
   left join own on main.id = own.id
   left join sup on main.id = sup.id
[snip]
 BUT, although it seems to be joining the tables correctly AND only
 returning the ones with the correct date criteria, it does NOT return
 the id or the information_sent fields correctly ( due to duplication
 in the result )

 Can this be done in one query without sub-selects, or should it
 be broken up
 (in which case I would still need help with the logic and to minimize the
 amount of queries inside loops)


Instead of select * list out the fields you want to select and alias the
duplicates, for example

select fof.id as fof_id, pub.id as pub_id, gov.id as gov_id etc.

Then when you do you mysql_fetch_array the indexes will be the aliases you
gave the columns so nothing will get overwritten.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Using link to submit a form

2003-07-30 Thread Jennifer Goodie
 Hi everyone,
 
 Can I replace Submit buttons on forms with a text button?
 I need to be able to click on a link:
 a href=index.php?option=editEdit/a
 
 and have it submit the form.  The form only contains one 
 field...does anyone
 know how to do this?  I've been searching google for an answer, 
 but couldn't
 find any info that really applies to my question.  


This was answered yesterday.

http://marc.theaimsgroup.com/?t=10516067212r=1w=2

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Escaping nasty quotes

2003-07-31 Thread Jennifer Goodie
 I have this:

 $query = LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE
 mytable FIELDS
 TERMINATED BY ',' ENCLOSED BY ' . '' . ' ;
 $result = MYSQL_QUERY($query);
 PRINT br$query2br;

 The query doesn't take ... but if I cut and paste the printed
 response into
 the mysql server manually ... works like a charm

What error do you get from mysql_error()?  Are you uusing the same user in
both shell and script?  If not does the script user have the proper
permissions?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: include help please

2003-07-31 Thread Jennifer Goodie
 if (isset($page)) {
 include $$_GET['page'];
 } else {
 $page = $home;
 include $page;
 }

 would that be right?
 or should i use

 if (isset($page)) {
 include $$_GET['page'];
 } else {
 include $home;
 }

 hopefully that's right.  if so, pretty good for a n00b


I don't think I'd let someone pass any page they wanted via a get and just
include that page.

If you have URL fopen wrappers on I can create a page on my server and
include it to your page and pretty much execute any code I want on your
server.

example:

http://www.yourdomain.com?yourscript.php?page=http://mydomain.com/myscript.p
hp

Now my code is included in your page and executed.  Do you really trust me
to only have nice code in my page?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] is there a way?

2003-07-31 Thread Jennifer Goodie
 Is there a way to have your html table represent one color,
 Cause when I click the link it turnes purple, and I want it to stay
 336699
 no matter what state.

 I tried to use css, but it does the whole page.
 And I want the 336699 to be in this table alone.

 Can anyone help me out with this small problem?

Create a class specifically for that table and it's links.

for example

.yourtable {font-family: Verdana, Arial, Helvetica, sans-serif;font-size:
8pt; color: #ff;}
A.yourtable:link { text-decoration: underline; font-weight: normal; color:
#336699;}
A.yourtable:visited { text-decoration: underline; font-weight: normal;
color: #336699;}
A.yourtable:hover { text-decoration: underline; font-weight: normal; color:
#336699;}
A.yourtable:active { text-decoration: underline; font-weight: normal; color:
#336699;}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Is there an easier way?

2003-07-31 Thread Jennifer Goodie
 if(!($rs = mysql_query($q))) // querying
   { echo Query failed. mysql_error(); exit; }
 
 
$n = 0;
   while ($line = mysql_fetch_assoc($rs)) { //dumping into an array
 foreach ($line as $field = $value) {
   $data[$field][$n] = $value;
 }
 $n++;
   }
 
 and this is how i use the arrays values (blah is the field name):
 $blah1=$data['blah'][0];
 $blah2=$data['blah'][1];
 $blah3=$data['blah'][2];

This should work.  Try it and see.
$n = 0;
   while ($line = mysql_fetch_assoc($rs)) { //dumping into an array
 foreach ($line as $field = $value) {
$tmp = $field.$n;
$$tmp = $value;
}
 $n++;
   }

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Regular Expression

2003-08-04 Thread Jennifer Goodie
 Been working on this one for a while but can't get it working properly.
 I need a regular expression to match if address is

 1. PO Box
 2. P.O. Box
 3. P.O.Box

 I got it working with 1  2, but it's still not matching 3. Any
 suggestions?

 if(preg_match( /p[\.]o\.* +box/i, trim($_POST['address'])){
echo Address is P.O. BOX;
 }

You are using a + as the modifier on the space between p.o. and box.  +
means 1 or more.  Option 3 does not have a space.  Try using * which is 0 or
more, or ? which is 0 or 1.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Values from forms

2003-08-04 Thread Jennifer Goodie
 --- Beauford.2005 [EMAIL PROTECTED] wrote:
  FORM ACTION=teams-write.php action=post name=inputs

 You misspelled method. :-)

 Hope that helps.

 Chris

It seems like this exact same problem has been addressed before.
http://marc.theaimsgroup.com/?l=php-generalm=105900603231518w=2
http://marc.theaimsgroup.com/?l=php-generalm=105906453817129w=2

Having the action attribute in there twice will mess stuff up.  You might
want to check all of your forms since this seems to be a re-occurring
problem, it'll probably save you some time and frustration.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] setting function variables

2003-08-07 Thread Jennifer Goodie
 I am trying to specify a single php file to contain all the
 variables and I
 just call this file where necessary.  What I am running into is
 that I want
 to do this for all the built in functions (i.e. mssql_query) as
 well.  I've
 tried numerous attempts but can't get it to operate without wanting to run
 the functions or return an error.  Something like this:

 $runQuery = @mssql_query;
 $qryResults = @mssql_result;
 $getRow = @mssql_fetch_row;
 $getRowNums = @mssql_num_rows;

 I've tried using the %, $, ,'', and the @ symbol without any
 luck.  Anyone
 know of way to do this, so I can use a generic name for all the functions
 and be able to distribute it to those using either SQL Server or MySQL
 without them having to go through the code and manually change it?

 thanks

Have you looked into variable functions?
http://www.php.net/manual/en/functions.variable-functions.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] AOL Email client

2003-08-07 Thread Jennifer Goodie
 I am using php mail and setting all my $headers info to show From:, To:,

What does your call to mail() look like?  How are you formatting you
headers?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] AOL Email client

2003-08-07 Thread Jennifer Goodie
 Here is what my header look like:

   $headers .= MIME-Version: 1.0\r\n;
   $headers .= Content-type:  text/plain;
 charset=us-ascii\r\n;
   $headers .= From: .$name. .$email.\r\n;
   $headers .= To: .$myname. .$toAddress.\r\n;
   $headers .= Reply-To: .$name. .$email.\r\n;
   $headers .= X-Priority: 1\r\n;
   $headers .= X-MSMail-Priority: High\r\n;
   $headers .= X-Mailer: Just My Server;


It appears to work fine in AOL 6.0 when I send from unix box using PHP 4.2.3
and sendmail, what version of AOL are you having problems with, what server
platform and PHP version are you using to send?  If you are using the php
mail function you must be passing To as the first parameter since it is not
optional, so why are putting it in your headers as well?  If I remember
correctly, RFC2822 states there should only be 1 to header.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Stop neurotic posting

2003-08-08 Thread Jennifer Goodie
Not to beat a dead horse, but...

From two separate responses:

 And as for Google, I don't feel like I have time to wade through pages and
 pages of irrelevant links until I find what I'm looking for when I have a
 better resource right here.



 I've actually learned quite a few useful things from questions in
 the past
 couple of weeks since I joined this list that have obviously reappeared
 several times. Now, I could spend hours trawling the archives to see if
 there's anything of interest, but I don't really have the time -
 and in any
 event they're often things I wouldn't have thought about looking
 up anyway.


I love how the argument for not doing research is not having the time/not
wanting to waste time.  That is just lazy and selfish.  Since you don't want
to waste your time looking, it is perfectly acceptable for everyone else to
waste time reading a question that's been posted 80 times in the last month,
and possibly waste more time typing up the same answer that has probably
been posted 80+ times.  How is your time more important or valuable than
everyone else's?

This is not a personal attack on the two posters quoted, just my feelings on
that general attitude.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] strtotime()

2003-08-14 Thread Jennifer Goodie
   strtotime( '+1 month', mktime( 0, 0, 0, 1, 1, 2003 ));
   I get back the timestamp for 1/31/2003 and not 2/1/2003.
  Are you sure?

 Yeah, but I missed something in my above example.  If I did this:

 strtotime( '+1 month GMT', mktime( 0, 0, 0, 1, 1, 2003 ));

 It came back with 1/31/2003 and not 2/1/2003.  Removing the GMT
 made it work.

Are you somewhere behind GMT?  I get an hour shift when using GMT that puts
me in the previous day.  I'm GMT -8.  I can't think right now, but for some
reason it seems like it's shifting in the wrong direction or at least the
opposite of what I'd expect.  I guess it is subtracting my 8 hours and then
shifting, making it 16:00 of the previous day.  It seems like it should add
8 hours since GMT is 8 ahead of me.  This is making my head hurt, maybe
someone else can make it make sense.

# php
?php
$ts = mktime( 0, 0, 0, 1, 1, 2003 );
echo date (Y-m-d H:i:s,$ts).\n;
$ts2 = strtotime('+1 month GMT', $ts);
echo date (Y-m-d H:i:s,$ts2).\n;
$ts3 = strtotime('+1 month', $ts);
echo date (Y-m-d H:i:s,$ts3).\n;
?
X-Powered-By: PHP/4.2.3
Content-type: text/html

2003-01-01 00:00:00
2003-01-31 16:00:00
2003-02-01 00:00:00


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] bug in code - can't find it!

2003-08-14 Thread Jennifer Goodie

 Ok, here is my query and the bit of code I can't figure out:

 $query = SELECT * from apt_user_t a, apt_company_t b ;
 $query .= WHERE a.user_cd = b.user_cd ;
 $query .= ORDER BY a.username;

  $search_results = mysql_query($query) or die(Select
 Failed!);
 while ($search_result2 = mysql_fetch_array($search_results))
 {
 INPUT
 TYPE=checkbox
 NAME=? echo $search_result2['user_cd'];?
 SIZE=20
 MAXLENGTH=50
 VALUE=?if ($search_result2[a.retired_flag] ==
 1){?CHECKED?}? ?echo $search_result2[a.retired_flag]?
 }
 Nothing shows up with the echo or the value.  I only included this
 checkbox, but all of the other values show up fine.  Can someone give me a
 hint?

Mysql does not prefix returned columns with table_name., so there's probably
no a.retired_flag index in your array.  A simple way to check this would
be to print_r($search_result2).  If you have a column named retired_flag in
both table a and table b and you specifically want the one from table a in
your result set you are going to have to alias it to a different name in
your query, i.e. SELECT *, a.retired_flag as r_flag



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] setting function variables

2003-08-14 Thread Jennifer Goodie
 Tried this and it returns errors of type:
 
 Warning: Wrong parameter count for mssql_result() in
 c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php 
 on line 78
 
 Warning: mssql_result(): supplied argument is not a valid MS SQL-result
 resource in
 c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php 
 on line 79
 
 Lines 78 and 79 read like this:
 
 $img_numbers = $qryResults(SELECT COUNT(img_id) AS TotalImages 
 FROM images
 WHERE category_id = '$row[0]');
 $img_count = $qryResults($img_numbers,0,TotalImages)
 
 The variables are specified as
 
 $runQuery = 'mssql_query';
 $qryResults = 'mssql_result';
 

You are using mssql_result instead of mssql_query on line 78. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] strtotime()

2003-08-14 Thread Jennifer Goodie
 strtotime( '+1 month', mktime( 0, 0, 0, 1, 1, 2003 ));

 I get back the timestamp for 1/31/2003 and not 2/1/2003.

Are you sure?

I tried it on my system (php 4.2.3 freeBSD 4.6.2) and this is the output I
got...
# php
?php
echo date(Y-m-d, mktime( 0, 0, 0, 1, 1, 2003 )).\n;
echo date(Y-m-d,strtotime( '+1 month', mktime( 0, 0, 0, 1, 1,
2003 ))).\n;
?
X-Powered-By: PHP/4.2.3
Content-type: text/html

2003-01-01
2003-02-01

What are you doing with the timestamp strtotime gives you?  Could that be
where the error is?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Jennifer Goodie

 // the query

 $verify = select ft.topic_id, ft.topic_title from forum_posts as fp left
 join forum_topics as ft on fp.topic_id = ft.topic_id where fp.post_id =
 $_GET[post_id];
 ...

 My question: why - or how can - the columns ft.topic_id and ft.topic_title
 come from the table forum_posts?

 In the original schema, there is no column called topic_title in the table
 called forum_posts.

They don't.  ft is aliased to forum_topics.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Commands out of sync; You can't run this command now

2003-08-14 Thread Jennifer Goodie
 Hi

 For a few days or maybe even a week or two I'm getting this error
 message in my site.
 This happens when i do : mysql_select_db()

 This doesn't happen all the time and there are pages that it happens
 more than others
 so it seems.

 I looked in the manual and the explanation there doesn't apply to me.
 Any ideas?

 http://mickey.lcsc.edu/manual.html#Commands_out_of_sync

 Sincerely

 berber

1.) This has been asked on the mysql list and the this list a lot of times,
search the archives
http://marc.theaimsgroup.com/?l=mysqlw=2r=1s=commands+out+of+syncq=b or
http://marc.theaimsgroup.com/?l=php-generalw=2r=1s=commands+out+of+syncq
=b .  From a brief search it appears it is a known bug in PHP 4.2.3, what
version of PHP are you running?

2.) Are you using mysql 3.22.14-gamma?  If not check the current manual at
http://www.mysql.com as I'd imagine a lot has changed since the 3.22.14
gamma manula you are refrencing.  If you are using 3.22 you should upgrade
to at least 3.23.55 as there have been huge security patches and I don't
think the 3.22 tree is still supported.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] discussion forum from j. meloni's book

2003-08-14 Thread Jennifer Goodie
 Anyway, in the textbook and the zip her mySQL query reads:
 ...
 $verify = select ft.topic_id, ft.topic_title from forum_posts as fp left
 join forum_topics as ft on fp.topic_id = ft.topic_id where fp.post_id =
 $_GET[post_id];
 .

 The part that I'm confused about is:
 ...
 select ft.topic_id, ft.topic_title from forum_posts
 

 It seem that the alias of ft refers to forum_title - not forum_posts.

ft refers to forum_topics forum_topics as ft 


 In fact, I switched the query to read as follows:
 
 $verify = select ft.topic_id, ft.topic_title from forum_topics as ft left
 join forum_posts as fp on fp.topic_id = ft.topic_id where fp.post_id =
 $_GET[post_id];
 ..

 And that seems to run fine.

 Any explanations will be appreciated.

You didn't switch the aliases around, you just switched the join order.
This will provide unexpected results.  In order to understand it, you should
read up on left joins.
http://www.mysql.com/doc/en/JOIN.html



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Question on class syntax

2003-08-14 Thread Jennifer Goodie
 I am currently using a php class that uses the following syntax:

 $value= htmlcleaner::cleanup($value);


 What exactly is the :: used for? Is there a different syntax for :: ?

The manual has an entire section on this
(http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php) have you
read it and are still unclear and looking for further input?  Or have you
not read it yet?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Bug in Ereg?

2003-08-15 Thread Jennifer Goodie
 What is posted [ from phpinfo() ]:

 _POST[color-1]  on
 _POST[color-4]  on
 _POST[color-6]  on


 Parser:
 foreach($_POST as $ThisVar=$ThisVal){
 if(ereg(color-, $ThisVar) AND $ThisVal==on OR $ThisVal==1){
 $newVarA=explode(-, $ThisVar);
 $colors.=$newVarA[1]:;
 }
 }

 Expected Output:

 $colors=1:4:6:;

 Real Output:

 $colors=:1:4:6:;

Do you have anything else in _POST that's equal to 1?  I didn't look up
order of operation, so I may be off here, but your if condition might not be
doing what you are expecting.  Try using parentheses to group it like this
if(ereg(color-, $ThisVar) AND ($ThisVal==on OR $ThisVal==1)){  (I'm
guessing that's what you want).  Why are you using ereg anyway?  You're not
using a regular expression so strstr would work just as well and be slightly
faster.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with date('w')

2003-08-26 Thread Jennifer Goodie
 I have a problem with the date function

 ?
  $theday = date(Y-m-d, time());
   echo date((w), $theday);
 ?

I'm pretty sure the optional second argument for date is a unix timestamp
that you would generate by using either time or mktime or strtotime.  You
are passing it something in the form of Y-m-d, or 2003-08-23 when it is
expecting 1061852640.
http://www.php.net/manual/en/function.date.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Impossible error

2003-08-26 Thread Jennifer Goodie
 I have a 163 line file.  I get a parse error on line 164.  Ideas?
 

You're probably missing a } somewhere.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Get the lowest value out of different fields

2003-09-03 Thread Jennifer Goodie
 Hi All,

 I hope you can help me with this:

 I have a tabel in my database like this

 TEST

 fieldnameValue's

 testid  1
 testf1   3
 testf2   4
 testf3   0
 testf4   2
 testf5   0

 (so this is one record!)

 I want to display the lowest value, except 0.. So the SQL
 statement will be SELECT testf1, testf2, testf3, testf4, testf5
 FROM test where testid='1' .

 I can't figure out if i can do this into a SQL statement or put
 it in an Array and sort it..

 Please help!


If you really want to do this in an SQL statement and you're using mySQL you
can nest IFs, but it's really ugly.  For example...

SELECT IF(IF(IF(IF(testf1 testf2 || testf2 = 0, testf1,testf2)  testf3 ||
testf3 = 0,IF(testf1 testf2, testf1,testf2), testf3)  testf4 || testf4 =
0, IF(IF(testf1 testf2 || testf2 = 0, testf1,testf2)  testf3 || testf3 =
0,IF(testf1 testf2, testf1,testf2), testf3), testf4)  testf5 || testf5 =
0,IF(IF(IF(testf1 testf2 || testf2 = 0, testf1,testf2)  testf3 || testf3 =
0,IF(testf1 testf2, testf1,testf2), testf3)  testf4 || testf4 = 0,
IF(IF(testf1 testf2 || testf2 = 0, testf1,testf2)  testf3 || testf3 =
0,IF(testf1 testf2, testf1,testf2), testf3), testf4),testf5)  from TEST
where testid =1;

I didn't test that, and I really wouldn't use it.  Maybe there's a prettier
way, check the function refrence for the DB you are using.  I'd just pull
the results into an array and use PHP to figure it out.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Get the lowest value out of different fields

2003-09-03 Thread Jennifer Goodie
 BUT how can i make the function loop through the whole
 result?

 ---
 if (mysql_num_rows($result3)  0)
 {
 $test = mysql_fetch_array($result3);
 echo minnum($test);
 }

 --


Someone will probably come up with something a little cleaner, but quick and
dirty...

 if (mysql_num_rows($result3)  0)
 {
while ($row = mysql_fetch_array($result3)){
$min[] = minnum($test);
}
$overall_min = minnum($min);
 }

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: cookies under php 4.06

2003-09-04 Thread Jennifer Goodie
 setcookie(UserName, $HTTP_POST_VARS['UserName'],
 time()+(60*10), /,
  $HTTP_SERVER_VARS['SERVER_NAME']);
 setcookie(Password, $password, time()+(60*10), /,
  $HTTP_SERVER_VARS['SERVER_NAME']);
 print login - set cookie;


 sorry for kinda answering my own post... but anyway...

 setcookie(UserName, $HTTP_POST_VARS['UserName']);
 setcookie(Password, $password);

 solves my problem, although means i can't have a time limit on my
 cookies i
 guess... but can set a time limit with another cookie...

1.) I would not store the user's password in a cookie.

2.) As far as I know, set_cookie() has worked the same since PHP3, so your
problem is something else, not the PHP version.  Are you sure
$HTTP_SERVER_VARS['SERVER_NAME'] is the same as what's in the location bar
in your browser.  If the server name is set up as www.domain.com but the
user is just at http://domain.com the cookie won't set.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Session stealing, ..

2003-09-12 Thread Jennifer Goodie
  93 # When deserialized we are called and need to check if the
 stored IP address equals the client's
  94 function __wakeup() {
  95 global $Log;
  96 if ($_SERVER['REMOTE_ADDR'] !=
 $this-Night['IP']) {
  97 $Log-Warning('IP Address changed during
 sleep and wakeup, will clear userdata');
  98 $this-Data = Array();
  99 };
 100 }

 Upon sleep it stores the IP and time in the session data, and
 when it smells
 coffee my object wakes up, checks if he's still being used on the
 same host
 and if not the userdata is plainly cleared.


I hope none of your site visitors are on AOL as the IP can change between
page requests for AOL users.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to comment out chunk of html/php mixed code?

2003-09-15 Thread Jennifer Goodie

 ?php /*

 your mixed html and php code here

 */ ?

 that way php will take everything inside the ?php ? tags and
 comment them
 out, regardless of if they are html or php or whatever.

This won't work is your PHP code has comments using /* */ syntax in it
already.  I always just through an if(false){ } around huge portions of
mixed content that I want to comment out.  Unless you have unbalanced curly
braces in the chunk you want to comment out, it should work.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] output to Excel

2003-09-16 Thread Jennifer Goodie
 Is there a way to output PHP to MS Excel format?

Send the headers for the appropriate application type and then format your
output as HTML with Excel's styles.  In order to get a feel for what my
output should be, I just create a sample of what I want in Excel, save as
html and then open the file in a text editor. Once you look at a few it's
pretty easy to understand.

Here's a small example (okay, it is kind of long, but is probably helpful):

?php
Code to execute a query, etc.  my result identifier is $results
header(Content-disposition: filename=$file_title.xls);
header(Content-type: application/vnd.ms-excel);
header(Pragma: no-cache);
header(Expires: 0);
?
html xmlns:o=urn:schemas-microsoft-com:office:office
xmlns:x=urn:schemas-microsoft-com:office:excel
xmlns=http://www.w3.org/TR/REC-html40;

head
meta http-equiv=Content-Type content=text/html; charset=windows-1252
meta name=ProgId content=Excel.Sheet

!-- STYLES --
style id=Book1_29054_Styles
!-- //this is all swiped from excel, but I removed most of the content
//--
!--table
{mso-displayed-decimal-separator:\.;
mso-displayed-thousand-separator:\,;}
.general
{BUNCH of STUFF}
.col_header
{BUNCH of STUFF}
.date
 {BUNCH of STUFF}
//--
/style
/head

body
div id=Book1 align=center x:
table x:str border=1 cellpadding=0 cellspacing=0
style='border-collapse:collapse;table-layout:fixed;border-color:#B71E00;'
   tr
td colspan=4 class='col_header' align='center'b?php
echo $title;?/b/td
/tr
tr
td class='col_header'ID/td
td class='col_header'Email/td
td class='col_header'Visits/td
td class='col_header'Date Applied/td
 /tr
?php
while ($row = $db-fetch_array($results)){
foreach($row as $key=$val){
$$key = ($val ==
'')?'nbsp;':htmlentities(stripslashes($val),ENT_QUOTES);
}
printf (tr
td class='general'%d/td
td class='general'%s/td
td class='general'%d/td
td class='date'%s/td
 /tr\n,++$count, $email,$visits,$apply_date);
}
print /table/div/body/html;
?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Control Structure problem

2003-09-16 Thread Jennifer Goodie

 This doesnt work as expected.

 if ( $var === TEST ONE || TEST TWO || TEST THREE) {

 do something;

 }

 It returns true on all strings.  Ive tried using the or operator
 and the == but these fail as well.  Any Ideas?

It behaves exactly as expected.  Try checking the manual section on control
structures, I believe it explains that the syntax you are using is invalid.

What you are saying is if ( $var === (TEST ONE || TEST TWO || TEST
THREE)) {
(TEST ONE || TEST TWO || TEST THREE) is always going to evaluate as
true.  I think what you want is
if ( $var === TEST ONE || $var ===  TEST TWO ||  $var === TEST THREE)
{

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to use file() function with an HTTPS:\\www.example.com

2003-09-17 Thread Jennifer Goodie
 How to use file() function with an HTTPS:\\www.example.com

 ?php

  $lines = file ('https://www.example.com/');

  foreach ($lines as $line_num = $line) {
 echo Line #b{$line_num}/b :  . htmlspecialchars($line)
 . br\n;
  }

My interpretation of the manual page
(http://us3.php.net/manual/en/function.file.php) is as follows:
1.) you need fopen_wrappers enabled
2.) https is only available in versions = 4.3.0

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Need Help With gethostbyname()

2003-09-17 Thread Jennifer Goodie
  I have a section of my script where I call gethostbyname($hostname) .
  For some host names that are not registered (according to register.com)
  I am still getting an IP address returned?
 
  What is happening?

 Well, try only the toplevel domain... For example, I have like
 hns345667dsvdtrt34.telia.com, I doubt that is registred, but
 telia.com sure
 is... I hope.. :S

telia.com is a second level, not a top level, .com is the top level in your
example.  Also, only looking up the second level is a bad idea.  In many
cases the third level is actually being used to signify something (the
host).  All of the hosts in our server farm use the same second level, but
the third level signifies which box I'm talking about.  If I do an nslookup
on my second level I'm going to get the IP bound to the webserver that hosts
the corporate site (because that's how we have it set up), but if I do an
nslookup on servername.domain.com (servername being the name of one of the
servers in our farm) I'm going to get the IP for the host designated by
servername.  For example, ftb.ca.gov (California franchise tax board) is not
the same as dot.ca.gov (California Dept. of Transportation) which is not the
same as cdfa.ca.gov (department of food and agriculture), but they all fall
under the ca.gov second level because they are all government offices for
the state of California, which falls under the .gov top level because it is
a government branch within the United States.

To answer the original question, verisign has decided it is a good idea to
wildcard the .com and .net TLDs to point to http://sitefinder.verisign.com,
so if you do a look up on a non-existant domain in those TDLs it will now
give an IP.  I believe a BIND patch has already been released to negate this
change.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Excel Files

2003-09-18 Thread Jennifer Goodie
 Hi, is there a way to create excel files with php?

 Thanks.

This was answered yesterday and I'm way too lazy to type out my reply again.

Here is an archive search on the word 'excel'
http://marc.theaimsgroup.com/?l=php-generalw=2r=1s=excelq=b

Here is yesterday's thread
http://marc.theaimsgroup.com/?t=10637468632r=1w=2

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Attention: List Administrator

2003-09-19 Thread Jennifer Goodie
 And I get this:
 
 [snip]
 Violation Information:
 The subject violated the content filtering rule PHP as subject is a
 malacious code - Not Allowed.  No attempt was made to repair.
 [/snip]
 
 How can PHP be a code so powerfull it is not even allowed in the 
 subject? I thought PHP was a drug.
 

Apparently there is a virus written in PHP
http://securityresponse.symantec.com/avcenter/venc/data/php.virdrus.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Need to convert seconds to DD:HH:MM:SS

2003-09-19 Thread Jennifer Goodie
can't seem to figure
 out how to get the number of days integrated in here for $hh that
 are  24.
 to days:hours:minutes:seconds...  This function works for what it
 does, can
 someone embelish it to handle days too?

 function convertToHHMMSS($seconds)
 {
   $hoursPerDay= 24;
   $SecondsPerHour = 3600;
   $SecondsPerMinute   = 60;
   $MinutesPerHour = 60;

   $hh = intval($seconds / $SecondsPerHour);
   $mm = intval($seconds / $SecondsPerMinute) % $MinutesPerHour;
   $ss = $seconds % $SecondsPerMinute;

   return $hh.h:.$mm.m:.$ss.s;
 }

Not quite what you're looking for, but I'm sure you can figure out how to
customize it

function sec2time($sec){
$returnstring =  ;
$days = intval($sec/86400);
$hours = intval ( ($sec/3600) - ($days*24));
$minutes = intval( ($sec - (($days*86400)+ ($hours*3600)))/60);
$seconds = $sec - ( ($days*86400)+($hours*3600)+($minutes * 60));

$returnstring .= ($days)?(($days == 1)? 1 day:$days days):;
$returnstring .= ($days  $hours  !$minutes  !$seconds)? and
: ;
$returnstring .= ($hours)?( ($hours == 1)?1 hour:$hours
hours):;
$returnstring .= (($days || $hours)  ($minutes  !$seconds))?
and : ;
$returnstring .= ($minutes)?( ($minutes == 1)?1 minute:$minutes
minutes):;
$returnstring .= (($days || $hours || $minutes)  $seconds)? and
: ;
$returnstring .= ($seconds)?( ($seconds == 1)?1 second:$seconds
seconds):;
return ($returnstring);
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
 Ive used this
 $query = (SELECT username, password, DATE_FORMAT(timestamp,
 '%d%m%y')  FROM
 custlogon);

 But I recieve unknown index timestamp.  *shrug*


You are receiving the error on an array returned by fetch_array?  If so, it
is because the index is DATE_FORMAT(timestamp, '%d%m%y'), not timestamp,
which isn't so great.  You can see this by doing a print_r on the array to
see what is actually in it.  Use aliasing in your query to give it a better
index.
SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts
FROM custlogon or something like that.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
 Jennifer, you're right, I am using fetch_array...  I tried to use your
 suggestion, and it failing as well, It wont even execute

 Do you have a better method of looping through all these records??


There's probably an error in my SQL syntax.  What is mysql_error() telling
you?  If it was my query and my database I'd probably know what the problem
is just by looking, but it isn't and I don't.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
 try this:

 $query = SELECT username, password,
 DATE_FORMAT(CURRENT_TIMESTAMP(), '%d%m%y') FROM custlogon;

 or if that doesnt work try:

 $query = SELECT username, password, DATE_FORMAT(NOW(), '%d%m%y')
 FROM custlogon;
[snip]
original query as posted:
SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon
[/snip]


Unless timestamp is actually the name of a column in the database, in that
case NOW() and CURRENT_TIMESTAMP() won't give the expected results.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] SQL statement

2003-09-23 Thread Jennifer Goodie
   Jennifer, you're right, I am using fetch_array...  I tried to use your
   suggestion, and it failing as well, It wont even execute
  
 
  There's probably an error in my SQL syntax.  What is
 mysql_error() telling
  you?

 I dont believe it to be an error because Ive run this from the CLI on my
 zeus system.  I have also echoed out the sql statement to read
 exactly what
 I know its got to be problem with the string terminators and or
 the way the
 fetch_array reads the elements of a record in my database.


Why don't you humor me and tell me what the error is and show me the code
that is generating it.  A PHP error message and the output from
mysql_error() will go a long way in debugging a problem.  I can't really
work with it stops working and it fails to execute, those don't tell me
much except that there's probably a problem with the query.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   >