[PHP] Numeric help needed

2012-01-15 Thread Christopher J Payne
Hi everyone,

 

I am having a hard time with a numerical problem.

 

I need to round some numbers up and I've tried $round($number) and it
doesn't work so I'm misunderstanding something.

 

For example, if a user inputs 685000 I need it to round up to 69 or if
they input 149560 I need it to round up to 15.  What is the correct way
to do this as everything I have tried doesn't seem to affect the user
inputted figure at all.

 

Anyway help would REALLY be appreciated, I'm sure it's really simple but for
the life of me I'm stumped on why it's not working.

 

Chris



Re: [PHP] Numeric help needed

2012-01-15 Thread Chris Payne
Hi Jason,

I've tried lots of different things, including:

 echo br . round(68500, 1000) .  ROUNDED;

thinking that might be it, but i'm stumped

This is the example I was given (And have to go by):

If the loan amount is $68500.00, the insurace will be based on
$69000.00 as the amount is always rounded up to the next $1000.

Maybe i'm just looking at it wrong but i'm stumped.

Chris


On Sun, Jan 15, 2012 at 8:41 PM, Jason Pruim li...@pruimphotography.com wrote:


 Sent from my iPhone

 On Jan 15, 2012, at 8:25 PM, Christopher J Payne oxygene...@gmail.com 
 wrote:

 Hi everyone,



 I am having a hard time with a numerical problem.



 I need to round some numbers up and I've tried $round($number) and it
 doesn't work so I'm misunderstanding something.



 For example, if a user inputs 685000 I need it to round up to 69 or if
 they input 149560 I need it to round up to 15.  What is the correct way
 to do this as everything I have tried doesn't seem to affect the user
 inputted figure at all.



 Anyway help would REALLY be appreciated, I'm sure it's really simple but for
 the life of me I'm stumped on why it's not working.


 Maybe it's just a typo in your email but you put a $ infront of round() try 
 removing that and see if it helps. If not are there any error messages that 
 are showing up?


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



[PHP] Thank you all for your help

2012-01-15 Thread Chris Payne
Hi there,

A big thank you to all of you who took time to help me with my numeric
problem from earlier, it's been a huge help :-)

Chris

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



[PHP] Help needed with calculation

2009-11-15 Thread Chris Payne
Hi everyone,

I'm not sure of the correct formula for this, if I have a file - just
for example, that is 10245458756 bytes long and the download speed is
60KB a second, what formula would I use to calculate how many
seconds/minutes/hours it would take to download the file?

Maths really isn't my strong point and formulas go over my head
otherwise I wouldn't ask :-(

Thanks everyone

Chris

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



[PHP] What method is best for generating thumbnails in PHP from PDF's?

2009-11-12 Thread Chris Payne
Hi Everyone,

I have been asked to create thumbnails from the first page of a PDF
document on the fly with PHP, I have looked online but am confused as
there doesn't seem 1 simple solution.

What would you all recommend as an easy way to do this?

Any help would be really appreciated.

Chris

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



[PHP] Downloader help needed :-(

2009-09-24 Thread Chris Payne
HI everyone,

Thanks for those of you in the past that helped me with my downloader
not displaying the filename.  Someone gave me a link to the downloader
below which works GREAT but i've tried and tried to limit the data
transfer to 60KB a second andI can't get it to work, can any of you
see what I could add to get it to work?  The first peice of code the
code I WANT to use as it lets me download with the correct filename
etc .. but the second piece of code allows me to limit the speed
of the transfer but when I try to merge the second with the first it
craps out on me.

Any help would REALLY be appreciated on this one.

Thanks everyone.

Piece of code 1 (Code I WANT to use)

function forceDownload($file) {
/**
 * Function forceDownload:
 *  download any type of file if it exists and is readable
 * -
 * @author  Andrea Giammarchi
 * @date18/01/2005 [17/05/2006]
 * @compatibility   PHP = 4.3.0
 */
if(file_exists($file)  is_readable($file)) {
$filename = basename($file);
if(strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), 'MSIE') !== 
false
 strpos($filename, '.') !== false) {
$parsename = explode('.', $filename);
$last = count($parsename) - 1;
$filename = implode('%2E', array_slice($parsename, 0, 
$last));
$filename .= '.'.$parsename[$last];
};
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; 
filename='.$filename.'');
header('Content-Length:'.filesize($file));
header('Content-Transfer-Encoding: binary');
if(@$file = fopen($file, rb)) {
while(!feof($file))
echo fread($file, 8192);
fclose($file);
};
exit(0);
};

};

Piece of code 2 (Which limits nice but has other issues)

$speed = 60; // i.e. 60 kb/s download rate
if(file_exists($file)  is_file($file)) {
   header(Cache-control: private);
   header(Content-Type: application/octet-stream);
   header(Content-Length: .filesize($file));
   //header(Content-Disposition: filename=$file . %20);

   header(Content-Disposition: attachment; filename=\$file\);

   flush();
   $fd = fopen($file, r);
   while(!feof($fd)) {
  echo fread($fd, round($speed*1024)); // $speed kb at a time
  flush();
  sleep(1);
   }
   fclose ($fd);
}

Thank you everyone, it's really appreciated.

Chris

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



Re: [PHP] Downloader help needed :-(

2009-09-24 Thread Chris Payne
Hi there,

Thank you Tommy, I will look at this when my little 3 year old devil
is in bed, I appreciate your help :-)

Chris

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



[PHP] File download question

2009-09-06 Thread Chris Payne
Hi Everyone,

I've setup a filedownload which works but i'm having an issue, i've
left out but when it downloads it, while it has the correct file it
doesn't have a file extension associated with it, I need the .7z
extension associated with the filename, can anyone see why that would
do this below?

I'm sure it's something obvious but i'm new to doing file downloads.

Thank you everyone

Chris

$file = SOMEFILE.7Z;
$speed = 60; // i.e. 60 kb/s download rate
if(file_exists($file)  is_file($file)) {
   header(Cache-control: private);
   header(Content-Type: application/octet-stream);
   header(Content-Length: .filesize($file));
   header(Content-Disposition: filename=$file . %20);
   flush();
   $fd = fopen($file, r);
   while(!feof($fd)) {
  echo fread($fd, round($speed*1024)); // $speed kb at a time
  flush();
  sleep(1);
   }
   fclose ($fd);
}

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



[PHP] pre-screening pages before served?

2009-07-20 Thread Chris Payne
Hi everyone,

Is it possible to have the system pre-screen a page before it is sent
to a user?  What I mean is, if someone requests index.php could I have
a script scan the file before I serves it?  The reason I ask is this
way I could check for patterns on the script to make sure the page
hasn't been tampered with live, so to speak.

Chris

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



Re: [PHP] pre-screening pages before served?

2009-07-20 Thread Chris Payne
On Mon, Jul 20, 2009 at 12:30 PM, Per Jessenp...@computer.org wrote:
 Chris Payne wrote:

 Hi everyone,

 Is it possible to have the system pre-screen a page before it is sent
 to a user?  What I mean is, if someone requests index.php could I have
 a script scan the file before I serves it?

 Yes, apache has an output filter that can be set up as the last stage
 just before serving a page.


 /Per

 --
 Per Jessen, Zürich (19.8°C)

Thank you, i'll look into that this evening as it would solve some
problems i've had.  I want my system to check local copies of a page
against a cache I have of the same page and if they are different it
won't serve the page and will automatically send me a copy of the page
via email and restore it to what it should be.  A way of protecting
against attacks.  Just 1 stage but I want to be pro-active and always
be ontop of things.

Chris

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



Re: [PHP] pre-screening pages before served?

2009-07-20 Thread Chris Payne
 Really? This is an actual problem for you? It sounds too me that you have a
 malicious user on your server and if so, fire them. If you suspect you've
 been hacked from externally, then I would format and re-install -- or use a
 backup from a known good date. I've been coding PHP since 1996, and have
 NEVER heard of a man-in-the-middle attack like this. It just sounds like you
 have other problems and this isn't a solution, it's a band-aid.

Hi There,

There were MANY servers this past month had the same attack.  At the
end of every index page on the website some malicious PHP code was
added linking to an iframe etc . first thing i did (Of course) was
change all FTP and user account passwords on my server and LUCKILY it
hasn't happened since even though friends of mine have had it happen a
couple of times on their servers since.

I just want to have an extra layer of protection in place and i'm also
going to go through every single script I have written and lock them
down tightly as I don't know if they did this with FTP or some other
way to be honest.

Chris

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



[PHP] HELP SQL INJECTION

2009-07-10 Thread Chris Payne
Hi everyone,

My server appears to be the victim of a chinese hack-attack and I
believe they managed to change pages via SQL Injection, do any of you
have any ideas how to lock down my forms so MySQL cannot be used from
my forms?

Thanks everyone

Chris

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



Re: [PHP] HELP SQL INJECTION

2009-07-10 Thread Chris Payne
Hi everyone,

Hmmm i'm not sure it is an SQL Injection now, done a lot more checking
and it is inserting code at the end of every index.htm index.html
default.html and index.php pages on my site.

Ooooh what fun :-)

Chris

On Fri, Jul 10, 2009 at 2:22 PM, Govindagovinda.webdnat...@gmail.com wrote:

 On Jul 10, 2009, at 1:50 PM, Daniel Brown wrote:

 On Fri, Jul 10, 2009 at 15:48, Chris Paynechris_pa...@danmangames.com
 wrote:

 Hi everyone,

 My server appears to be the victim of a chinese hack-attack and I
 believe they managed to change pages via SQL Injection, do any of you
 have any ideas how to lock down my forms so MySQL cannot be used from
 my forms?

   First and foremost:

       http://php.net/mysql_real_escape_string

 I am total newbie here, but I can say I would recommend getting a good PHP
 book or at least reading some articles on preventing XSS attacks (if I said
 that right)  and also SQL injection.

 for inserting data in to your db, use placeholders.

 for printing data coming from the db, use htmlentities()

 for retrieving data from your db via form/user input, use
 mysql_real_escape_string and strtr() to escape SQL wildcards (%) and the _
 char.

 If I mis-guide the OP, please correct me!

 
 Govinda
 govinda.webdnat...@gmail.com



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



Re: [PHP] HELP SQL INJECTION

2009-07-10 Thread Chris Payne
Hi,

Yes their IP is from Russia by Chinese in origin.

How can this be prevented?

Thank you all SO much for your help, it is very appreciated.

Chris

On Fri, Jul 10, 2009 at 2:40 PM, Daniel Browndanbr...@php.net wrote:
 On Fri, Jul 10, 2009 at 17:37, Chris Paynechris_pa...@danmangames.com wrote:
 Hi everyone,

 Hmmm i'm not sure it is an SQL Injection now, done a lot more checking
 and it is inserting code at the end of every index.htm index.html
 default.html and index.php pages on my site.

 Ooooh what fun :-)

    Wouldn't happen to be in Chinese, would it?  It sounds quite
 reminiscent of the regular JavaScript and XSS stuff.

 --
 /Daniel P. Brown
 daniel.br...@parasane.net || danbr...@php.net
 http://www.parasane.net/ || http://www.pilotpig.net/
 Check out our great hosting and dedicated server deals at
 http://twitter.com/pilotpig


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



Re: [PHP] HELP SQL INJECTION

2009-07-10 Thread Chris Payne
 Thank you all SO much for your help, it is very appreciated.

    So would be your move to bottom-posting (with nods to the jihad
 that was the longest thread of the list so far this month) as per the
 mailing list rules.  ;-P

    What's the URL to your site, if you feel comfortable in providing it here?

Sorry I post at the top because i'm legally blind and it's easier but
i'll try to post at the bottom :-)

This is the main site on my server:

http://www.oxyge.net

I just took out the offending code at the end of the index page to get
it back up and running.

Chris

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



[PHP] Users Online?

2009-06-20 Thread Chris Payne
Hi everyone,

I have a login system that allows a user to login to my control panel,
is there an easy way so that I can tell how many users / what users
are logged into my system?  What would I need to do to add this with
the minimum of hassle?  Would I just have to look at the sessions that
are currently active and if so, how?  I really want to add this
feature as it will help with creating a messaging system.

It might be simple but if you've never done it before it's the hardest
thing in the world :-)

Thank you

Chris

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



[PHP] Search/Replace in entire database?

2009-06-14 Thread Chris Payne
Hi everyone,

I am in the middle of creating an editor where you can search and
replace on an individual column in a single table then I came across
something I need to be able to do but not sure how.

Is it posible (And if so please how :-) to search an entire database
and all tables within a database and do a find/replace on keywords
without having to specify each table/column within that table?

The people I am working for have made some big changes and one of them
is changing the names of one of their products, but this product name
appears EVERYWHERE in many tables and in lots of different column
names, and it would save so much time if I could do a single query
that would just search EVERYTHING within the database.

Thanks for any advice you can give me.

Regards

Chris Payne

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



[PHP] A couple of questions

2009-03-16 Thread Payne

Guys,

I had a page working on my opensuse 11.0 32bit, had to upgrade to 11.1 
64bit. I have two strange issues.


The first my code is being display when I call the page, I looked at the 
logs and I don't see any errors that explain why this happen. I looked 
at my php.ini and I don't see anything different or any outstanding.


In fact I put in place my old php.ini to see if I got the same issue and 
I didn't. What that one I am getting


include(): Failed opening 'template/header.inc'

Is there a way I can do like sh -x on a php page to see what is broke?

Thanks,

Payne

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



Re: [PHP] A couple of questions

2009-03-16 Thread Payne

Nick Cooper wrote:



2009/3/16 Stuart stut...@gmail.com mailto:stut...@gmail.com

2009/3/16 Payne pa...@magidesign.com mailto:pa...@magidesign.com

 I had a page working on my opensuse 11.0 32bit, had to upgrade
to 11.1
 64bit. I have two strange issues.

 The first my code is being display when I call the page, I
looked at the
 logs and I don't see any errors that explain why this happen. I
looked at my
 php.ini and I don't see anything different or any outstanding.

 In fact I put in place my old php.ini to see if I got the same
issue and I
 didn't. What that one I am getting

 include(): Failed opening 'template/header.inc'

 Is there a way I can do like sh -x on a php page to see what is
broke?


Check your include_path setting - my guess is that it doesn't
include the
current directory (.).

-Stuart

--
http://stut.net/


 The first my code is being display when I call the page

It sounds like you may have been using short tags.

Check for short_open_tag and turn it On:
 short_open_tag = On 


Or go through your code and replace ? with ?php

The second option is best.

Nick
 

Nick you where right, I had ? and not ?php thanks. I am working on the 
path issue. I am not sure why, but it calling that file in the apache 
root folder and not home.


Payne

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



[PHP] Advice wanted

2009-02-16 Thread Payne

Hi,

I am wanting to ask some advice on project I have in mind, but I am 
having problems finding examples. What I am working on is a set of tools 
that creates reports based on actions. I have the reports working good, 
but what I advice on is this. I like to create a page that shows a 
calendar. If an actions kicked off a report. I like to see on that 
calendar the date or link show a clickable link or under that date the 
name of the report.


Does anyone know where I can find examples so I can see what I need to do?

Payne

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



Re: [PHP] Help with an error...

2008-07-25 Thread Payne

Jim Lucas wrote:

Payne wrote:

Jim Lucas wrote:

So, to summarize everything said, with my own added notes.

[EMAIL PROTECTED] wrote:

Hi,

I am  currently working on a php script that will be called by 
cron. But I

have an error that keeps coming up.

Parse error: syntax error, unexpected T_VARIABLE inmail_report.php on

What I am trying to do is a simple php script to send me a report
everynight. Any clues as to why? Also does anyone know of a site 
with mail

srcipts that are ran on the cli?

-
?php



The following wont work if you use this from the CLI.  There is not 
remote addr.

$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

//This is a simple email to give me the status from yesterday.
//This connect the script to the db
require_once('mysql_connect.inc');



Loose the semi-colon at the end of your SELECT statements.  The 
mysql extension for PHP will add it on its own.


$query = Select ip, date, time, CONCAT(city, ', ',country) as 
location

from ips where country !=' ' and date = current_date() order by
date,time,country asc;;


You missed a semi-colon at the end of this line

$result = mysql_query($query)

$mailsend = mail([EMAIL PROTECTED],The IP's that Attacked
$hostname, The following are ip's that have try to attack your
system.\r\n\r\




You can't do this within a function call.  Like someone else said, 
you need to run the if/else and while portion before you mail call.  
Capture that data and then add it to the mail call.



if ($result) { //if that ran ok, display the record
echo table width=\'150\'trtd Country 
/tdtd # of

Attacks
/td/tr;

//fetch and print the records

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo trtd align=\'left\'$row[0]/tdtddiv
align=\'right\'$row[1]/div/td/tr;
}

echo '/table';

mysql_free_result ($result); //free up the resources

} else {  //if did not run ok

echo 'pThis could not be display due to a system 
error.

We apologize
fore any incovenience./pp'. mysql_error() . '/p';

}

,From:[EMAIL PROTECTED] To:[EMAIL PROTECTED]);
print($mailsend);
?






So here is the code re factored.

?php

# Setup your variables for later use.
$recipient = '[EMAIL PROTECTED]';
$subject   = 'The IP\'s that Attacked';
$add_headers[] = 'From: [EMAIL PROTECTED]';
$add_headers[] = 'Reply To: [EMAIL PROTECTED]';
$separator = \r\n;

//This is a simple email to give me the status from yesterday.
//This connect the script to the db
require_once('mysql_connect.inc');

$query = 
SELECT   ip,
 date,
 time,
 CONCAT(city, ', ',country) as location
FROM ips
WHEREcountry != ''
  ANDdate = current_date()
ORDER BY date, time, country asc
;

$result = mysql_query($query);

ob_start();
echo TXT
The following are ip's that have try to attack your system.

TXT;

//if that ran ok, display the record
if ($result) {
  echo TABLE

table width='150'trtdCountry/tdtd# of Attacks/td/tr
TABLE;

  //fetch and print the records
  while ( $row = mysql_fetch_assoc($result) ) {
echo ROW
tr
  td align='left'{$row['ip']}/td
  tddiv align='right'[$row['date']}/div/td
/tr
ROW;
  }

echo '/table';

//free up the resources
mysql_free_result ($result);

} else {
  //if did not run ok
  echo 'pThis could not be display due to a system error.
We apologize for any incovenience./pp'. mysql_error() . '/p';

}

$body = ob_get_clean();

$mailsend = mail($recipient, $subject, $body, join($separator, 
$add_headers));


print($mailsend);

?


Jim,

thanks, well I am still trying to work it out. Your scripts gives me 
this when I run it


--

[EMAIL PROTECTED]
to me
  show details 9:02 PM
Reply
Reply To: [EMAIL PROTECTED]

The following are ip's that have try to attack your system.

table width='150'trtdCountry/tdtd# of 
Attacks/td/tr/table





And mine is doing this nowe-mails the html code and nothing from 
the db



html
head
titleAttack's on $hostname/title
/head
body
   if ($result) { //if that ran ok, display the record
   echo table width='150'trtd Country /tdtd # 
of Attacks /td/tr;

//fetch and print the records
while ($row = mysql_fetch_array($result, 
MYSQL_NUM)) {
   echo trtd align='left'$row[0]/tdtddiv 
align='right'$row[1]/div/td/tr;

   }
echo /table;
mysql_free_result ($result); //free up 
the resources

} else {  //if did not run ok
echo pThis could not be display due to 
a system error. We apologize fore any incovenience./pp. 
mysql_error() . /p

[PHP] Help with an error...

2008-07-24 Thread payne
Hi,

I am  currently working on a php script that will be called by cron. But I
have an error that keeps coming up.

Parse error: syntax error, unexpected T_VARIABLE inmail_report.php on

What I am trying to do is a simple php script to send me a report
everynight. Any clues as to why? Also does anyone know of a site with mail
srcipts that are ran on the cli?

-
?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

//This is a simple email to give me the status from yesterday.
//This connect the script to the db
require_once('mysql_connect.inc');

$query = Select ip, date, time, CONCAT(city, ', ',country) as location
from ips where country !=' ' and date = current_date() order by
date,time,country asc;;
$result = mysql_query($query)

$mailsend = mail([EMAIL PROTECTED],The IP's that Attacked
$hostname, The following are ip's that have try to attack your
system.\r\n\r\


if ($result) { //if that ran ok, display the record
echo table width=\'150\'trtd Country /tdtd # of
Attacks
/td/tr;

//fetch and print the records

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo trtd align=\'left\'$row[0]/tdtddiv
align=\'right\'$row[1]/div/td/tr;
}

echo '/table';

mysql_free_result ($result); //free up the resources

} else {  //if did not run ok

echo 'pThis could not be display due to a system error.
We apologize
fore any incovenience./pp'. mysql_error() . '/p';

}

,From:[EMAIL PROTECTED] To:[EMAIL PROTECTED]);
print($mailsend);
?




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



Re: [PHP] Help with an error...

2008-07-24 Thread payne
Thanks guys.  I will take everything that as been stated to heart. Thanks
for the insight. I haven't don't much with mail.

Payne


 On Jul 24, 2008, at 1052AM, [EMAIL PROTECTED] wrote:

 $result = mysql_query($query)

 Missing a ; at the end of the line.


$mailsend = mail([EMAIL PROTECTED],The IP's that Attacked
 $hostname, The following are ip's that have try to attack your
 system.\r\n\r\

 You can't execute code inside of a function call the way you're trying
 to do. Instead do something like:

 $message = The following are ip's that have try to attack your system.
 \r\n\r\;

 Then in your code below, anywhere you have an echo statement, replace
 it with $message .= code here. For example: $message trtd align=
 \'left\'$row[0]/tdtddiv align=\'right\'$row[1]/div/td/tr;

 Then after you're done building your $message for the email,

 mail([EMAIL PROTECTED],The IP's that Attacked $hostname,
 $message);

 I'd suggest taking another read of the manual page for the mail
 function: http://php.net/manual/en/function.mail.php - the email is
 sent when you make the call, not created and stored in a variable when
 executed.

 Brady




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



Re: [PHP] Help with an error...

2008-07-24 Thread payne
Well all the insight were great, I am not getting and errors but I am not
getting mail. I am looking but php -e isn't telling me anything, and php
-l says there no syntax. What else can I do for debugged.

Payne

 Thanks guys.  I will take everything that as been stated to heart. Thanks
 for the insight. I haven't don't much with mail.

 Payne


 On Jul 24, 2008, at 1052AM, [EMAIL PROTECTED] wrote:

 $result = mysql_query($query)

 Missing a ; at the end of the line.


$mailsend = mail([EMAIL PROTECTED],The IP's that Attacked
 $hostname, The following are ip's that have try to attack your
 system.\r\n\r\

 You can't execute code inside of a function call the way you're trying
 to do. Instead do something like:

 $message = The following are ip's that have try to attack your system.
 \r\n\r\;

 Then in your code below, anywhere you have an echo statement, replace
 it with $message .= code here. For example: $message trtd align=
 \'left\'$row[0]/tdtddiv align=\'right\'$row[1]/div/td/tr;

 Then after you're done building your $message for the email,

 mail([EMAIL PROTECTED],The IP's that Attacked $hostname,
 $message);

 I'd suggest taking another read of the manual page for the mail
 function: http://php.net/manual/en/function.mail.php - the email is
 sent when you make the call, not created and stored in a variable when
 executed.

 Brady







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



Re: [PHP] Help with an error...

2008-07-24 Thread payne
 Have you set your SMTP server/port in your php.ini file?
Checking
 Have you checked your mail logs to make sure it is routing through?
Tailing the log as I run it.
 Have you verified it is sending from and to a valid email address?
Yes, those are valid.



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



Re: [PHP] Help with an error...

2008-07-24 Thread Payne

Jim Lucas wrote:

So, to summarize everything said, with my own added notes.

[EMAIL PROTECTED] wrote:

Hi,

I am  currently working on a php script that will be called by cron. 
But I

have an error that keeps coming up.

Parse error: syntax error, unexpected T_VARIABLE inmail_report.php on

What I am trying to do is a simple php script to send me a report
everynight. Any clues as to why? Also does anyone know of a site with 
mail

srcipts that are ran on the cli?

-
?php



The following wont work if you use this from the CLI.  There is not 
remote addr.

$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

//This is a simple email to give me the status from yesterday.
//This connect the script to the db
require_once('mysql_connect.inc');



Loose the semi-colon at the end of your SELECT statements.  The mysql 
extension for PHP will add it on its own.



$query = Select ip, date, time, CONCAT(city, ', ',country) as location
from ips where country !=' ' and date = current_date() order by
date,time,country asc;;


You missed a semi-colon at the end of this line

$result = mysql_query($query)

$mailsend = mail([EMAIL PROTECTED],The IP's that Attacked
$hostname, The following are ip's that have try to attack your
system.\r\n\r\




You can't do this within a function call.  Like someone else said, you 
need to run the if/else and while portion before you mail call.  
Capture that data and then add it to the mail call.



if ($result) { //if that ran ok, display the record
echo table width=\'150\'trtd Country /tdtd 
# of

Attacks
/td/tr;

//fetch and print the records

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo trtd align=\'left\'$row[0]/tdtddiv
align=\'right\'$row[1]/div/td/tr;
}

echo '/table';

mysql_free_result ($result); //free up the resources

} else {  //if did not run ok

echo 'pThis could not be display due to a system 
error.

We apologize
fore any incovenience./pp'. mysql_error() . '/p';

}

,From:[EMAIL PROTECTED] To:[EMAIL PROTECTED]);
print($mailsend);
?






So here is the code re factored.

?php

# Setup your variables for later use.
$recipient = '[EMAIL PROTECTED]';
$subject   = 'The IP\'s that Attacked';
$add_headers[] = 'From: [EMAIL PROTECTED]';
$add_headers[] = 'Reply To: [EMAIL PROTECTED]';
$separator = \r\n;

//This is a simple email to give me the status from yesterday.
//This connect the script to the db
require_once('mysql_connect.inc');

$query = 
SELECT   ip,
 date,
 time,
 CONCAT(city, ', ',country) as location
FROM ips
WHEREcountry != ''
  ANDdate = current_date()
ORDER BY date, time, country asc
;

$result = mysql_query($query);

ob_start();
echo TXT
The following are ip's that have try to attack your system.

TXT;

//if that ran ok, display the record
if ($result) {
  echo TABLE

table width='150'trtdCountry/tdtd# of Attacks/td/tr
TABLE;

  //fetch and print the records
  while ( $row = mysql_fetch_assoc($result) ) {
echo ROW
tr
  td align='left'{$row['ip']}/td
  tddiv align='right'[$row['date']}/div/td
/tr
ROW;
  }

echo '/table';

//free up the resources
mysql_free_result ($result);

} else {
  //if did not run ok
  echo 'pThis could not be display due to a system error.
We apologize for any incovenience./pp'. mysql_error() . '/p';

}

$body = ob_get_clean();

$mailsend = mail($recipient, $subject, $body, join($separator, 
$add_headers));


print($mailsend);

?


Jim,

thanks, well I am still trying to work it out. Your scripts gives me 
this when I run it


--

[EMAIL PROTECTED]
to me
  
show details 9:02 PM
  
  
Reply
  
  
Reply To: [EMAIL PROTECTED]


The following are ip's that have try to attack your system.

table width='150'trtdCountry/tdtd# of Attacks/td/tr/table




And mine is doing this nowe-mails the html code and nothing from the 
db



html
head
titleAttack's on $hostname/title
/head
body
   if ($result) { //if that ran ok, display the record
   echo table width='150'trtd Country /tdtd # of 
Attacks /td/tr;
 
   //fetch and print the records
 
   while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
   echo trtd align='left'$row[0]/tdtddiv 
align='right'$row[1]/div/td/tr;

   }
 
   echo /table;
 
   mysql_free_result ($result); //free up the resources
 
   } else {  //if did not run ok
 
   echo pThis could not be display due to a system 
error. We apologize fore any incovenience./pp. mysql_error() . /p;
 
   }
 
   

[PHP] *****[SPAM(1.8)]*****

2008-07-23 Thread payne
Spam detection software, running on the system magi.magidesign.com, has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
postmaster for details.

Content preview:  Hi, Can someone please point me to a web site with examples
   of php being use with the cli sending mail. I need to create a couple scripts
   that do that. I have looked on the net and most scripts are for form feed
   back. [...] 

Content analysis details:   (1.8 points, 1.5 required)

 pts rule name  description
 -- --
-1.7 ALL_TRUSTEDPassed through trusted hosts only via SMTP
 1.0 Magi_deSpam from Germany
 0.0 BAYES_50   BODY: Bayesian spam probability is 40 to 60%
[score: 0.4208]
 2.5 MISSING_SUBJECTMissing Subject: header


---BeginMessage---
Hi,

Can someone please point me to a web site with examples of php being use
with the cli sending mail. I need to create a couple scripts that do that.
I have looked on the net and most scripts are for form feed back.

Thanks...

Payne


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

[PHP] *****[SPAM(1.8)]*****

2008-07-23 Thread payne
Spam detection software, running on the system magi.magidesign.com, has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
postmaster for details.

Content preview:  Hi, Can someone please point me to a web site with examples
   of php being use with the cli sending mail. I need to create a couple scripts
   that do that. I have looked on the net and most scripts are for form feed
   back. [...] 

Content analysis details:   (1.8 points, 1.5 required)

 pts rule name  description
 -- --
-1.7 ALL_TRUSTEDPassed through trusted hosts only via SMTP
 1.0 Magi_deSpam from Germany
 0.0 BAYES_50   BODY: Bayesian spam probability is 40 to 60%
[score: 0.4208]
 2.5 MISSING_SUBJECTMissing Subject: header


---BeginMessage---
Hi,

Can someone please point me to a web site with examples of php being use
with the cli sending mail. I need to create a couple scripts that do that.
I have looked on the net and most scripts are for form feed back.

Thanks...

Payne


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

[PHP] passthru

2007-08-06 Thread Payne

Hi,

Does anyone know way to passthru man pages so they don't show the ascii 
formating?


Payne

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



Re: [PHP] passthru

2007-08-06 Thread Payne

Richard Heyes wrote:
Does anyone know way to passthru man pages so they don't show the 
ascii formating?


You could:

1) Replace all newlines (ASCII 10) with a br tag. htmlspecialchars()
   will do this for you.
2) Use a pre tag within which newlines are preserved
3) Use preg_replace to replace non-printable characters (Can't remember
   how exactly, but everything you need is in the manual - you will want
   to strip everything from ASCII 1 - ASCII 32. IIRC.


Thanks, I will give that a shot.

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



Re: [PHP] Question about passing date in sql...

2007-08-02 Thread Payne

Stut wrote:

Michael Preslar wrote:

I know it has to do with date='`date +%Y%m%d`', because if I remove it
works.


Are you trying to use perl's back tic operator in php here?


PHP also supports the that.

However, I think the OP's problem is that it's inside other quotes and 
is therefore not being executed. But, as someone else pointed out, you 
should be using the PHP date function to get the date from within PHP.


-Stut

Not perl, bash! Well, what I was trying to do was covert my bash script 
to php, my sql statement makes the call to date so that it puts today 
date, that all it doing. I will look around and see if I can do that 
with php.


Thanks.

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



Re: [PHP] Question about passing date in sql...

2007-08-02 Thread Payne

Payne wrote:

Stut wrote:

Michael Preslar wrote:

I know it has to do with date='`date +%Y%m%d`', because if I remove it
works.


Are you trying to use perl's back tic operator in php here?


PHP also supports the that.

However, I think the OP's problem is that it's inside other quotes 
and is therefore not being executed. But, as someone else pointed 
out, you should be using the PHP date function to get the date from 
within PHP.


-Stut

Not perl, bash! Well, what I was trying to do was covert my bash 
script to php, my sql statement makes the call to date so that it puts 
today date, that all it doing. I will look around and see if I can do 
that with php.


Thanks.

Guys, thanks for the help got it, if I switch to current_date with is 
build into mysql that does what I was doing anyway.


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



[PHP] Question about passing date in sql...

2007-08-01 Thread Payne

Guys,

Got a quick question.  I got a sql statement works when I pass it from 
the cli. but if I try in php I get nothing.


This is the statement.

Select ip, date, time, CONCAT(city, ', ',country) as location from ips 
where country !=' ' and date='`date +%Y%m%d`' order by country asc;


I know it has to do with date='`date +%Y%m%d`', because if I remove it 
works.


Any clue as to why?

Payne

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



[PHP] Help with getting PHP to see Pear.

2006-01-23 Thread Payne
Hi, I just installed SuSE 10 and I am having a problem with my phpnuke 
site and my maia site. PHPNUKE gives me this error...


*Warning*: main(db/mysql.php): failed to open stream: No such file or 
directory in */srv/www/htdocs/bse/db/db.php* on line *53*


*Warning*: main(): Failed opening 'db/mysql.php' for inclusion 
(include_path='/usr/share/php') in */srv/www/htdocs/bse/db/db.php* on 
line *53*


*Fatal error*: Cannot instantiate non-existent class: sql_db in 
*/srv/www/htdocs/bse/db/db.php* on line *86


But if I copy my old php.ini from 9.1 it works just fine.

One maia, it says that it not install, I took a look at my phpinfo and I 
did see this


*'./configure' '--prefix=/usr' '--datadir=/usr/share/php' 
'--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share' 
'--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib' 
'--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' 
'--disable-debug' '--enable-inline-optimization' '--enable-memory-limit' 
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' 
'--disable-ctype' '--disable-session' '--without-mysql' '--disable-cli' 
'--without-pear' '--with-openssl' '--with-apxs2=/usr/sbin/apxs2-prefork' 
'i586-suse-linux'


How can I get php to see pear, it is installed.  I have install modules 
with pear for maia and horde but neither seem to see pear.


Also I know that since 4.4.0 BC Math library is included, maia saying it 
not.



Payne

   
PEAR *FAILED*: Not installed. The PEAR extension is required by 
several other PHP extensions that Maia needs. See this page 
http://pear.php.net/ for more information about downloading and 
installing PEAR.

PEAR::Mail_Mime *SKIPPED*: Requires PEAR
PEAR::DB *SKIPPED*: Requires PEAR
PEAR::DB_Pager *SKIPPED*: Requires PEAR
PEAR::Net_Socket *SKIPPED*: Requires PEAR
PEAR::Net_SMTP *SKIPPED*: Requires PEAR
PEAR::Auth_SASL *SKIPPED*: Requires PEAR
PEAR::Net_IMAP *SKIPPED*: Requires PEAR
PEAR::Net_POP3 *SKIPPED*: Requires PEAR
PEAR::Log *SKIPPED*: Requires PEAR
IMAP library *OK*: 2004
LDAP library *OK*
MCrypt library *OK*: = 2.4.x with Blowfish and CBC
BC math library *FAILED*: Not installed. This PHP extension is 
required in order to decode certain types of URLs. See this page 
http://www.php.net/bc/ for more information about recompiling PHP with 
the --enable-bcmath flag.

gd graphics library *OK*: 2.0 or higher

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



[PHP] Help with getting PHP to see Pear.

2006-01-23 Thread Payne
Hi, I just installed SuSE 10 and I am having a problem with my phpnuke 
site and my maia site. PHPNUKE gives me this error...


*Warning*: main(db/mysql.php): failed to open stream: No such file or 
directory in */srv/www/htdocs/bse/db/db.php* on line *53*


*Warning*: main(): Failed opening 'db/mysql.php' for inclusion 
(include_path='/usr/share/php') in */srv/www/htdocs/bse/db/db.php* on 
line *53*


*Fatal error*: Cannot instantiate non-existent class: sql_db in 
*/srv/www/htdocs/bse/db/db.php* on line *86


But if I copy my old php.ini from 9.1 it works just fine.

One maia, it says that it not install, I took a look at my phpinfo and I 
did see this


*'./configure' '--prefix=/usr' '--datadir=/usr/share/php' 
'--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share' 
'--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib' 
'--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' 
'--disable-debug' '--enable-inline-optimization' '--enable-memory-limit' 
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' 
'--disable-ctype' '--disable-session' '--without-mysql' '--disable-cli' 
'--without-pear' '--with-openssl' '--with-apxs2=/usr/sbin/apxs2-prefork' 
'i586-suse-linux'


How can I get php to see pear, it is installed.  I have install modules 
with pear for maia and horde but neither seem to see pear.


Also I know that since 4.4.0 BC Math library is included, maia saying it 
not.



Payne


PEAR 	*FAILED*: Not installed. The PEAR extension is required by several 
other PHP extensions that Maia needs. See this page 
http://pear.php.net/ for more information about downloading and 
installing PEAR.

PEAR::Mail_Mime *SKIPPED*: Requires PEAR
PEAR::DB*SKIPPED*: Requires PEAR
PEAR::DB_Pager  *SKIPPED*: Requires PEAR
PEAR::Net_Socket*SKIPPED*: Requires PEAR
PEAR::Net_SMTP  *SKIPPED*: Requires PEAR
PEAR::Auth_SASL *SKIPPED*: Requires PEAR
PEAR::Net_IMAP  *SKIPPED*: Requires PEAR
PEAR::Net_POP3  *SKIPPED*: Requires PEAR
PEAR::Log   *SKIPPED*: Requires PEAR
IMAP library*OK*: 2004
LDAP library*OK*
MCrypt library  *OK*: = 2.4.x with Blowfish and CBC
BC math library 	*FAILED*: Not installed. This PHP extension is required 
in order to decode certain types of URLs. See this page 
http://www.php.net/bc/ for more information about recompiling PHP with 
the --enable-bcmath flag.

gd graphics library *OK*: 2.0 or higher

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



[PHP] A simple question

2004-11-13 Thread Chuck PUP Payne
Hey,

I have just upgrade my box and my forms are no longer passing information
into the database. I did a simple echo test and sure enough nothing. I was
using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I
thinking there is something that needs to be turn on in my php.ini that I
need to turn to pass information.

Any clues,

Payne 

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



Re: [PHP] A simple question

2004-11-13 Thread Chuck PUP Payne
If I was still on 4.1 I would understand, but I am on 4.3.4 now

I will read it but I think it will there is something that turn on in the
php.ini.

Payne

On 11/13/04 9:13 PM, Brad Bonkoski [EMAIL PROTECTED] wrote:

 Read this..
 http://www.php.net/release_4_1_0.php
 
 (Especially the part about global variables...)
 - Original Message -
 From: Chuck PUP Payne [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, November 13, 2004 9:02 PM
 Subject: [PHP] A simple question
 
 
 Hey,
 
 I have just upgrade my box and my forms are no longer passing information
 into the database. I did a simple echo test and sure enough nothing. I was
 using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I
 thinking there is something that needs to be turn on in my php.ini that I
 need to turn to pass information.
 
 Any clues,
 
 Payne
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] A simple question

2004-11-13 Thread Chuck PUP Payne
Ugh, from what I read now I have to re-write all my forms. No fun. Thanks
guys, I was hoping it was something simple.

I would like to ask one thing, here is a simple code that I was using can
someone explain to what need to be change to work with 4.3.4 so that I can
work on my other pages

?

$db_name = mylinks;

$table_name = links;

$connection = @mysql_connect(localhost,xxx,xxx) or die (Couldn't
connect);

$db = @mysql_select_db($db_name, $connection) or die (Couldn't select
database.);

$sql = INSERT INTO $table_name
(abc, keywords, links, name)
VALUES
('$abc', '$keyword', '$links', '$name');

// echo what should be going into the table...

print A: $abc, KW: $keyword, LINKS: $links, NAME: $name, SQL: $sqlP;

$result = @mysql_query($sql, $connection) or die(Couldn't execute query.);

?


Sorry to ask, just nothing is inserting into the data, and most of the books
I have are from 2000 a little dated.

Payne  


PS. Before someone tells me that it not good to post information here,
things have been change to protect my database.

On 11/13/04 9:59 PM, Janet Valade [EMAIL PROTECTED] wrote:

 
 Actually, read this:
 
 http://us2.php.net/manual/en/security.globals.php
 
 Janet
 
 Chuck PUP Payne wrote:
 
 If I was still on 4.1 I would understand, but I am on 4.3.4 now
 
 I will read it but I think it will there is something that turn on in the
 php.ini.
 
 Payne
 
 On 11/13/04 9:13 PM, Brad Bonkoski [EMAIL PROTECTED] wrote:
 
 
 Read this..
 http://www.php.net/release_4_1_0.php
 
 (Especially the part about global variables...)
 - Original Message -
 From: Chuck PUP Payne [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, November 13, 2004 9:02 PM
 Subject: [PHP] A simple question
 
 
 
 Hey,
 
 I have just upgrade my box and my forms are no longer passing information
 into the database. I did a simple echo test and sure enough nothing. I was
 using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I
 thinking there is something that needs to be turn on in my php.ini that I
 need to turn to pass information.
 
 Any clues,
 
 Payne
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 

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



[PHP] Help with Javascript

2003-11-12 Thread Payne
First thanks with the help I got yesterday with php and javascript 
problem, I have a problem with javascript and I need to know if anyone 
know of a javascript mailing like this, so some strange reason if I add 
the tag taget to this line...

a href=javascript:gotoAd() target=_top

Any of my browser give me an error, but it I remove it work, but it's 
lost due to frames.

I know this is a php question so if you can give me a javascript mailing 
that would be a BIG help.

Payne

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


Re: [PHP] Help with Javascript

2003-11-12 Thread Payne
Pablo,

Ok, I have it the page called top.php right now, are you that I need to 
place this in my index.html?

Payne

Pablo Gosse wrote:

Hi Payne.

The problem here is indeed the target attribute.  You say that if you
remove the target attribute it works, but is lost due to frames.
What exactly is it you're trying to do with the frames?  The solution
might be to embed the js function in the frame itself, and then access
it via href=Javascript:parent.targetframe.document.function();
Hope that helps.

Pablo.

-Original Message-
From: Payne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 12, 2003 9:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Help with Javascript

First thanks with the help I got yesterday with php and javascript 
problem, I have a problem with javascript and I need to know if anyone 
know of a javascript mailing like this, so some strange reason if I add 
the tag taget to this line...

a href=javascript:gotoAd() target=_top

Any of my browser give me an error, but it I remove it work, but it's 
lost due to frames.

I know this is a php question so if you can give me a javascript mailing

that would be a BIG help.

Payne

 

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


[PHP] How to adpated a javascrip with php...

2003-11-11 Thread Payne
Hi,

I have a Javascript that I like to use with PHP/MYSQL, But I don't know 
how to mix the two...



SCRIPT LANGUAGE = JavaScript
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
   if ((bName == Netscape  bVer = 3) ||

   (bName == Microsoft Internet Explorer  bVer = 4)) br = n3;

   else br = n2;

   if (br == n3) {

   boardNum = 0;
   boardSpeed = 4000;
   billboards = new Array();
   billboards[0] = new Image();
   billboards[0].src = $x;
   billboards[1] = new Image();
   billboards[1].src = $x;
   billboards[2] = new Image();
   billboards[2].src = $x;
   billboards[3] = new Image();
   billboards[3].src = $x;
   billboards[4] = new Image();
   billboards[4].src = $x;
   billboards[5] = new Image();
   billboards[5].src = $x;
   billboards[6] = new Image();
   billboards[6].src = $x;
   billboards[7] = new Image();
   billboards[7].src = $x;
   }
[I like to make $x to be called from the database...]

function rotateBoard() {

 document.billboard.src = billboards[boardNum].src;

 if (boardNum  billboards.length - 1) {

   boardNum++;

 } else {

   boardNum = 0;

 }

}

function jumpBillboard() {

window.location.href = url[boardNum];
}
/SCRIPT
Thanks for any help you can give...

Payne

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


Re: [PHP] Echo issue

2003-10-29 Thread Payne
Payne Wrtote:

\n is what you  are needing. \n means new line. So you want a new line 
you have to do this

echo (abc\n);
echo (Elm Street\n);
echo (Anytown, NY 0 \n);
to get

abc
Elm Street
Anytown, NY 0
you can also use a printf then you can use html code to get the same br.

You might want to grab you one for beginner C or PHP books, they usually 
all \ and example what are for. Or do a search on Google.

Payne

David Otton wrote:

On Wed, 29 Oct 2003 11:56:11 +1100, you wrote:

 

I have spent about an hour looking at this and have found I can't echo
anything with 16 characters or less! It can be over a single line or
multiple lines eg.
?php
echo(12345678);
echo(12345678);
?
-
but 

?php
echo(12345678);
echo(123456789);
?
-12345678123456789
Am I missing something really obvious here?
   

In the old C days, buffering while writing to a file could give this effect.

I have /no/ idea how that applies to your situation, though. Is it a CGI
install? Are there any options for buffering data between spawned programs
on your OS? What happens if you explicitly flush() after the echo?
Sorry I can't offer anything more concrete.

 

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


[PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Hi,

I have been working on a simple PHP script that called to a mysql 
database, where I  do the following

SELECT url FROM sponsors ORDER BY RAND();

When I do a refresh I keep getting the same url, I have test this sql 
statement in mysql and it works great. I think my problem is this...

Here is my php script

?

   $db = mysql_connect(69.15.40.130,cepayne,death);

   mysql_select_db(links,$db);

   $result = mysql_query(SELECT url FROM sponsors order by 
rand() LIMIT 1, $db);

  if ($myrow = mysql_fetch_array($result)) {

   echotable width='500' border='0' cellspacing='0' 
cellpadding='0';
  
  do {
 
  printf(trtd%s/td/tr\n,$myrow[url]);
  
  } while ($myrow = mysql_fetch_array($result));
  
  } else {
  
  echo Sorry, no message of day today;
  }

 echo /table

?

I  know that what I have got here must be the problem because this  code 
was use to get mutli line of results. Is there a way to retype this so 
that I only get the one statement I need?

Payne

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


Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Gerard Samuel wrote:

On Wednesday 29 October 2003 02:24 pm, Payne wrote:
 

Hi,

I have been working on a simple PHP script that called to a mysql
database, where I  do the following
SELECT url FROM sponsors ORDER BY RAND();
   

Try -
SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;
 

I did that same thing.

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


Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Ok, this gives me an error. I guess what I was asking early is there 
away to print an echo without doing myrow? Why can I do echo $result 
without getting Resource id # My thinking is if you look at my first 
e-mail, my code is trying to fetch multi-rows from the database, I don't 
need multi row,  I thinking becaue fetch calls the database multi time 
that it defects the rand() function.

Payne

Chris W. Parker wrote:

Payne mailto:[EMAIL PROTECTED]
   on Wednesday, October 29, 2003 11:54 AM said:
 

Try -
SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;


 

I did that same thing.
   

SELECT url FROM sponsors ORDER BY column RAND() LIMIT 1;

How about that one?



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
 

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


Re: [PHP] Calendar Tool

2003-10-28 Thread Payne
Matt Palermo wrote:

Hey everyone.  I am the creater of a PHP script called TotalCalendar
(http://sweetphp.com/TotalCalendar/) and I am looking for a little advice
and suggestions about making a tool for it.  I want to build an application
that users can download and install on their local machines which connects
to a site's calendar (that site obviously would have to have TotalCalendar
installed on it).  This client application would connect to the site's
calendar and retrieve all necessary info about different events located
inside the calendar.  Anyway, the advice I am looking for is where to start
the application.  PHP-GTK has been brought to my attention as a useful tool
to build something like this, however, I have absolutely no experience with
it.  I was wondering if anyone could point me in the right direction for a
detailed tutorial or applications that would help me build something like
this.  I have found a couple tutorials that show really simple things like
creating buttons, but not much more than that.  Please let me know if anyone
can help me out with this.  I am open for any type of suggestions for this
building this tool.
 

I hope it not just me but the site doesn't come up.

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


[PHP] Problem with RAND()

2003-10-23 Thread Chuck PUP Payne
Hi,

I am trying to understand how RAND (), because I've had this problem before
with other langs., I am using with this with MySQL statement that is in my
php script, but it's only put the first files. I only have three files, do I
need more files in my database?

Is RAND() or RAND (), please help. When I did basic back in the 8-bit days I
had problem with RANDOM then too.

Chuck

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



[PHP] Random Quotes...

2003-10-22 Thread Payne
Hi,

I am working on a project and I need to see sample quote for doing 
random quotes. These quotes will be put from a database. Can some please 
share me some sample code. Thanks.

Chuck

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


Re: [PHP] Tab index

2003-10-22 Thread Payne
Hardik Doshi wrote:

Is it DHTML or Javascript? Becaucse DHTML doesn't work the same way on 
Browser. You will need to do a search on google DHTML and Netscape and 
Safari, you make want to use Javascript because then any browser can 
read it.

Payne

Hi Group,

Currently i have setup the tabindex on the drop down
menu but it doesn't work on mozilla and safari
browser. It is only working with the IE. Tab index on
the text box and textarea fields are working perfectly
on cross browser. Does any one has a clue why the
tabindex on the drop down menu doesn't work on certain
browsers?
Thanks

Hardik Doshi

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
 

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


[PHP] Php and Fortune

2003-10-22 Thread Chuck PUP Payne
Hi,

Is there a way I can get php to call the program fortune then print that a
web page.

Thanks.

Payne

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



Re: [PHP] Php and Fortune

2003-10-22 Thread Chuck PUP Payne
Thanks Everyone. This is so cool!!! :)

On 10/22/03 11:15 PM, Mykroft Holmes IV [EMAIL PROTECTED] wrote:

 
 
 Mykroft Holmes IV wrote:
 
 
 
 Chuck PUP Payne wrote:
 
 Hi,
 
 Is there a way I can get php to call the program fortune then print
 that a
 web page.
 
 Thanks.
 
 Payne
 
 
 echo 'pre';
 passthru(fortune);
 echo '/pre';
 
 Should do it. I use this for a nice little Server Status page that
 iterates through an array of unix commands, works like a charm.
 
 Adam
 
 
 Oops, should be:
 
 echo 'pre';
 passthru('fortune');
 echo '/pre';
 
 Adam

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



Re: [PHP] Problem :file_exists japanese filename

2003-10-10 Thread Payne
What is the codepage for Japanese, that mysql uses?
(B
(BPayne
(B
(BMarek Kilimajer wrote:
(B
(BIs the codepage of filesystem and of the string the same? What do you
(Bsee if you list the files in the directory using php?
(B
(Bumesh wrote:
(B
(B  
(B
(BHi Gurus,
(B
(BI am using PHP4 on linux.
(B
(BI am reading the filename from querystring and display it in the browser.
(BBefore displaying , I am checking the existance of the file by using
(Bfile_exists.
(BIf the file name contains japanese characters, such as $BI4?M0l

[PHP] Limits and php...

2003-10-07 Thread Payne
Hi,

I have been trying to understand how to write a simple code that will 
let me limit the number of  files view to 10 records, but I need to 
under how php can look at a number of records and then caculates how 
many pages it needs to show all records. Is there some sample code that 
shows how to calculate and how to show limits  0,5 5,10 so on and so on

Payne

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


Re: [PHP] Dates

2003-10-03 Thread Payne
Ok, Mayve I need to be a little clear, I under the link below as showing 
dates. What I need to know how can I take the input of 09-12-1967 and 
have enter into a mysql data using php as 1967-09-12?  Because 
everything that is past from my form to mysql is not the way it was 
enter. Would I need to create three fields month, day, year, then take 
those three into -mm-dd? If so how?

Chuck

Jay Blanchard wrote:

[snip]
This might be mysql question but how can I change a US format date 
(mm/dd/) to a MySQL Format (/mm/dd).  Can I do this will php or 
will need let say javascript or perl to do this?
[/snip]

date(y/m/d);

RTFM at http://www.php.net/date

 

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


[PHP] passing form information.

2003-10-02 Thread Payne
Hi,

I am working a form to pass information from it to mysql data.  I am 
able to connect to the database. But nothing is being pass from the form 
to the php page.  This is my php code...

-form.html

html
head
   titleUntitled/title
/style
/head
body
form name=form1 method=post action=addlead.php
input name=title type=text size=40
input name=f_name type=text size=40
input name=l_name type=text size=40
input type=submit name=Submit value=Submit Information
/form
/body
/html
--addleads.php--
?
include(./config.php);

$sql = INSERT INTO $table_name
   (leads_id, title, f_name, l_name)
   VALUES
   ('$leads_id', \$title\, \$f_name\, \$l_name\);
//debug tool  

print $sql;

$result = mysql_query($sql, $connection) or
   die (Couldn't execute query.);
?
html
head
   titleUntitled/title
/style
/head
body
? echo $title ?
br
? echo $f_name ?
br
? echo $l_name
---

What I am getting this

INSERT INTO leads (leads_id, title, f_name, l_name) VALUES ('', , , )

*Salutation*

	

*First Name*

	

*Last Name*

As you can see nothing is being pass...is there some other command 
beside the print $sql statement to see why nothing is being passed.

Thanks.

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


Re: [PHP] passing form information.

2003-10-02 Thread Payne
Sorry,

I am LD. I do have the  ? echo ? in my code. The leads_id is an 
autonumber, it the primary key for the table. What do the .$field. gives 
you over $field?
Also another LD mistake, addlead.php is addlead.php.

I will try it.

Payne

Chris Sherwood wrote:

Hi Payne

for starters your missing an ? at the last echo
? echo $l_name
secondly I would rewrite the sql statement to read
$sql = INSERT INTO $table_name
(leads_id, title, f_name, l_name)
VALUES
(' .$leads_id. ', ' .$title. ', ' .$f_name. ', ' .$l_name.
');;
but the statement itself shouldnt cause a problem either way.

I am wondering where leads_id comes from however.. is it an auto number?

and finally your processing form is called addlead.php
and the form is posting to a form called addleads.php
hope this helps

chris
-- snip --
From: Payne [EMAIL PROTECTED]
 

I am working a form to pass information from it to mysql data.  I am
able to connect to the database. But nothing is being pass from the form
to the php page.  This is my php code...
-form.html
   


 

html
head
   titleUntitled/title
/style
/head
body
form name=form1 method=post action=addlead.php
input name=title type=text size=40
input name=f_name type=text size=40
input name=l_name type=text size=40
input type=submit name=Submit value=Submit Information
/form
/body
/html
--addlead.php
   

--
 

?

include(./config.php);

$sql = INSERT INTO $table_name
   (leads_id, title, f_name, l_name)
   VALUES
   ('$leads_id', \$title\, \$f_name\, \$l_name\);
//debug tool

print $sql;

$result = mysql_query($sql, $connection) or
   die (Couldn't execute query.);
?
html
head
   titleUntitled/title
/style
/head
body
? echo $title ?
br
? echo $f_name ?
br
? echo $l_name?
--
   

-
 

What I am getting this

INSERT INTO leads (leads_id, title, f_name, l_name) VALUES ('', , ,
   

)
 

*Salutation*
*First Name*
*Last Name*
   

-- snip --

 

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


Re: [PHP] passing form information.

2003-10-02 Thread Payne
Brad Pauly wrote:

Payne wrote:

[big snip]

What I am getting this

INSERT INTO leads (leads_id, title, f_name, l_name) VALUES ('', , 
, )


Is register_globals off?

- Brad

That's in the php.ini right?

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


Re: [PHP] passing form information.

2003-10-02 Thread Payne
I tried that and I am still get this.

INSERT INTO leads (leads_id, title, f_name, l_name) VALUES ( '', '', '', 
'');

and empty information is being posted into the database.

Chuck

Chris Sherwood wrote:

Hi Payne

for starters your missing an ? at the last echo
? echo $l_name
secondly I would rewrite the sql statement to read
$sql = INSERT INTO $table_name
(leads_id, title, f_name, l_name)
VALUES
(' .$leads_id. ', ' .$title. ', ' .$f_name. ', ' .$l_name.
');;
but the statement itself shouldnt cause a problem either way.

I am wondering where leads_id comes from however.. is it an auto number?

and finally your processing form is called addlead.php
and the form is posting to a form called addleads.php
hope this helps

chris
-- snip --
From: Payne [EMAIL PROTECTED]
 

I am working a form to pass information from it to mysql data.  I am
able to connect to the database. But nothing is being pass from the form
to the php page.  This is my php code...
-form.html
   


 

html
head
   titleUntitled/title
/style
/head
body
form name=form1 method=post action=addlead.php
input name=title type=text size=40
input name=f_name type=text size=40
input name=l_name type=text size=40
input type=submit name=Submit value=Submit Information
/form
/body
/html
--addleads.php
   

--
 

?

include(./config.php);

$sql = INSERT INTO $table_name
   (leads_id, title, f_name, l_name)
   VALUES
   ('$leads_id', \$title\, \$f_name\, \$l_name\);
//debug tool

print $sql;

$result = mysql_query($sql, $connection) or
   die (Couldn't execute query.);
?
html
head
   titleUntitled/title
/style
/head
body
? echo $title ?
br
? echo $f_name ?
br
? echo $l_name
--
   

-
 

What I am getting this

INSERT INTO leads (leads_id, title, f_name, l_name) VALUES ('', , ,
   

)
 

*Salutation*
*First Name*
*Last Name*
   

-- snip --

 

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


Re: [PHP] passing form information.

2003-10-02 Thread Payne
If I use the  $l_name = $_POST[l_name]; am I correct to believe that 
that will go in php area before the sql statement?

Chris Sherwood wrote:

Dont apologize. even the best of us make mistakes.

the .$field. is a more reliable way of displaying the information contained
within. as in a few cases I find the variable itself gets printed ie $field
shows up as $field in cases where I didnt use the .$field. just an
observation on my part.
if the form name was a typo then you will want to check your
register_globals in your php.ini file it probably is turned off
in which case you want to use
$l_name = $_POST[l_name];
etc..
this will give you the var values with out having to change your php.ini

its also more secure if what I read is correct.

Chris

 

I am LD. I do have the  ? echo ? in my code. The leads_id is an
autonumber, it the primary key for the table. What do the .$field. gives
you over $field?
Also another LD mistake, addlead.php is addlead.php.
I will try it.

Payne

Chris Sherwood wrote:

   

Hi Payne

for starters your missing an ? at the last echo
? echo $l_name
secondly I would rewrite the sql statement to read
$sql = INSERT INTO $table_name
   (leads_id, title, f_name, l_name)
   VALUES
   (' .$leads_id. ', ' .$title. ', ' .$f_name. ', '
 

.$l_name.
 

');;

but the statement itself shouldnt cause a problem either way.

I am wondering where leads_id comes from however.. is it an auto number?

and finally your processing form is called addlead.php
and the form is posting to a form called addleads.php
hope this helps

chris
 

 

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


[PHP] Dates

2003-10-02 Thread Payne
Hi ,

This might be mysql question but how can I change a US format date 
(mm/dd/) to a MySQL Format (/mm/dd).  Can I do this will php or 
will need let say javascript or perl to do this?

Payne

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


[PHP] config file

2003-09-19 Thread Payne
Hi,

I have a project that I need to write and in the past I would hard code 
a lot of information in pages that I should have put into a config file. 
I am wanting to know if there a website that example how to write a 
config file and how to the php call them.

Thanks

Chuck

--
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 Payne
Raquel Rice wrote:

On Fri, 19 Sep 2003 15:39:12 +
Curt Zirzow [EMAIL PROTECTED] wrote:
 

* Thus wrote Chris Sherwood ([EMAIL PROTECTED]):
   

To Whom it may concern the following users

[EMAIL PROTECTED] 
[EMAIL PROTECTED] 

has been flooding me with viruses. fortunately I have the
appropriate safeguards in place.
 

Yes, I was just about to contact the list admins about this.
Although I have gotten virus attatchments from other people as
well. 

And now I'm getting an autoresponder from someone's server saying
that I sent them a virus... egads... this is crazy :)
Curt

   

I got one of those too!  Someone's server is going crazy.  FIX IT!

==

Quoted:  From: [EMAIL PROTECTED]

Please contact your system administrator.

The scanned document was deleted.

Violation Information:
The subject violated the content filtering rule PHP as subject is a
malacious code - Not Allowed.  No attempt was made to repair.
--
Raquel

If God lived on earth, people would break his windows.
 --Jewish Proverb
 

Me too, I just got one. I think someone at that server is a member of 
this and got one of those 8 eights e-mails that where suppose to be from 
micrsoft this morning.

Chuck

--
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 Payne
Jackson Miller wrote:

Is there a way to output PHP to MS Excel format?

-Jac
 

One you can do a dump with mysqladmin save the file as myfile.csv , 
excel can read cvs formatted files.

Two you can use phpMyAdmin to do the save things.

Chuck Payne

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


[PHP] Off the subject I need help...

2003-08-20 Thread Payne
Hi,

I need help in finding a Microsoft SQL mailing list. I have a project that is becoming a 
nightmare because I have to port a SQL2000 to MySQL, then take site that is written in asp
and re-write them in php. So if anyone is on a SQL2000 or MS SQL mailing can you please send
a link. Thanks.

Chuck Payne

PS. No flames guys my life is in hell as it is because of asp and MS SQL.





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


[PHP] Wanting to better understand

2002-10-01 Thread Chuck \PUP\ Payne

Hey,

I am trying to better understand something, I learned a couple weeks ago
that if I do this...

If ($field == value1) {
$field = change to new value;

Now I have use this to change -00-00 to nbsp;. And the following.

If ($days  30) {
$days strongfont color='ff' . $days . /font/strong;
}


Want I want to do was add a second line this below to change the another
value to change to change to another color...

If ($days  45) {
$days strongfont color='ff00ff' . $days . /font/strong;

}

But, the second value is over riding the first vaule so I can't see the
differents. I sorry that this might be confusing but I am trying to ask the
way I can. I am not sure what you call this, expression I think. Any way is
there a way that I can use this expression to get two or more colors.

Thanks 

Chuck Payne
Magi Design and Support



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




Re: [PHP] Wanting to better understand

2002-10-01 Thread Chuck PUP Payne

A, ok. You know am still having problems with elseif, else, Ok, thanks I
will give it a try.


Chuck


On 10/1/02 11:03 PM, Chris Shiflett [EMAIL PROTECTED] wrote:

 Chuck,
 
 I'm not sure what you're trying to do, but I think you might just want
 to order it the other way around.
 
 if ($days  45)
 {
# $days is 46 or more
do stuff
 }
 elseif ($days  30)
 {
# $days is 31-45
do other stuff;
 }
 else
 {
# $days is 30 or less
more stuff;
 }
 
 Also, be careful about overwriting $days with that long string and then
 trying to compare it to a numeric value. You probably want to use a
 different variable name for the string.
 
 Happy hacking.
 
 Chris
 
 Chuck \PUP\ Payne wrote:
 
 If ($days  30) {
$days strongfont color='ff' . $days . /font/strong;
 }
 
 
 Want I want to do was add a second line this below to change the another
 value to change to change to another color...
 
 If ($days  45) {
$days strongfont color='ff00ff' . $days . /font/strong;
 
 }
 
 But, the second value is over riding the first vaule so I can't see the
 differents.
 
 


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




RE: [PHP] general apache list

2002-09-30 Thread Chuck Payne

apache.org or on Google for Apache Today, I think it apachetoday.org. There
you will find your list.

Chuck Payne
-Original Message-
From: electroteque [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 30, 2002 10:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] general apache list


where can i find it ?



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



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




[PHP] Include...

2002-09-28 Thread Chuck \PUP\ Payne

Hi,

I am trying to start using inc files. But I am this this error

Warning: Failed opening '/local/htdocs/movies/style.inc' for inclusion
(include_path='.:/usr/share/php') in /local/htdocs/movies/lmenu.php on line
3

I have this in my lmenu.php

Include (/local/htdocs/movies/style.inc);

So can't someone telling me what I am doing wrong. I thought .inc where
easy.


Chuck Payne



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




[PHP] Include...

2002-09-28 Thread Chuck PUP Payne

Hi,

I am trying to start using inc files. But I am this this error

Warning: Failed opening '/local/htdocs/movies/style.inc' for inclusion
(include_path='.:/usr/share/php') in /local/htdocs/movies/lmenu.php on line
3

I have this in my lmenu.php

Include (/local/htdocs/movies/style.inc);

So can't someone telling me what I am doing wrong. I thought .inc where
easy.


Chuck Payne



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




[PHP] Include Part 2

2002-09-28 Thread Chuck PUP Payne

Ok, I am trying to make my design a lot easier. I want to know if I can do
this...

I want to set up in my php page this...


$rows;

Under my db_info.inc I want to store this so that I can add delete from it.

$row = $title = myrow[title]; $format = myrow[format]; $category =
myrow[category];

Am I wrong to try this way? Do I need to set it up as fuction to call on?

Chuck Payne


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




Re: [PHP] Include Part 2

2002-09-28 Thread Chuck PUP Payne

What I was wanting to do was store the myrows under let say, db_info.inc
file. So that I can add or delete what myrows I want to call on.

I am thinking this what I need  to do...

Function row ($row) { //These are the rows to call on...
$title = $myrow[title];
$format = myrow[format];
$category =$myrow[category];
}

This way I can add more myrow to call upon at a later date or delete for
that matter.

I hope that helps...

Chuck

On 9/29/02 1:48 AM, Justin French [EMAIL PROTECTED] wrote:

 Not sure I fully understand, but usually this stuff calls for either a
 function, or an included file of code... in your case, sounds like a
 function is required, but I may not fully understand...
 
 Regards,
 
 Justin
 
 
 on 29/09/02 3:29 PM, Chuck PUP Payne ([EMAIL PROTECTED]) wrote:
 
 Ok, I am trying to make my design a lot easier. I want to know if I can do
 this...
 
 I want to set up in my php page this...
 
 
 $rows;
 
 Under my db_info.inc I want to store this so that I can add delete from it.
 
 $row = $title = myrow[title]; $format = myrow[format]; $category =
 myrow[category];
 
 Am I wrong to try this way? Do I need to set it up as fuction to call on?
 
 Chuck Payne
 
 


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




Re: [PHP] Include Part 2

2002-09-28 Thread Chuck PUP Payne

By the way I have time this but what is happen and maybe this will clear up
things. I only calling this first myrow call titles. It's not going on to
the other two. Now in my php page I have this...

$myrow = mysql_fetch_array($result);

$row;

Now this doesn't work. But this does.

$myrow = mysql_fetch_array($result);

$title = $myrow[title];
$format = $myrow[format];
$category =$myrow[category];


So want I wanted to do  but I am see you can was to make $row be called from
db_info.inc so that if lets say I wanted to add ratings I can add it to the
db_info.inc. The reasoning for this is about 50 pages and I am getting tried
of change each one I like to be able to change just one file. You know make
it easier. Better design. Sorry it 2:30am and Jolt cola is not working and I
am LD. So sorry if this is not clear.

Chuck Payne


On 9/29/02 2:06 AM, Chuck PUP Payne [EMAIL PROTECTED] wrote:

 What I was wanting to do was store the myrows under let say, db_info.inc
 file. So that I can add or delete what myrows I want to call on.
 
 I am thinking this what I need  to do...
 
 Function row ($row) { //These are the rows to call on...
   $title = $myrow[title];
   $format = $myrow[format];
   $category =$myrow[category];
 }
 
 This way I can add more myrow to call upon at a later date or delete for
 that matter.
 
 I hope that helps...
 
 Chuck
 
 On 9/29/02 1:48 AM, Justin French [EMAIL PROTECTED] wrote:
 
 Not sure I fully understand, but usually this stuff calls for either a
 function, or an included file of code... in your case, sounds like a
 function is required, but I may not fully understand...
 
 Regards,
 
 Justin
 
 
 on 29/09/02 3:29 PM, Chuck PUP Payne ([EMAIL PROTECTED]) wrote:
 
 Ok, I am trying to make my design a lot easier. I want to know if I can do
 this...
 
 I want to set up in my php page this...
 
 
 $rows;
 
 Under my db_info.inc I want to store this so that I can add delete from it.
 
 $row = $title = myrow[title]; $format = myrow[format]; $category =
 myrow[category];
 
 Am I wrong to try this way? Do I need to set it up as fuction to call on?
 
 Chuck Payne
 
 
 


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




[PHP] What other list are there?

2002-09-25 Thread Chuck Payne

Hi,

I am getting ready to start another project that will have to do a lot of
math. So I need to ask some question on how to get php and mysql to do that.
So can you tell what mailing list there because I think that I might have to
ask other list since this is general list, I am I think this might be a
little more advance. Hey, if I am wrong sorry, just thing to make sure a
head of time.

Thanks,

Chuck Payne
Magi Design and Support


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




[PHP] Thoughts on a simple search engine...

2002-09-24 Thread Chuck Payne

Ok for a simple search I should be able to create a form page and Enter the
value and select the feild that Ron want to search.

Example

$sql = SELECT * FROM \$table\ WHERE \$field\ LIKE \'%$value%'\ ORDER
BY \$input\;

$table = Of course the table they want to search
$field = Field that want to seach
$value = value what they want to by
$input = if they want to search by something other a node numder.

So I if I create the form, is there way that I can have it echo on the same
page if I am using a form?


Chuck Payne
Magi Design and Support



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




RE: [PHP] html input and php (newbie) -- What I was asking with my thoughts on Search Engine

2002-09-24 Thread Chuck Payne

This what I was asking, I want someone to press submit then have the returns
print out in one are of the table. So could I do this?


?php
 if ($submit == click){
   echo $sql_result;
 }

?

So instead of doing a search.html that calls on do_search.php like most
books teach. I am wanting to do a search.php. Just print the information on
that page.

Chuck


-Original Message-
From: Jesse Cablek [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 3:39 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] html input and php (newbie)


Anna Gyor mailto:[EMAIL PROTECTED] scribbled;

 Hi,

 I just began to learn php and I have te following code. How can I get
 the input field value in the php script? Because my script doesn't
 work. $UserName is always an empty string.

 ?php
 if ($submit == click){
   echo Hello, $UserName;
 }
[...]


Assuming register_globals=off, use $_POST['UserName'] instead

-jesse



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



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




[PHP] Maybe a stupid question but can it be done?

2002-09-23 Thread Chuck \PUP\ Payne

Ok, Let's try this again, for some reason this didn't post from early today.

I have db that has two tables that I am needing to post the same information
into both tables, I can't use ID. So I am want to see if there is a sql
statement that will let me or how I can do with a php page.

I am sorry to ask, I have looked around to see if there any on the net or in
my mysql and php books but this seems like a weird task.

Chuck Payne
Magi Design and Support


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




[PHP] Maybe a stupid question but can it be done?

2002-09-23 Thread Chuck PUP Payne

Ok, Let's try this again, for some reason this didn't post from early today.

I have db that has two tables that I am needing to post the same information
into both tables, I can't use ID. So I am want to see if there is a sql
statement that will let me or how I can do with a php page.

I am sorry to ask, I have looked around to see if there any on the net or in
my mysql and php books but this seems like a weird task.

Chuck Payne
Magi Design and Support


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




[PHP] Help with mail...

2002-09-22 Thread Chuck \PUP\ Payne

Hi,

Well after read php.net and my copy php 4 bible. I am lost with mail. I can
get it to work if I do this...

Mail ('[EMAIL PROTECTED]', 'Data Added',
   $fname, $lname .);

But I can't get this to work...I know someone going to call me stupid but I
am really having people with mail(), Is there a special place to put it?

Here example of my codeany way I trying to hammer it out and using
google to see where the error of my way is.

Chuck Payne


---

HTML
HEAD
TITLEKillers Added/TITLE
/HEAD

BODY TOPMARGIN=50

?php

if ($fname==) {
echo You did not supply a first name. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
  
  if ($lname==) {
echo You did not supply a Last Name. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
  
  if ($title==) {
echo You did not supply a Movie Title. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
 
 $dbh = mysql_connect(deathtoasp, zombieuser, eatmsbrains)
 or die (Unable to connect to database);
  mysql_select_db(slashers, $dbh)
 or die (An error was reported);
 
  $table_name = deathmovies;

  $statement = INSERT INTO $table_name (fname, lname, title) VALUES
(\$fname\, \$lname\, \$title\);

  $result = mysql_query($statement, $dbh);
  
  if ($result) {
  
echo H3Adding the following record/H3;
echo hr;
echo pstrongActor/Actress:/strongnbsp;nbsp; $fname $lname
/p;
echo br;
echo pstrongMovie:/strongnbsp;nbsp;$title/p;
echo a href='addactormovie.html'Add more Actor/Actress and Movie
which they stared in/a;
echo hr;

   $address = [EMAIL PROTECTED];
   $Subject = The new movie and actor added to phpMovie Library;
   $body = Adding the following record
Actor/Actress: '$fname $lname'
Movie: '$title';


mail('$address', '$Subject', '$body .');

  } else {
  
echo There was an error saving your entry. Please try back in a
little while.;
  }
 
?

/BODY
/HTML





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




Re: [PHP] Help with mail...

2002-09-22 Thread Chuck PUP Payne

Ok, that work. Why does the ' (quote) not make it work is it because it's an
array? Any thanks John that got it work.


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




[PHP] Design question.

2002-09-21 Thread Chuck PUP Payne

Hi,

I have a question. I been working a personal project that I am want to make
a like simpler. I have several pages have in which I have place the
information to connect to my database, whick is getting old.

What I am wanting to do is create file like most do, a config, but I want to
know which is better, config.php or config.inc. I know there not much
different from what I have read but I am wanting to know which gives more
protection. And what recommendation would you give on set it up? I am only
asking because I am at some point wanting to release my project to public.

Chuck Payne
Magi Design and Support


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




Re: [PHP] Design question.

2002-09-21 Thread Chuck PUP Payne

Thanks guys. That really helpful.

Chuck Payne

On 9/21/02 10:16 PM, Chris Shiflett [EMAIL PROTECTED] wrote:

 This explanation from Justin is worth saving.
 
 I also like to call all of my included modules *.inc, and I prefer to
 store them outside of document root.
 
 However, if you want to keep all of your files together, the .htaccess
 file shown below is the best way to restrict direct access to modules.
 Some people make the mistake of simply making *.inc files considered PHP
 by Apache (claiming it is better to execute them than to have their
 source code displayed), but this gives attackers the opportunity to
 execute your modules out of context - a very dangerous approach.
 
 One extra note worth adding is that you should add this configuration to
 your httpd.conf if you are the Web server administrator. This will keep
 you from having to remember the .htaccess file everywhere. Justin's
 method is best for when you do not have this option.
 
 Chris
 
 Justin French wrote:
 
 I place name all my included files *.inc... I place them all in a folder
 /inc/ and place a .htaccess file in that directory to restrict the files
 being served of HTTP:
 
 Files ~ \.inc$
Order Allow,Deny
Deny from all
 /Files
 
 Another option would be to place them in a folder ABOVE your web root, so
 that Apache can't serve them -- if you have that option.
 
 


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




[PHP] FPDF and MySQL

2002-09-19 Thread Chuck Payne

Hi,

I found a free pdfclass called FPDF http://www.fpdf.org, that I can use with
PHP to create pdf files with. Before someone tells me Read The Manual, I
have read their page and used Google to search for notes on how called mysql
into a PDF and I am lost. Does anyone know where there is a tutorial.

Thanks,

Chuck Payne
Magi Design and Support



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




[PHP] Time Stamp

2002-09-18 Thread Chuck Payne

Hi,

I have a form that I am using to update a mysql table but I can get
timestamp to update. How can I pass that information to pass on. I have
READ all books and feel I have correct systax but it just not working...

input type=text name=lastupdate value=?  echo date('D M d, Y H:i:s',
time()); ?

This should pass the time right?

Chuck Payne
Magi Design and Support




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




RE: [PHP] Date-format

2002-09-18 Thread Chuck Payne


I know everyone love to quote read the manual and forget that we[newbies]
are only asking here because we need help...so here you go...

You can do the following...

DATE_FORMAT IS THE MySQL Command

And let say you want to format your date as the following mm-dd-yy(US) or
dd-mm-yy(the rest of the world).

By the way this are format keys

%m the month in numbers,
%d the days in numbers,
%y the year in number
%M spells out the month
%D gives the date with th, rd, nd all that
%Y gives all four numbers

So you do the following sql statement...

SELECT DATE_FORMAT(yourdate, '%m-%d-%y') as youwanttocallit FROM yourtable;

So in your php code you can do this from your MySQL statement...

$youwantcallit = $myrow[youwanttoit];

? echo $youwanttocallit; ?

Advance note

then if you don't want to show 00-00-00 you can do this...

if ($youwanttocallit == 00-00-00) {
  $youwanttocallit = nbsp;;
}

that way you don't have a bunch of 00-00-00 showing up.

I hope that helps, because that is what the maillisting is for and not to
always quote Read the Book.

Chuck Payne
Magi Design and Support



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




[PHP] How to pass null as value?

2002-09-11 Thread Chuck PUP Payne

I know this may have been asked a thousand times but how do you pass null on
to a page as a value. Let say in a field where you have a yes and no. Null
needs to equal no. Is this more mysql? Can it be done in php?

Chuck Payne
Magi Design and Support


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




[PHP] Help getting count to show up.

2002-09-10 Thread Chuck Payne

Hi,

Last night I asked for help doing counts. One of the answers I got was
really great but I can't make it work. The answer I more or less show me a
great way to create a stats page,

ex. SELECT feild1, field2, COUNT(*) FROM tables GROUP BY category, format.

But my problem is I can't get count to show. I can get two of the fields.

Below is the PHP program that I am wanting to run. How can I get count to
show? Thanks.

Chuck Payne
Magi Design and Support




?

$db = mysql_connect('localhost','user','passwd');
mysql_select_db('media',$db);

$result =mysql_query(SELECT category, format, COUNT(*) FROM library GROUP
BY category, format,$db);

if ($myrow = mysql_fetch_array($result)) {

// display list if there are no records to display

do  {



printf(%s %s %sbr, $myrow[category], $myrow[format], $myrow[count]);

} while ($myrow = mysql_fetch_array($result));

} else {

// no record to display

echo 'Sorry no records were found!';

}


?



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




[PHP] Thanks...

2002-09-10 Thread Chuck \PUP\ Payne

Many thanks. That was the trick. :)

Chuck Payne
Magi Design and Support


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




[PHP] E-mail a submit

2002-09-09 Thread Chuck \PUP\ Payne

Hi,

Is there a way that when someone add a submit or edits a record that I can
have my php page e-mail that record? And is hard to do?

Chuck Payne


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




[PHP] Count in PHP

2002-09-09 Thread Chuck \PUP\ Payne

I am wanting to do a count in PHP. I want to be able to count the number of
records from a given database and display this count on the page. Can this
be done using PHP or is the sql thing?

Chuck Payne


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




[PHP] How to print a mysql result

2002-09-07 Thread Chuck PUP Payne

Hi,

I am having a problem with menu options being pass on to my database. Is
there a way that I can see what is sql statement that is passing on to the
database? Say maybe print $sql or something like that?

Chuck Payne


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




[PHP] How to do pass on information...

2002-09-07 Thread Chuck PUP Payne

Hi,

I would like to know if there is a way that I can pass on an information
from a pull down menu into a sql query. Right now I have to right a PHP page
for each piece I am wanting to pass on. Example I have a movie database and
now if I want to see what is in my Anime Category that starts with A I
have to create a page like this:

Select * FROM database WHERE category = 'anime' AND title like 'A%'

I know I have to do an array? Would it be like this?

$category 
$letter 

Select * FROM database WHERE category = '$category' and title is like
'$letter'

But it get to the sql statement is where I am lost.

Chuck Payne
Magi Design and Support


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




[PHP] Lost, need help debuggin....

2002-06-24 Thread Chuck \PUP\ Payne

Hi,

I am trying to debugging this script. But, I can see what the issue is, it
not listing errors on any of the mysql stuff but this what I see when I view
source








Here is the code.



html
head
titleBrowse A Movie in My Movie Database/title
meta name=generator content=BBEdit 6.1.2
/head
body

?php

//How many should be displayed on per page

$display_number = 25;

//Connect to the database

$db_connection = mysql_connect ('localhost', 'user', 'gateway') or die
('Could not connect');
$db_select = mysql_select_db ('media') or die (Couldn't not access
database);

//If we don't know how many pages there are, make that calculation.

print before the first if;

if (!isset($num_pages)) {


// Determine the query.

if(isset($letter)) { // Browsing a particular letter or the whole
shebang?

$query1 = SELECT library.title FROM media.library WHERE library.title
LIKE '$letter%' ORDER BY library.title ASC;

} else {

$query1 = SELECT library.title FROM media.library ORDER BY
library.title ASC;

}

//Query the database

$query_result1 = mysql_query ($query1) or die (Could not run query);


//Calculate the number of pages required.

$num_results = mysql_num_row ($query_result);
if ($num_results  $display_number) {
$num_pages = ceil ($num_results/$display_number);

} elseif ($num_results  0) {

$num_pages = 1;

} else {

echo 'There are no movies in this selection';

}

$start = 0; // Current at item 0


}

if(isset($letter)) { // Browsing a particular letter or the whole shebang?

$query = SELECT library.title FROM media.library WHERE library.title
LIKE '$letter%' ORDER BY library.title ASC LIMIT $start, $display_number;

} else {

$query = SELECT library.title FROM media.library ORDER BY library.title
ASC LIMIT $start, $display_number;

}


// Table that shows movies...

echo table align='center' cellpadding='2' cellspacing='2' border='1';
echo tr align='center';
echo td align='center'bTitle/b/td;
echo /tr;

// Print My list

$query_result = mysql_query ($query);

while ($row = mysql_fetch_array ($query_result)) {

print tr align='center';
print td align='center'ia
href='testlist.php?row[title]'$row[title]/a/i/td;
print /tr;

}

// Make the links to others pages, if nessessary.

if ($num_pages  1) {

print tr align='center';
print td align = 'center' colspan = '2';

// Determine what page the script is on.

if ($start == 0) {
$current_page = 1;

} else {

$current_page = ($start/$display_number) + 1;

}

// If it's not the make a back button...

If($start !=0) {
echo 'a href=browse_movie.php?start=' .($start - $display_number)
. 'num_pages=' .
$num_pages . 'lettter' . $letter . 'Back/a ';
}

// Make all the numbered pages.

for ($i = 1; $i = $num_pages; $i++) {
$next_start = $start + $display_number;
if ($i != $current_page) {

// Don't link the current page

print 'a href=browse_movie?start=' . (($display_number * ($i-1)))
.
'num_pages=' . $num_pages . '$letter=' .$letter . '' .$i . '/a
';

} else {

echo $i . ' ';

}

}

// If it's not the last page, make a next buttton.

if($current_page !=$num_pages) {
print 'a href=browse_movie?start=' . ($start + $display_number) .
'num_pages=' .
$num_pages . 'letter=' . $letter . 'Next/a ';


}

print /td;
print /tr;


}


?

/table
/body
/html




Thanks a head of time if you can show the error(s) in my code.

Chuck Payne
Magi Design and Support


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




Re: [PHP] Lost, need help debuggin....

2002-06-24 Thread Chuck \PUP\ Payne

Not sure I am on my laptop, an iBook running php/apache. So I am not sure
where php.ini is.

Chuck

On 6/24/02 3:29 PM, 1LT John W. Holmes [EMAIL PROTECTED] wrote:

 Do you have display_errors ON in your php.ini ??
 
 ---John Holmes...
 
 - Original Message -
 From: Chuck PUP Payne [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Monday, June 24, 2002 3:24 PM
 Subject: [PHP] Lost, need help debuggin
 
 
 Hi,
 
 I am trying to debugging this script. But, I can see what the issue is, it
 not listing errors on any of the mysql stuff but this what I see when I
 view
 source
 
 --
 --
 
 
 
 
 --
 --
 
 Here is the code.
 
 --
 --
 
 html
 head
 titleBrowse A Movie in My Movie Database/title
 meta name=generator content=BBEdit 6.1.2
 /head
 body
 
 ?php
 
 //How many should be displayed on per page
 
 $display_number = 25;
 
 //Connect to the database
 
 $db_connection = mysql_connect ('localhost', 'user', 'gateway') or die
 ('Could not connect');
 $db_select = mysql_select_db ('media') or die (Couldn't not access
 database);
 
 //If we don't know how many pages there are, make that calculation.
 
 print before the first if;
 
 if (!isset($num_pages)) {
 
 
 // Determine the query.
 
 if(isset($letter)) { // Browsing a particular letter or the whole
 shebang?
 
 $query1 = SELECT library.title FROM media.library WHERE library.title
 LIKE '$letter%' ORDER BY library.title ASC;
 
 } else {
 
 $query1 = SELECT library.title FROM media.library ORDER BY
 library.title ASC;
 
 }
 
 //Query the database
 
 $query_result1 = @mysql_query ($query1) or die (Could not run
 query);
 
 
 //Calculate the number of pages required.
 
 $num_results = @mysql_num_row ($query_result);
 if ($num_results  $display_number) {
 $num_pages = ceil ($num_results/$display_number);
 
 } elseif ($num_results  0) {
 
 $num_pages = 1;
 
 } else {
 
 echo 'There are no movies in this selection';
 
 }
 
 $start = 0; // Current at item 0
 
 
 }
 
 if(isset($letter)) { // Browsing a particular letter or the whole shebang?
 
 $query = SELECT library.title FROM media.library WHERE library.title
 LIKE '$letter%' ORDER BY library.title ASC LIMIT $start, $display_number;
 
 } else {
 
 $query = SELECT library.title FROM media.library ORDER BY
 library.title
 ASC LIMIT $start, $display_number;
 
 }
 
 
 // Table that shows movies...
 
 echo table align='center' cellpadding='2' cellspacing='2' border='1';
 echo tr align='center';
 echo td align='center'bTitle/b/td;
 echo /tr;
 
 // Print My list
 
 $query_result = @mysql_query ($query);
 
 while ($row = @mysql_fetch_array ($query_result)) {
 
 print tr align='center';
 print td align='center'ia
 href='testlist.php?row[title]'$row[title]/a/i/td;
 print /tr;
 
 }
 
 // Make the links to others pages, if nessessary.
 
 if ($num_pages  1) {
 
 print tr align='center';
 print td align = 'center' colspan = '2';
 
 // Determine what page the script is on.
 
 if ($start == 0) {
 $current_page = 1;
 
 } else {
 
 $current_page = ($start/$display_number) + 1;
 
 }
 
 // If it's not the make a back button...
 
 If($start !=0) {
 echo 'a href=browse_movie.php?start=' .($start -
 $display_number)
 . 'num_pages=' .
 $num_pages . 'lettter' . $letter . 'Back/a ';
 }
 
 // Make all the numbered pages.
 
 for ($i = 1; $i = $num_pages; $i++) {
 $next_start = $start + $display_number;
 if ($i != $current_page) {
 
 // Don't link the current page
 
 print 'a href=browse_movie?start=' . (($display_number *
 ($i-1)))
 .
 'num_pages=' . $num_pages . '$letter=' .$letter . '' .$i .
 '/a
 ';
 
 } else {
 
 echo $i . ' ';
 
 }
 
 }
 
 // If it's not the last page, make a next buttton.
 
 if($current_page !=$num_pages) {
 print 'a href=browse_movie?start=' . ($start + $display_number)
 .
 'num_pages=' .
 $num_pages . 'letter=' . $letter . 'Next/a ';
 
 
 }
 
 print /td;
 print /tr;
 
 
 }
 
 
 ?
 
 /table
 /body
 /html
 
 
 --
 --
 
 Thanks a head of time if you can show the error(s) in my code.
 
 Chuck Payne
 Magi Design and Support
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re: [PHP] Lost, need help debuggin....

2002-06-24 Thread Chuck \PUP\ Payne

Look, I am glad that we are clear on php.ini, but I post my message in hopes
that someone could look at it and say there your problem and go away, I've
turn on error part no help. Same things. So somewhere there is a sytax error
that is stopping it. PLEASE HELP!

Chuck Payne

On 6/24/02 3:54 PM, Erik Price [EMAIL PROTECTED] wrote:

 
 On Monday, June 24, 2002, at 03:51  PM, Erik Price wrote:
 
 sudo find / -name 'php.ini' -print
 
 Clarification: substitute the search string with 'php-ini.dist' if you
 haven't yet configured it.  Note that Macs, although they ship with PHP
 pre-installed, are missing this file and you should probably download it
 from the PHP source tree, if you're using the pre-installed PHP.  (If
 you've compiled your own, then you have it in the 'lib' directory of
 wherever you installed PHP, such as /usr/local/lib/php-ini.dist).
 
 
 Erik
 
 
 
 
 
 
 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]
 


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




[PHP] Problem with MySQL

2002-06-14 Thread Chuck Payne

Hi,

I am working on a movie database I have two database that I am calling from
but the problem I am having when I ask it to go and fetch all the movies
with the same title, it stops and only shows one.

Here is a basic layout...

if($videoid) {

 $result = mysql_query(SELECT * FROM library WHERE videoid=$videoid,$db);

 $myrow = mysql_fetch_array($result);

// The Myrows

$title = $myrow[title];
$videoid = $myrow[videoid];
$catergory = $myrow[catergory];
$appraisal = $myrow[appraisal];

// Some where here it's not working.

 $sql = SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE
title = '$title' ORDER by lname;
$result = mysql_query($sql);
 print $sql;

$actor = ;
while ($myrow = mysql_fetch_array($result)) {
  $actor = $myrow[actor];
  $actor .= A HREF='' . $actor . /ABR\n;

}

What am I doing wrong? It only show one record and it show more.

Chuck Payne




Re: [PHP] Problem with MySQL

2002-06-14 Thread Chuck \PUP\ Payne

Ok. Go to this link...

http://www.magidesign.com/movielist.php and select 12 Monkeys You will see
that only picked one actor...

It should have pick four

mysql SELECT concat_ws( , fname, lname) as actor FROM actormovie WHERE
title = 12 Monkeys ORDER BY lname;
+-+
| actor   |
+-+
| Brad Pitt   |
| Christopher Plummer |
| Madeleine Stowe |
| Bruce Willis|
+-+
4 rows in set (0.01 sec)

I know that the problem is some where in this statement...

$sql = SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE
title = '$title' ORDER by lname;

$result = mysql_query($sql);

 
$actor = ;
while ($myrow = mysql_fetch_array($result)) {
$actor = $myrow[actor];
$actor .= A HREF='' . $actor . /ABR\n;
 
}


Only thing is I am brain dead and can't see it...

Thanks for the help...

Chuck

On 6/15/02 12:10 AM, Tyler Longren [EMAIL PROTECTED] wrote:

 you need to put your $myrow in a while loop:
 
 while ($myrow = mysql_fetch_array($result)) {
 
 $title = $myrow[title];
 $videoid = $myrow[videoid];
 $catergory = $myrow[catergory];
 $appraisal = $myrow[appraisal];
 
 // blah blah blah everything else
 }
 
 Tyler Longren
 Captain Jack Communications
 www.captainjack.com
 [EMAIL PROTECTED]
 
 - Original Message -
 From: Chuck Payne [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Friday, June 14, 2002 11:03 PM
 Subject: [PHP] Problem with MySQL
 
 
 Hi,
 
 I am working on a movie database I have two database that I am calling from
 but the problem I am having when I ask it to go and fetch all the movies
 with the same title, it stops and only shows one.
 
 Here is a basic layout...
 
 if($videoid) {
 
 $result = mysql_query(SELECT * FROM library WHERE videoid=$videoid,$db);
 
 $myrow = mysql_fetch_array($result);
 
 // The Myrows
 
 $title = $myrow[title];
 $videoid = $myrow[videoid];
 $catergory = $myrow[catergory];
 $appraisal = $myrow[appraisal];
 
 // Some where here it's not working.
 
 $sql = SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE
 title = '$title' ORDER by lname;
   $result = mysql_query($sql);
 print $sql;
 
   $actor = ;
   while ($myrow = mysql_fetch_array($result)) {
 $actor = $myrow[actor];
 $actor .= A HREF='' . $actor . /ABR\n;
 
 }
 
 What am I doing wrong? It only show one record and it show more.
 
 Chuck Payne
 
 
 


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




[PHP] Are we getting spammed?

2002-06-03 Thread Chuck \PUP\ Payne

I just got something call ise-news, and the bottom it saying it mail from

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

Are getting spammed? Or it this for real?

This is from the e-mail.

--=_f74fc4c7192d1983b9f144709175f8eb
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Your email client is unable to display this issue of ise-news.  Most likely
this is because your email client cannot read HTML. To change your ise-news
subscription to the text version, go to:

http://www.social-ecology.org/ise-news/change.php?id=d963dfb04befe0df8673367
050c9ad8d

To unsubscribe, go to:
http://www.social-ecology.org/ise-news/unsubscribe.php?id=d963dfb04befe0df86
73367050c9ad8d


Chuck Payne
Magi Design and Support


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




Re: [PHP] Re: BBS system

2002-04-27 Thread Chuck \PUP\ Payne

The I like I have try three now is phpnuke it so easy to set up you can have
it up and running in 5 mins. YBBSE is another that is good.

http://www.phpnuke.org
http://www.yabbse.org

 
 | Chuck Payne  |
 | Magi Design and Support  |
 | www.magidesign.com   |
 | [EMAIL PROTECTED]   |
 

BeOS, Macintosh 68K, Classic, and OS X, Linux Support.
Web Design you can afford.

Never be bullied into silence. Never allow yourself to be made a victim.
Accept no one's definition of your life; define yourself.- Harvey Fierstein



on 4/27/02 11:53 AM, Yuri Petro at [EMAIL PROTECTED] wrote:

 PHPBB is REALLY best! :-)
 http://www.phpbb.com/
 
 --
 Kind regards,
 Yuri.
 
 
 www.AceHoster.com  Quality web hosting
 
 
 R [EMAIL PROTECTED]
 Hey all,
 
 Just a small q,
 does anybody know of any particular good BBS system that is free?  (I aint
 rich :-(   ) Been to hotscripts.com can you recomend any?
 
 (Actually if i were rich I would not care a damn for
 PHP-MySql-Apache-Java-ASP-JSP hell, i wouldnt even touch a computer,
 would be happy being computer illiterate, would have been partying with a
 lot of babes instead...hehhehe maybe thats why i aint rich...have too
 wicked a mind? )
 
 Ohh well
 Cheers,
 -Ryan.
 
 
 


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




[PHP] ASP to PHP

2002-04-23 Thread Chuck PUP Payne

I got a strange request from a client. He wants to be able to take his ASP
pages and move them over to PHP so that he can run them on apache on his
linux server. I saw a tool yesterday ASP2PHP, but I am wanting to know does
it work, how much is lost, is it easy to use? Is there another way to change
ASP file to PHP with out a lot of re-writes?

Chuck Payne


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




[PHP] Not A PHP question but I need help in a big way...

2002-04-22 Thread Chuck PUP Payne

Hi,

I just got finish will a meeting from HELL, I need to ask can some one tell
me is there an Apache Mailing List like this. I have to ask if I can do ASP
page on Apache, I know I know please don't flame me, I kept trying to get
them to switch to PHP, but I been told to shut my mouth and just find out
this information. So I am sorry that I am asking but I not sure where to
start.

Chuck Payne


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




  1   2   >