[PHP] Modifying data in forms with values

2005-09-13 Thread Robert Sossomon
I have to create registration forms all the time for people in the office and
what I keep running into is that I need a way for when they edit a field that
the drop-down list of choices is automatically set for the right now.

I have 100+ counties in one list, but I don't want to write 100+ if statements
for checking to see if the value of $county equals the value of the field I am
drop down choice.

Anyone have some quick solutions?

I have radio buttons as well, but going to use a drop-down list for the editing
pages to make it all simple.

Thanks!
Robert



-- 
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
512 BrickHaven Drive Suite 220L, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]

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



Re: [PHP] Automatically generated emails

2005-08-29 Thread Robert Sossomon
Ravi Gogna is quoted as saying on 8/29/2005 1:53 PM:
> This is probably a really simple question, but I can't work out what to
> write! I've written a fairly standard HTML form and I would like an
> email to be generated as soon as the user clicks 'Submit'. Can you help?!

Sure, but what do you want the email to say?  I mean, it could be such that when
 they click submit it sends them a BOGO email where they can get two-fers of
information, but then, why did they click submit in the first place?

The answer is, it is REALLY simple to send email (even more so if the mail
server is set correctly in the ini file and on the same system), but without
more information, can't really help you except to point you to the manual or 
Google.

PHP.net:
http://us2.php.net/mail

Google:
http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=PHP%3Amail

HTH,
Robert

-- 
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
512 BrickHaven Drive Suite 220L, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]

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



[PHP] redirect based off server string

2005-08-10 Thread Robert Sossomon
Anyone have a script or know of a way to check and see what the url is of a
system and then sending it to another url if it is not right?

I have this problem where if someone is using:
http://www.ces.ncsu.edu/depts/fourh
instead of:
http://www.nc4h.org

to get to my site it is breaking other pieces within it (though there is code in
place which supposedly stops this from happening, I have found that this is not
the case)

what I plan on doing is invoking the script on the main page of each man
sub-directory and the main page so that it should catch the majority of folks.

Any suggestions/help would be greatly appreciated!

Robert

-- 
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
512 BrickHaven Drive Suite 220L, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]

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



Re: [PHP] running number

2005-07-25 Thread Robert Sossomon

CREATE TABLE `users` (
  `num` int(10) NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  `login` varchar(100) NOT NULL default '',
  `password` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`num`),
  KEY `num` (`num`)
) TYPE=MyISAM AUTO_INCREMENT=12345 ;

That should help out.  When creating the table in mysql you can set the 
auto_increment number on the last line, which when you add a new user the query 
looks like:


insert into users values('','name','login','pass');

leaving the first field empty makes it automatically increase it.  The beauty is 
that you can have 400 people registering at once, and their number gets 
assigned as the query is run against the database, no matter what order they hit 
it in, the system will take it as they come.


HTH,
Robert

Roger Thomas is quoted as saying on 7/25/2005 5:21 AM:

I am required to write a user registration script that captures the basics like 
name, phone number etc etc. I would also have to write to mySQL database a 
number that is associated with that user.

At this point of writing, the start of that number is unknown. But the number 
will be incremented by 1 after each successfull registration.

Let's say the number starts from 12345.

I am quite new at all these stuff and would like to seek your advise on the 
*recommended way* of achieving this. I am thinking along these lines:
a) store that number (12345) in a table
b) a user registers and assign that number to him
c) increment number to 12346
d) process repeats for the next registration

Concern: How do tell mySQL to lock the 'number' table when a new registration 
process is about to take place. Is locking the best option here or is/are there 
better ways?

Please advise.

--
Roger


---
Sign Up for free Email at http://ureg.home.net.my/
---



--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
512 BrickHaven Drive Suite 220L, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]

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



Re: [PHP] Re: Working with 3 arrays

2005-03-10 Thread Robert Sossomon

$fields = $_POST[field];
foreach ($fields as $field)
{
$currentType = next($type);
$currentChar = next($char);
// Do the stuff
}
Thanks!!  I knew I was missing something simple in doing this!
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Working with 3 arrays

2005-03-10 Thread Robert Sossomon
I need to work with 3 different arrays where I get the value of the same key for 
all 3 (probably a term for this one).

The three arrays are:
field[]
type[]
char[]
and each will be assigned via another form.
What will happen is at the end of the form I want to be able to pull
field[0] type[0] char[0]
process the data and then move to the next one in all three.
I am thinking
$fields = $_POST[field];
foreach ($fields as $field)
{
Do the stuff
}
But I am a bit perplexed on how to operate on all three.
Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Primer for working with arrays

2005-02-09 Thread Robert Sossomon
I need a really good primer for working with arrays in PHP and with MySQL.  I 
can do what I need to do without them right now, but I would really like to get 
arrays figured out.

Any have some good ones?
Thanks!
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Prevent browser back...

2005-02-09 Thread Robert Sossomon
You can try an open/close window function, or my personal favorite is just a 
couple of pages that use the meta-refresh to jump people to a new page and dump 
them through a couple which they would never see, normally 2 is enough to stop 
someone from doing it (as well as a logout and making them login again).

HTH,
Robert
Ashley M. Kirchner is quoted as saying on 2/9/2005 1:05 PM:
   This is probably something that comes up every so often and it's 
generally related to PHP scripts, however I have a different setup and 
am now trying to figure out what to do.  On our company site, we have a 
section that clients use to upload files to us through a Java applet.  
The way I have it setup is basically through 3 separate pages:  
login.php, upload.php, and thankyou.php.  And people go through those 
pages in sequence.  After uploading a file (through upload.php where the 
applet resides) they get redirected to thankyou.php.  However, by 
hitting the back button, they can easily go back to the upload one, but 
I need to prevent that from happening.

   I know I can't disable the back button, or clean out someone's 
browser history, so I'm looking for other ways, server-side perhaps, 
that I can implement to prevent someone from reloading the upload.php 
page and try to upload another file (which will generate an error 
because the Java applet still has the old data in its variables.  This 
is just the way it works.)

   Can I rely on referrers on upload.php to see where a hit came from?  
Or should I redirect to an interim page that simply redirects again to 
the thankyou.php one (which won't stop someone from hitting back twice, 
but it's just an extra thing.)  What (other) ways have people found that 
works?

   -- A
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] upload file size limit

2005-01-31 Thread Robert Sossomon
Look in /etc/httpd/conf.d/php.conf
For a buddy with a file upload need I set it to this:

SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 760217600

You will need to set your upload limit higher in this file for it to work 
correctly.
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Access

2005-01-31 Thread Robert Sossomon
Anyone know of any classes or files for a way to write an Access readable file 
from PHP and MySQL?

Thanks!
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Search engine

2005-01-20 Thread Robert Sossomon
Why not use PHP to create static pages from your dynamic info (say 5 minutes 
after the data is update?) and allow for the system to search the site then?  I 
have noticed that I don't even have to do that for the search spiders from 
Google and yahoo to trawl my site and get everything, so maybe looking for code 
to curl through would be good?

Robert
Rosen is quoted as saying on 1/20/2005 7:48 AM:
But here the problem is, that the texts in database uses from different
scripts and on the search engine I should show and link to the sctipt, thath
shows searched data.
My idea was for search script, who explore the whole site (as generated from
PHP scripts - via links ).

"Ben Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Looks like you will have to write your own.  Have a look at the
scripts you have and see how they do it.  One option is to write the
'static' pages into the database as well as the file system.  I
personaly put all content into a database and do not really have any
static pages atall.
Ben
On Thu, 20 Jan 2005 14:18:49 +0200, Rosen <[EMAIL PROTECTED]> wrote:
I try many scripts for searching, but they don't work how I want.
The problem is, that part of site is static text ( not in database ) ,
other
part ( products ) are in MySQL database - this part is generating from
PHP
scripts.
"Ben Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
This kind of depends on what database you are using (I am asuming you
mean you have a data driven site you want to search so strictly
speaking it is the database that you want to search).
Mysl has free text search facilities (i.e. you can pass it a number of
words and it can search for them in a set of database fields and even
kreates a 'ranking').  however this only works if you have a few
hundread records - less than this and the results are unpredictable.
Have you tries googeling for php search scripts?
Ben
On Thu, 20 Jan 2005 14:04:44 +0200, Rosen <[EMAIL PROTECTED]>
wrote:
Hi,
Can someone recommend me a search engine script in PHP for inside
one
site?
Thanks in advance!
Rosen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] MMS?

2004-12-14 Thread Robert Sossomon
Anyone know of some scripts to email ringtones/graphics to your cell phone?
Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Free Auction Scripts

2004-12-14 Thread Robert Sossomon
Anyone have some good free auction scripts?  I can write what I want it to do, 
but why re-invent the wheel if I can find one at a great price (FREE)?

Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PARSE ERROR, unexpected T_$VARIABLE

2004-12-06 Thread Robert Sossomon
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in 
c:\fourh\leadership\registration_post.php on line 29

The HTML page:
http://rsossam-lap.ces.ncsu.edu/leadership/registration2.php
The processing Script


$fname= $_POST[fname];
$lname= $_POST[lname];
$addie= $_POST[addie];
$city= $_POST[city];
$state= $_POST[state];
$zip= $_POST[zip];
$county= $_POST[county];
$dphone= $_POST[dphone];
$ephone= $_POST[ephone];
$email= $_POST[email];
$first_conf= $_POST[first_conf];
$payment= $_POST[payment];
$PreConference= $_POST['PreConference'];
$Conference= $_POST['Conference'];
$choices = $_POST['choice'];
array_splice($choices,4);
$j=1;
for ($i=0; $i < count($choices); $i++)
{
 $value = $choices[$i];
 $tempChoice = "choice" . $j;
 $$tempChoice = $value;
 $j++;
}
$0405distoffice= $_POST['04_05_dist_office'];  //line29
$0506distoffice= $_POST['05_06_dist_office'];
$former= $_POST[former];
$achieve= $_POST[achieve];
?>

I pulled out the iterations above that line of code and tested it separately. 
Everything worked OK, so I copied it into the rest of the PHP processing.

This thing is driving me bonkers.  Any suggestions?
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Making variables with an iteration? STILL

2004-12-06 Thread Robert Sossomon
Here's the full code and the driving page:
http://rsossam-lap.ces.ncsu.edu/leadership/test.html


  echo $choice1;
  echo $choice2;
  echo $choice3;
  echo $choice4;
?>

The problem seems to be that it is only doing this on the last one, no matter 
which one it is...  I know it is in the iterations, but I can't place my finger 
on where I need to change things up.

--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Making variables with an iteration?

2004-12-06 Thread Robert Sossomon
I've got some inputs, which I need to tie down to only have 4 come in from.  The 
javascript to verify it is working somewhat, however I want to create the 
parsing script to loop through the inputs (choice) and then dump them into 
$choice1, $choice2, $choice3, $choice4 respectively.

I have to use checkboxes with different names with the javascript checkers I am 
using, since they seem to be working, however I can't seem to get the PHP in the 
parser to write the variables.  Any ideas?


for ($j=1, $j<5, $j++)
{
 $choices.$j= $_POST['choice'.$i];
}
Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Making variables with an iteration?

2004-12-06 Thread Robert Sossomon

Parse error: parse error, expecting `';''
coded:

--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie, project..

2004-12-02 Thread Robert Sossomon

Write a guestbook for your website.  :)
My first project for PHP was a custom shopping cart for my old company(ies) and 
I had to write it from the ground up.  Ambitious and I am sure my code is full 
of non-speedy stuff, but it works and still functions (for me anyways, they got 
rid of a 2-yr project when they opted to outsource).


--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Working with Dates

2004-12-02 Thread Robert Sossomon
I have this code below that needs to display stuff depending on WHEN it is.  I 
am pretty sure it is something simple I have confused (again) but can't place my 
finger on it.  Anyone see the mistake?


$today = date("m-d-y");
$early = date("m-d-y",mktime(0, 0, 0, 1, 14, 2005));
$normal = date("m-d-y",mktime(0, 0, 0, 1, 31, 2005));
if ($today <= $early) //also done with writing in "01-14-05"
{
 print "Pre-Conference$12";
 print "Early Registration (thru 01-14-05)$85";
 print "Registration for Saturday Only (thru 
01-14-05)$65";
}
else if ($today >= "01-15-05" || $today <= "01-31-05")
{
 print "Registration (01-15-05 thru 
01-31-05)$95";
 print "Registration for Saturday Only (01-15-05 thru 
01-31-05)$70";
}
?>

Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Cleaner way to do this?

2004-12-02 Thread Robert Sossomon
foreach ( $_POST as $key => $value )
{
 while ($key != "submit")
 {
  \$$key = $value;
  $addtocart .= ",'\$$key'";
 }
}
The problem is that it seems to be hanging at the while loop.  Is there a 
cleaner way to write the foreach loop so that it will dump out the "submit" key? 
 I've been trying different combinations, and am sure it is something simple I 
have boffed.

Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse error: parse error, expecting `']'' in

2004-12-02 Thread Robert Sossomon
Richard Lynch is quoted as saying on 12/1/2004 2:57 PM:
Robert Sossomon wrote:
Parse error: parse error, expecting `']'' in file.php


Unfortunately?? I knew exactly where the code was breaking (the lines I posted) 
since before I added those lines of code the script worked without any problems. 
 But what I don't understand is why sometimes '$_POST[variable]' works and why 
sometimes it will only work when it is '$_POST['variable']' .

Even through my reading and examples I see it both ways, so anyone able to give 
me a direction to go with it?  I am thinking of just changing my coding to put 
it the second way, but...???

Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Parse error: parse error, expecting `']'' in

2004-12-01 Thread Robert Sossomon
4_5]','$_POST[Attend_5_5]','$_POST[Attend_6_5]','$_POST[Attend_7_5]','$_POST[Attend_8_5]','$_POST[Attend_9_5]','$_POST[Attend_10_5]','$_POST[Attend_1_6]','$_POST[Attend_2_6]','$_POST[Attend_3_6]','$_POST[Attend_4_6]','$_POST[Attend_5_6]','$_POST[Attend_6_6]','$_POST[Attend_7_6]','$_POST[Attend_8_6]','$_POST[Attend_9_6]','$_POST[Attend_10_6]','$_POST[Attend_1_7]',
'$_POST[Attend_2_7]','$_POST[Attend_3_7]','$_POST[Attend_4_7]','$_POST[Attend_5_7]','$_POST[Attend_6_7]','$_POST[Attend_7_7]','$_POST[Attend_8_7]','$_POST[Attend_9_7]','$_POST[Attend_10_7]','$_POST[Attend_1_8]','$_POST[Attend_2_8]','$_POST[Attend_3_8]','$_POST[Attend_4_8]','$_POST[Attend_5_8]','$_POST[Attend_6_8]','$_POST[Attend_7_8]','$_POST[Attend_8_8]','$_POST[Attend_9_8]','$_POST[Attend_10_8]','$_POST[Attend_1_9]','$_POST[Attend_2_9]','$_POST[Attend_3_9]','$_POST[Attend_4_9]','$_POST[Attend_5_9]','$_POST[Attend_6_9]','$_POST[Attend_7_9]','$_POST[Attend_8_9]','$_POST[Attend_9_9]','$_POST[Attend_10_9]','$_POST[Attend_1_10]','$_POST[Attend_2_10]','$_POST[Attend_3_10]','$_POST[Attend_4_10]','$_POST[Attend_5_10]','$_POST[Attend_6_10]','$_POST[Attend_7_10]','$_POST[Attend_8_10]','$_POST[Attend_9_10]','$_POST[Attend_10_10]','$_POST[TE_CT_1]','$_POST[TE_CTL_1]','$_POST[TE_CT_2]','$_POST[TE_CTL_2]','$_POST[TE_CT_3]','$_POST[TE_CTL_3]','$_POST[TE_D_1]','$_POST[TE_LT_1]','$_POST[TE_
A_1]','$_POST[TE_FA_1]','$_POST[TE_H_1]'";
$cart3 = "";
$cart3 = 
"'$_POST[TE_D_2]','$_POST[TE_LT_2]','$_POST[TE_A_2]','$_POST[TE_FA_2]','$_POST[TE_H_2]','$_POST[TE_D_3]','$_POST[TE_LT_3]','$_POST[TE_A_3]','$_POST[TE_FA_3]','$_POST[TE_H_3]','$_POST[TE_D_4]','$_POST[TE_LT_4]','$_POST[TE_A_4]','$_POST[TE_FA_4]','$_POST[TE_H_4]','$_POST[TE_D_5]','$_POST[TE_LT_5]','$_POST[TE_A_5]','$_POST[TE_FA_5]','$_POST[TE_H_5]','$_POST[TE_D_6]','$_POST[TE_LT_6]','$_POST[TE_A_6]','$_POST[TE_FA_6]','$_POST[TE_H_6]','$_POST[TE_D_7]','$_POST[TE_LT_7]','$_POST[TE_A_7]','$_POST[TE_FA_7]','$_POST[TE_H_7]','$_POST[TE_D_8]','$_POST[TE_LT_8]','$_POST[TE_A_8]','$_POST[TE_FA_8]','$_POST[TE_H_8]','$_POST[TE_D_9]','$_POST[TE_LT_9]','$_POST[TE_A_9]','$_POST[TE_FA_9]','$_POST[TE_H_9]','$_POST[TE_D_10]','$_POST[TE_LT_10]','$_POST[TE_A_10]','$_POST[TE_FA_10]','$_POST[TE_H_10]','$_POST[TE_C]'";

$addtocart = "insert into efnep_form 
values('',".$cart1.",".$cart2.",".$cart3.")";
echo $addtocart;
And the error I get is showing up on the $cart1 = "' line of code
Any suggestions?
Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] imagesx(): supplied argument is not a valid Image resource (CODE)

2004-11-30 Thread Robert Sossomon
Chris is quoted as saying on 11/30/2004 2:53 PM:
imagesx()  requires an image resource , not a file path.  so you'd need 
to use one of the imagecreatefrom* functions to create the resource.

But it looks like all you want is the width and height of an image 
If so use get imagesize() ( which *does* except a pathname, not a resource)

Chris
http://www.php.net/image
http://www.php.net/getimagesize

I had looked at get image size, but thought the other would be quicker...  ARGH.
$a=getimagesize($path);
$width = $a[0];
$width = $width/2;
$height = $a[1];
$height = $height/2;
works!!
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] imagesx(): supplied argument is not a valid Image resource (CODE)

2004-11-30 Thread Robert Sossomon
John Nichel is quoted as saying on 11/30/2004 2:17 PM:

$width = imagesx($path)/4;
$height = imagesy($path)/4;
$width = imagesx($path)/4;
$height = imagesy($path)/4;
When I run it in the browser, I get:
Fatal error: Call to undefined function: imagesx() in c:\fourh\spotlight3.php on 
line 31

when i run it from the command line I get:
C:\fourh>php.exe spotlight3.php
Content-type: text/html
X-Powered-By: PHP/4.3.9

Warning:  imagesx(): supplied argument is not a valid Image resource in <
b>C:\fourh\spotlight3.php on line 31

Warning:  imagesy(): supplied argument is not a valid Image resource in <
b>C:\fourh\spotlight3.php on line 32

--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] imagesx(): supplied argument is not a valid Image resource (CODE)

2004-11-30 Thread Robert Sossomon
Here's the code for the page...

while ($file = readdir($handle))
{
 for ($i = 0; $i < count($extensoes); $i++)
 {
  if (eregi("\.". $extensoes[$i] ."$", $file))
  {
   $array[] = $file;
  }
 }
}
closedir($handle);
sort($array);
reset($array);
// takes the objects in the array and randomizes them
$arrayobj = array_rand($array);
$random = $array[$arrayobj];
// this creates the path name to the random file
// $path becomes the path name (duh) for the file
$path = $dir . $random;
$width = imagesx($random)/4;
$height = imagesy($random)/4;
// this is set up as an  tag and will show a random image
print "\n";
?>
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] imagesx(): supplied argument is not a valid Image resource

2004-11-30 Thread Robert Sossomon
I am running on Windows 200, PHP 4.3.9
I have my extensions directory set.

;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
extension=php_gd2.dll
extension=php_mime_magic.dll
extension=php_pdf.dll
extension=php_zip.dll

But I get this error:
imagesx(): supplied argument is not a valid Image resource
when I try to get the information from a file.
anyone have a clue?
Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Date handling

2004-11-16 Thread Robert Sossomon


I'm guessing Red Hat Enterprise or at least the kernel I'm using (which is
the latest RH kernel) qualifies under the Linux category above.  Also, with
the application I'm writing, I need to deal with dates after 2038 too.  So
that is why I'm investigating alternatives - just because I'd like something
that would definitely work on any platform and is 'official' as much as
possible - rather than have my date handling be OS-specific.

How are you entering the date into the Table?  Could you not just rewrite the 
page so that the date information is entered differently, then format it in the 
correct way and dump it into the table?  I would think that it would work to 
solve your problem in dealing with dates, but that is just a guess here.

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


[PHP] Date Conversions?

2004-11-15 Thread Robert Sossomon
I have a date in format YY-MM-DD in a MySQL table.  I need to pull it back to 
display it in either format: MM-DD-YY or Month Day, Year format.

I can't figure out how to write the query to do it, and am not sure how to make 
PHP just parse the one given and dump it back out in the way I need it.  Any 
suggestions?

Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Date Conversions?

2004-11-15 Thread Robert Sossomon
Matthew Weier O'Phinney is quoted as saying on 11/15/2004 3:01 PM:
* Robert Sossomon <[EMAIL PROTECTED]>:

http://php.net/strtotime
Specifically, try the following:
// $date is the date as pulled from the MySQL table
$convertedDate = date("m-d-y", strtotime($date));
Here's what I wound up using, in case anyone else comes across the same 
dilemma:
$Date = $Quote['Date'];
$EDate = date("M d, Y",strtotime($Date));

--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HTML->PDF

2004-11-12 Thread Robert Sossomon
Amanda Hemmerich is quoted as saying on 11/12/2004 4:01 PM:
Is there a fairly straightforward way to generate a PDF out of a .php file
that's made up of includes and the includes are contructed dynamically
using data from mysql?  This page normally displays the info based on
parameters passed through the url or through a form.  I've been looking

Here's what I used to use, and i know that there are better ways to do it now,
but it works for me:
a form to pass the data from, and then some includes

include_once('/home/fpdf/fpdf/html2pdf.php');
//connect to database
include 'db.php';
include 'salesinfo.php';
$order_id = $_POST[order_id];
$faxnumber = $_POST[faxnum];
$html = "";
$time = "-";
$time .= date("mdY-His");
$outtie = "/saved_quotes/$user";
$title = "Quote for $acct $uFname $uLname on $today";
$subject = "Quote for $acct $uFname $uLname on $today";
$author = "$uFname $uLname";
$outtie .= "-";
$html .= "\n\n";
$html .= $title;
$html .= "\n\n\n";
include 'order_header.php';
$html .= $header_block;
include 'views_order_head.php';
$html .= $view_head_block;
include 'views_order_body.php';
$html .= $display_block;
$html .= "\n\n";
$outtie .= $num;
$outtie .= $time;
$tempfilename = $outtie;
$outps = $outtie;
$outps .= ".ps";
$tempfilename .= ".html";
$outtie .= ".pdf";
$out_url = "/saved_quotes/$user-$num$time.pdf";
$tempfile = fopen($tempfilename,'w');
fwrite($tempfile, $html);
fclose($tempfile);
$last_line = system("/usr/local/bin/html2ps $tempfilename > $outps", $retval);
$last_line = system("/usr/bin/ps2pdf $outps $outtie", $retval);
$last_line = system("/usr/bin/sendfax -n -d $faxnumber $outtie", $retval);
$ps_line = system("/bin/rm -f $outps", $retval);
//header("Location: $out_url");
//exit;
HTH,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: probably stupid, but...

2004-11-12 Thread Robert Sossomon
Ben Ramsey is quoted as saying on 11/12/2004 3:41 PM:
You've got some parsing errors going on. Nothing particularly wrong with 
the logic...

OK, I took out the extra ' that I had at the beginning, and then I changed 
everything around to:

if (!empty($_POST['book_title_'.$i]))
   {
  $addtocart = "INSERT INTO `curriculum` VALUES 
('',$_POST['book_title_'.$i],$_POST['book_level_'.$i],$_POST['level_grades_'.$i],$_POST['book_section_'.$i],$_POST['chapter_'.$i],$_POST['chapter_title_'.$i],$_POST['lesson_title_'.$i],$_POST['skill_'.$i],$_POST['life_skill_'.$i],$_POST['success_indicator_'.$i],$_POST['ncscos_'.$i],$_POST['subject_'.$i],$_POST['pages_'.$i],$_POST['c_kit_'.$i])";
  echo "$addtocart";
  mysql_query($addtocart);

And it still is producing an empty page (not even echoing out the $addtocart 
variable) when I run it.

Unfortunately my server admins went AWOL, so I can get the exact error message, 
but I know it has to be some stupid that I just haven't put my finger on yet.

I could have had this done already doing it one line @ a time, however I want to 
be able to change either form at any time and have only 2 pieces of code to change.

Thanks for the help so far guys.
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] probably stupid, but...

2004-11-12 Thread Robert Sossomon
Jay Blanchard is quoted as saying on 11/12/2004 3:28 PM:
> [snip]
Did that and it fixed only that piece (saw it right after I sent the email out 
to the group).  I am thinking that it is still somewhat of the iterations that 
are causing problems.  I am waiting on the server guy to get back with me as to 
what the new error message looks like.

Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] probably stupid, but...

2004-11-12 Thread Robert Sossomon
I have a form that sends 20 rows of data into a script, instead of having to 
write 20 separate add functions, I wrote this piece of code...

$i=1;
while ($i<20)
{
 if ($_POST[book_title_$i]' != "")
 {
  INSERT INTO `curriculum` VALUES 
('','$_POST[book_title_$i]','$_POST[book_level_$i]','$_POST[level_grades_$i]','$_POST[book_section_$i]','$_POST[chapter_$i]','$_POST[chapter_title_$i]','$_POST[lesson_title_$i]','$_POST[skill_$i]','$_POST[life_skill_$i]','$_POST[success_indicator_$i]','$_POST[ncscos_$i]','$_POST[subject_$i]','$_POST[pages_$i]','$_POST[c_kit_$i]');

  $message .= "The entry  $i was entered
";
 $i++;
 }
 else
{  $i++; }
}
But I get THIS error in the log:
 [12-Nov-2004 14:59:19] PHP Parse error:  parse error, unexpected  T_VARIABLE, 
expecting ']' in  /home/public/html/depts/fourh/curriculum_form_post.php on line 19

-
How can I go about iterating through the script?  or do I just need to write 20 
if/else statements and separate inserts?

Thanks,
Robert
--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] No luck creating dynamic images

2004-11-01 Thread Robert Sossomon
Works fine for me, though the image needs to be lengthened some to get the whole 
text in it.

Check your server settings...
Robert
Ken Tozier is quoted as saying on 11/1/2004 2:51 PM:

Enable FULL error reporting.

I tried this with error_reporting(E_ALL); and ran the script in multiple 
browsers no errors reported.

Also ran phpinfo(); (as suggested by Jay Blanchard) which worked without 
problem. The settings under GD were all enabled for the common image types.

Anybody see any glaring errors in the following?
Here's the html:






And here's the php:

--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Date Calculation

2004-10-29 Thread Robert Sossomon
Wouldn't just making the script get 2 time stamps be more efficient, since you 
are creating the database calls anyways?  Or am I over simplifying it?


// current time at start of script
$before = strtotime("now");
//All your DB stuff
{
 
}
// current time at end of script
$after = strtotime("now");
$timed = ($after - $before);
echo 'Time for script to execute: ' . $timed .' seconds';
?>
Robert

Mike Tuller is quoted as saying on 10/28/2004 5:19 PM:
Ok, so here is what I have. Please check to see if there is a better 
way. There are a lot of database calls to me.

--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newsgroups Space

2004-10-06 Thread Robert Sossomon
Jay Blanchard is quoted as saying on 10/6/2004 4:49 PM:
[snip]
i know this isn't completely related to php but i am creating a web
based 
news reader in php, how much disk space do you think i need to run my
own 
local news server?
[/snip]

I'd go with a 1TB RAID
Only 1TB??
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Upload problems

2004-10-06 Thread Robert Sossomon
With apache, check out the php.conf file located at:
/etc/httpd/conf.d
and modify it to be:

SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 838860800

That'll allow a full CD worth of information to be uploaded...  :)
Robert
raditha dissanayake wrote:
Dennis Gearon wrote:
Would you mind sharing what it was so that it hits the archives and a 
few 'enquiring minds'?

it probably was the LimitRequestBody apache directive which is set to 
512 Kb in some 'out of the box' installations.


--
Robert Sossomon, Business and Technology Application Technician
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse file and input into DB -> More

2004-10-04 Thread Robert Sossomon
Whoops.
I am planning to do an upload of HTML files that are written from Belarc 
Advisor or from another utility that checks your system and creates a 
profile.

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


[PHP] Parse file and input into DB

2004-10-04 Thread Robert Sossomon
What I would like to do is upload a file and have PHP parse the file and 
dump the information into a MySQL database, putting the information into 
select tables.  I believe I can do everything EXCEPT parse the page. 
Anyone have some insight (or direct links) to some examples on what to 
use to do it?

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


Re: [PHP] Website with a Instant Messenger

2004-09-28 Thread Robert Sossomon
Use jabber.
They had a web interface over a year ago, and it can be tweaked to 
operate with or without a locked down registration form.

I had some scripts at my old job to handle just this very thing, but 
alas I did not get a chance to copy them before I left.  It's pretty 
straight forward and jabber is trifling easy to get set up and running, 
especially on a RH system.

Robert
Ricardo Cezar wrote:
Well, I think everybody starts there, including me! :)
I´m searching google...
But thanks
:)

"Jay Blanchard" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
[snip]
Where can I start?
[/snip]
http://www.google.com
 

--
Robert Sossomon, Webmaster and IT Guru
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Structure of Directories?

2004-09-27 Thread Robert Sossomon
What I would like to do is create a list at the top of each page that 
tells the path to the file starting at the root page and links to that 
same area so that a document residing in /webroot/folder1/folder2/file.html

would have
Home > Folder1 > Folder2>
at the top of the page.
What's the BEST way to go around doing this so that it is dynamically 
created?

Thanks,
Robert
--
Robert Sossomon, Webmaster and IT Guru
4-H Youth Development Department
200 Ricks Hall, Campus Box 7606
N.C. State University
Raleigh NC 27695-7606
Phone: 919/515-8474
Fax:   919/515-7812
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] multiple checkboxes

2004-08-03 Thread Robert Sossomon
Sorry, day late and a dollar short on that one...  Never once thought
about using an array, but after seeing John's and Curt's emails on it
(when I realized I was NOT at the top of my emails) I saw how brilliant
a solution that is...

Robert

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



RE: [PHP] multiple checkboxes

2004-08-03 Thread Robert Sossomon
You need to do: 
 
 

Keeping the name the same makes them a RADIO button and you will only
get the last one.

Robert

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



RE: [PHP] Is there a brian I can pick?

2004-07-26 Thread Robert Sossomon
It looks like you need to reset the $state variables each loop through
so that they are all empty, hence when you get to west virginia and
wisconsin they are but empties behind them

Heck, personally I'd just add another cell to the table and make it have
the full name in, then just use that column of data to populate the
system, since you are calling everything anyways, why work more when
another column can be used and have multiple uses??

My $.02

Robert

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



RE: [PHP] URL

2004-07-21 Thread Robert Sossomon

-Original Message-
From: Bruno Santos [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 21, 2004 11:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] URL

Hello All.

Im developing a couple of pages and i need to do some redirecting to 
another page depending on the choice of a user.


Since you are getting the information from the page anyways, just simply
do:

$_SERVER[PHP_SELF]?parameter1=$_GET[parameter1]¶meter2=$_GET[paramet
er2]¶meter3=$_GET[parameter3] etc...

HTH,
Robert

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



RE: [PHP] Dynamic to Static

2004-07-15 Thread Robert Sossomon
>Is anyone taking a dynamic PHP / MySQL site and storing or cacheing it
statically in 
>order for pages to display more quickly when visitors access the site?
If so, what 
>solutions are you using to achieve this?


I looked at doing it, wrote a single PHP-page that when I accessed would
make static pages for me (numbering in the thousands), but it was all
for nought as the pieces of code I included in the web pages made for
not being able to get a PHP-session variable and hindering my cart
process.  Maybe I could change the code in some way to get the correct
information where I need it, but at this time the functional way to do
it was with leaving the pages dynamic.

That being said, if all you want to do is spit out numerous pages (based
off MySQL data) and put them on the web for people to look at, I would
be happy to shoot you my PHP page to work it out.

Robert

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



[PHP] Log all GET AND POST?

2004-07-15 Thread Robert Sossomon
I was wondering if anyone knew of a way to log all GET and POST
information being passed to a log file?

Thanks,
Robert

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



[PHP] Pocket Excel files?

2004-07-07 Thread Robert Sossomon
Anyone know how to write pocket excel files and how to write the
contacts file for pocket PC?  I want to let my users download files
straight to their pocket PCs without having to run a conversion process
in the middle.

Thanks,
Robert

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



RE: [PHP] Works in Mozilla, not in IE

2004-06-28 Thread Robert Sossomon
That just put me right back at the beginning, IE trying to DL the PHP
page...

I have php 4.2.2 installed at this moment as well...

Robert

-Original Message-
From: Frank M. Kromann [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 28, 2004 3:58 PM
To: Robert Sossomon
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Works in Mozilla, not in IE


You also need to change 

header("Content-type: application/octet-stream");

to

header("Content-type: application/vnd.ms-excel");

- Frank

> That just made IE put it out in "data" style, Excel didn't open up.
> 
> :(
> 
> Any other thoughts?
> 
> -Original Message-
> From: Frank M. Kromann [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 28, 2004 2:47 PM
> To: Robert Sossomon
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Works in Mozilla, not in IE
> 
> 
> Hi Robert,
> 
> This line
> 
> header("Content-Disposition: attachment; filename=customers.xls");
> 
> forces IE to save. If you change attachment to inline it will open the

> Excel in the plug-in imbeded in the browser.
> 
> - Frank
> 
> > I have the script below from another source, and it works prefectly
in
> 
> > Mozilla, however IE keeps wanting to save the PHP page and then
barfs.
> 
> > Any ways to fix and make it work for both?
> > 
> > TIA!
> > Robert
> > 
> > 
> > 
> >  > //Written by Dan Zarrella. Some additional tweaks provided by JP
> > Honeywell //pear excel package has support for fonts and formulas 
> > etc.. more complicated
> > //this is good for quick table dumps (deliverables)
> > 
> > //Includes Snipped for posting
> > //DB Query tweaked for usage
> > $result = mysql_query("select * from customers where cust_salesmen =
> > $user_id"); $count = mysql_num_fields($result);
> > 
> > for ($i = 0; $i < $count; $i++){
> > $header .= mysql_field_name($result, $i)."\t";
> > }
> > 
> > while($row = mysql_fetch_row($result)){
> >   $line = '';
> >   foreach($row as $value){
> > if(!isset($value) || $value == ""){
> >   $value = "\t";
> > }else{
> > # important to escape any quotes to preserve them in the data.
> >   $value = str_replace('"', '""', $value);
> > # needed to encapsulate data in quotes because some data might be
> > multi line. # the good news is that numbers remain numbers in Excel 
> > even though quoted.
> >   $value = '"' . $value . '"' . "\t";
> > }
> > $line .= $value;
> >   }
> >   $data .= trim($line)."\n";
> > }
> > # this line is needed because returns embedded in the data have "\r"
> > # and this looks like a "box character" in Excel
> >   $data = str_replace("\r", "", $data);
> > 
> > 
> > # Nice to let someone know that the search came up empty.
> > # Otherwise only the column name headers will be output to Excel. if
> > ($data == "") {
> >   $data = "\nno matching records found\n";
> > }
> > 
> > # This line will stream the file to the user rather than spray it
> across
> > the screen
> > header("Content-type: application/octet-stream");
> > 
> > # replace excelfile.xls with whatever you want the filename to
default
> 
> > to
> > header("Content-Disposition: attachment; filename=customers.xls");
> > header("Pragma: no-cache");
> > header("Expires: 0");
> > 
> > echo $header."\n".$data;
> > ?>
> > 
> > 
> > --
> > 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 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] Works in Mozilla, not in IE

2004-06-28 Thread Robert Sossomon
That just made IE put it out in "data" style, Excel didn't open up.

:(

Any other thoughts?

-Original Message-
From: Frank M. Kromann [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 28, 2004 2:47 PM
To: Robert Sossomon
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Works in Mozilla, not in IE


Hi Robert,

This line

header("Content-Disposition: attachment; filename=customers.xls");

forces IE to save. If you change attachment to inline it will open the
Excel in the plug-in imbeded in the browser.

- Frank

> I have the script below from another source, and it works prefectly in

> Mozilla, however IE keeps wanting to save the PHP page and then barfs.

> Any ways to fix and make it work for both?
> 
> TIA!
> Robert
> 
> 
> 
>  //Written by Dan Zarrella. Some additional tweaks provided by JP 
> Honeywell //pear excel package has support for fonts and formulas 
> etc.. more complicated
> //this is good for quick table dumps (deliverables)
> 
> //Includes Snipped for posting
> //DB Query tweaked for usage
> $result = mysql_query("select * from customers where cust_salesmen = 
> $user_id"); $count = mysql_num_fields($result);
> 
> for ($i = 0; $i < $count; $i++){
> $header .= mysql_field_name($result, $i)."\t";
> }
> 
> while($row = mysql_fetch_row($result)){
>   $line = '';
>   foreach($row as $value){
> if(!isset($value) || $value == ""){
>   $value = "\t";
> }else{
> # important to escape any quotes to preserve them in the data.
>   $value = str_replace('"', '""', $value);
> # needed to encapsulate data in quotes because some data might be 
> multi line. # the good news is that numbers remain numbers in Excel 
> even though quoted.
>   $value = '"' . $value . '"' . "\t";
> }
> $line .= $value;
>   }
>   $data .= trim($line)."\n";
> }
> # this line is needed because returns embedded in the data have "\r"
> # and this looks like a "box character" in Excel
>   $data = str_replace("\r", "", $data);
> 
> 
> # Nice to let someone know that the search came up empty.
> # Otherwise only the column name headers will be output to Excel. if 
> ($data == "") {
>   $data = "\nno matching records found\n";
> }
> 
> # This line will stream the file to the user rather than spray it
across
> the screen
> header("Content-type: application/octet-stream");
> 
> # replace excelfile.xls with whatever you want the filename to default

> to
> header("Content-Disposition: attachment; filename=customers.xls");
> header("Pragma: no-cache");
> header("Expires: 0");
> 
> echo $header."\n".$data;
> ?>
> 
> 
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Works in Mozilla, not in IE

2004-06-28 Thread Robert Sossomon
I have the script below from another source, and it works prefectly in
Mozilla, however IE keeps wanting to save the PHP page and then barfs.
Any ways to fix and make it work for both?

TIA!
Robert



 


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



RE: [PHP] Posting Data to MySQL

2004-06-24 Thread Robert Sossomon
I actually found the perfect answer to this task in Google Answers.
First you will need to know how your database tables are set up,
secondly you need to figure out field names and such, thirdly you grab
the data from the form and dump it into an insert statement (or update
if the information was in the DB before).

If you pass me some specifics I might be able to give you a hand.

Robert

-Original Message-
From: Tom Chubb [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 24, 2004 9:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Posting Data to MySQL


I am trying to design a form that posts the data to a DB, but being new
to PHP/MySQL, it takes me ages to hand write the code and I'm sure there
must be an easier way to do it? My form has 100 fields using 20 rows and
5 columns and it's taking me ages to write the code for it. Can anyone
advise how they code large forms like that and if you know of any
software to make it easier? I've searched Google for hours and checked
loads of Database scripts on sites like Hotscripts, but can't find
anything. Thanks, Tom

-- 
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] " in data

2004-06-18 Thread Robert Sossomon
Nope, I wish it was so, but it is not to be...  It puts it into the
mySQL table as " only, which it was doing before, it is in the
extracting from there that I am having the issue.

My code for extraction:
   $item_desc = addslashes($Quote['sel_item_desc']);

The value in the HTML document:
value="10in. COMP.PLATE " CONCORDE "  4/125"

Robert

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 18, 2004 2:58 PM
To: Robert Sossomon; [EMAIL PROTECTED]
Subject: RE: [PHP] " in data


[snip]
I guess I need to figure out how to read my $_POST[data] and parse that
to put in " because that seems to work, but not sure how to make
PHP do that. [/snip]

INSERT INTO table
htmlentities($_POST['yourStuff']);

then when it comes out you should be good

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



RE: [PHP] " in data

2004-06-18 Thread Robert Sossomon
I tried the "addslashes" on the pages and in combination of using "
to bring in the data to begin with, it works somewhat, where I am
running into a problem now is the 2nd time it pulls the data out (it
adds it back in with ") I am getting the same errors.  I have tried
using the "addslashes" and when I view it IN the DB all I have are the
".

When I pull out the data again, I have a single " and it is not escaped,
though I have the addslashes working on it.

Do I need to post code or has this jarred someone's memory?

I guess I need to figure out how to read my $_POST[data] and parse that
to put in " because that seems to work, but not sure how to make
PHP do that.

Any thoughts?

Robert


-Original Message-
From: Torsten Roehr [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 18, 2004 1:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] " in data


>"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>[snip]
>I have data with "something" in it and when I pull that data and dump 
>it into an HTML form I am losing everything that is after the first " .

>Has anyone encountered this before, and have a way to patch it? [/snip]
>
>Yes, we have all encountered it. You need to escape the " character and

>other characters as well. Start here
>
>http://www.php.net/addslashes
>
>The manual is your friend

Another way is to convert the quotes to " because this is the
proper character for HTML output.

Regards, Torsten Roehr

-- 
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] " in data

2004-06-18 Thread Robert Sossomon
I have data with "something" in it and when I pull that data and dump it
into an HTML form I am losing everything that is after the first " .
Has anyone encountered this before, and have a way to patch it?

TIA

RObert

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



[PHP] OT?? -> calling frames within frames

2004-06-18 Thread Robert Sossomon
I have two frames (A and main)
When I pull up one page it reloads main with the full page, however what
I need the system to do when I click off that page is to jump to
main.html and load item.html in the top.

Main.html currently loads 2 other pages at the beginning.

I have tried to jump them in this order, but it does not seem to be
working:
//Call the main page
echo 'parent.main.location.href
="main.html";';
//Open the next two pages I need in them
echo 'parent.B.location.href
="item.html";';
echo 'parent.C.location.href
="cart.html";';

TIA!

Robert

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



RE: [PHP] Getting values?

2004-06-18 Thread Robert Sossomon
THANKS!!

Worked like a charm.

Robert

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 18, 2004 8:52 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting values?


On Friday 18 June 2004 20:38, Robert Sossomon wrote:

>  if ($_POST[comment-$i] != "")

Put double-quotes around your array subscripts.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Death to all fanatics!
*/

-- 
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] Getting values?

2004-06-18 Thread Robert Sossomon
I have a form that uses -$i in it to create multiple write boxes for
editing the information.  It then passes that information to another
script that read through and modifies the DB based on the information.

I have this code in my parsing script and I know it is BC of the way I
am accessing data, can anyone help?


 for ($i=0; $i<$num_rows; $i++) 
 { 
 if ($_POST[comment-$i] != "")
  $comment = $_POST[comment-$i];
 else
  $comment = $_POST[color-$i];

  $id = $_POST[id-$i];
  $sess = $_POST[SESSID-$i];



All the values turn up empty doing it this way, and there are about 14
values to do.

TIA

Robert

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



[PHP] Excel files with multiple sheets

2004-06-15 Thread Robert Sossomon
I have been looking but have not found yet of a way to generate an excel
file with multiple pages using a PHP page.  I was hoping someone here
might have hit on a multiple page document.  I can do a single file, but
was looking for something a little more powerful before I try to create
my own.  No sense in re-inventing the wheel...

TIA!

Robert

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



RE: [PHP] php and CSS

2004-06-14 Thread Robert Sossomon

-Original Message-
From: Bruno Santos [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 14, 2004 4:04 PM
To: Robert Sossomon
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] php and CSS


Robert Sossomon wrote:
> Bruno,
> 
> Drop some code our way, it's just a guessing game for me without it.
> 
> Robert
> 
> -Original Message-
> From: Bruno Santos [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 14, 2004 3:28 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php and CSS
> 
> 
> Hello all.
> 
> 
> 
> Im deleloping some PHP pages for school work, and now, im trying to 
> put
> the pages nice, with some colors and images, etc...
> 
> I found a problem regarding CSS and PHP
> 
> The same page, with html extension, it works fine, but when the page
> becames with php extension, the CSS just dont work..
> 
> Someone has any idea why this is happening ??
> 
> 
> Cheers
> 

Well, here is it:



Ajuda


  
';
echo '';
echo ''.$titulo.'';
echo '';
echo '';
while (!feof($fp)) {
$buffer = fgets ($fp,1024);
echo $buffer;
}
echo '';
echo '';
echo '';
}
else {
Header("Location: index.php");
}
echo '';
?>

has some coments in Portuguese, but, the essential is the first lines. 
I've always done this way, and always has work... till now... =:(

Cheers

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



RE: [PHP] php and CSS

2004-06-14 Thread Robert Sossomon
Bruno,

Drop some code our way, it's just a guessing game for me without it.

Robert

-Original Message-
From: Bruno Santos [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 14, 2004 3:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php and CSS


Hello all.



Im deleloping some PHP pages for school work, and now, im trying to put 
the pages nice, with some colors and images, etc...

I found a problem regarding CSS and PHP

The same page, with html extension, it works fine, but when the page 
becames with php extension, the CSS just dont work..

Someone has any idea why this is happening ??


Cheers

-- 
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] Load 2 Frames (possibly OT)

2004-06-14 Thread Robert Sossomon
I need to load 2 frames from within PHP, I just don't know how to do it.

I have tried header calls, I've tried echoing out the javascript
command, but I need a way to load the pages at one time.

Layout:
add
List  
see

You use list to add information, when things are added in add they call
another script to process the add.  At the end of the add is when I need
see to be loaded.

I am pretty sure it is going to have to be a javascript, but even that I
haven't found the code for yet. 

Any thoughts?

My current code is:
header("parent.C.location.href =
\"show.html\";"); 
header("parent.B.location.href =
\"custn.html\";");

Thanks,
Robert

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



RE: [PHP] Erroring out?!

2004-06-14 Thread Robert Sossomon
I took out the "or die(mysql_error())" and the script seems to continue
correctly, however as there are no results it should be loading 2
windows in different pages, but I get only a white screen and no
messages written to the error logs.  I am trying to use the header
function to javascript load 2 pages.

Any thoughts?

-Original Message-----
From: Robert Sossomon [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 14, 2004 2:44 PM
To: PHP List
Subject: [PHP] Erroring out?!


I am trying to figure out why if there is an error in my query it throws
an error message to the screen instead of parsing the rest of my script
to get the rest of the information.  I have error checking in my script
and if there is no information I want it to process and do things.

I run this:
parent.C.location.href =
\"show.html\";"); header("parent.B.location.href =
\"custn.html\";"); exit; } else { //get info $title =
mysql_result($get_query_res,0,'item_num');
$desc = mysql_result($get_query_res,0,'description');
$q = mysql_result($get_query_res,0,'qty');
$p = mysql_result($get_query_res,0,'price');
$c = mysql_result($get_query_res,0,'comments');
$tp = mysql_result($get_query_res,0,'Tprice');


$display_block = "";

}
?>




Choose from the following options to set your preferences:





And I get:
Unknown column 'robert' in 'where clause'

ThANKS!!

Robert

-- 
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] Erroring out?!

2004-06-14 Thread Robert Sossomon
I am trying to figure out why if there is an error in my query it throws
an error message to the screen instead of parsing the rest of my script
to get the rest of the information.  I have error checking in my script
and if there is no information I want it to process and do things.

I run this:
parent.C.location.href =
\"show.html\";");
header("parent.B.location.href =
\"custn.html\";");
exit;
} else {
//get info
$title = mysql_result($get_query_res,0,'item_num');
$desc = mysql_result($get_query_res,0,'description');
$q = mysql_result($get_query_res,0,'qty');
$p = mysql_result($get_query_res,0,'price');
$c = mysql_result($get_query_res,0,'comments');
$tp = mysql_result($get_query_res,0,'Tprice');


$display_block = "";

}
?>




Choose from the following options to set your preferences:





And I get:
Unknown column 'robert' in 'where clause'

ThANKS!!

Robert

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



[PHP] Load a frame and work on another?

2004-06-14 Thread Robert Sossomon
Here is a piece of my code in my PHP, I am trying to reload frame C with
updated information and reload the current page into the current frame.
Can someone tell me where I am going wrong?

if (mysql_num_rows($get_query_res) < 1){
//invalid id, send away
header("parent.C.location.href =
\"show.html\";");
header("parent.B.location.href =
\"prefs.html\";");
exit;

Thanks,
Robert

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



[PHP] Refresh a frame?

2004-06-09 Thread Robert Sossomon
I am in need of a way to reload a page within a frame as the other
frames are used to modify the information.

I have a 3-frame site now that I am using 1 frame as a list, another
frame to add the information, and the 3rd frame to show the results of
the 2nd frame.  I know how to do the location: URL for the full page,
but how do I do it for JUST a single page?

Thanks,
Robert

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



[PHP] Re: Coloured rows

2004-06-05 Thread Robert Sossomon
Yeah, you have $number which is the total number of rows, right?  so just
change the if piece to actually count...

$j = 0;
while ($i <= $number){

//first 8 rows done here
if ($j <= 8)
 {
  //print statement here
  $j++;
  $i++;
 }
//this piece does the next 8 rows
else
 {
  //other print statement here
  $j++;
  $i++;
// if you have more then 16 rows
// this next piece should make it repeat the if statement
// without having to do too much funky stuff in them
 if ($j = 16)
 {$j = 0;}
 }
}


> Hi robert, any way of making the script you sent to me, colour 8 rows in
> one colour then the next 8 rows a different colour.
>
> Mark

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



RE: [PHP] MySQL & PHP

2004-06-04 Thread Robert Sossomon
Run: rpm -q php-mysql

>From the command line as root and see if it is there, if not go out and
download the fedora rpm with that in the title, since that would be the
missing piece.

HTH,
Robert

-Original Message-
From: Nunners [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 04, 2004 8:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL & PHP


I've just installed Fedora Core 2, including I believe both PHP &
MySQL.. However whenever I try and run something that connects to MySQL,
it comes up with the following:

 

"cannot load MySQL extension,

please check PHP Configuration."

 

Does this mean anything to anyone?

 

I've checked loads of things, like MySQL is running, etc etc But without
luck..

 

Cheers

Nunners

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



Re: [PHP] select from db

2004-06-03 Thread Robert Sossomon

> table name 'Selections'
>
> (rows)  RoundGameName Winner   Points
>   data eg  1 1mark Hawthorn   4
> (if  team is a winner then 4 points added)
>
>1 2mark Geelong 0
>


Assuming you have them submit a form to get here:
";
print
"RoundGameNameWinnerPoints";

$total_points=0;
/* Iterate through to make it clean */
while ($i < $number)
{
 $item_1 = mysql_result($result, $i,"Round");
 $item_2 = mysql_result($result, $i,"Game");
 $item_3 = mysql_result($result, $i,"Name");
 $item_4 = mysql_result($result, $i,"Winner");
 $item_5 = mysql_result($result, $i,"Points");

/* This makes it print out in 2 separate color, depending on rows. */
 if ($i%2 == 0)
 {
  print "$item_1$item_2$item_3$item_4$item_5\n";
 }
 else
 {
 print "$item_1$item_2$item_3$item_4$item_5\n";
 }
/* Increase record count and total_points to date */
 $i++;
 $total_points += $item_5;
}
/* close everything up */
 print "Total Points Earned: $total_points";
 print "";
}

?>

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



Re: [PHP] Bulk table updates

2004-06-03 Thread Robert Sossomon
I use a separate page to do the addition of information to my DB
currently, the whole set of information is being re-written as I type
this, but where I am stuck is getting the whole thing to be parsed through
then just one line.

The code I currently use is as follows:




$get_Quote = "select st.id, st.sel_item_id, st.sel_item_desc,
st.sel_item_price, st.sel_item_qty, st.sel_item_comment from
store_shoppertrack as st left join items as si on si.id = st.sel_item_id
where session_id = '$PHPSESSID' order by $vsort";

$get_Quote_res = mysql_query($get_Quote) or die(mysql_error());

while ($row = MYSQL_FETCH_ROW($get_Quote_res))
$number = mysql_numrows($get_Quote_res);


if (mysql_num_rows($get_Quote_res) < 1)
 { //print message
  $display_block = "You have no items in your Quote. Please continue to shop!";
 }
else
 { //get info and build Quote display

 while ($i < $number)
  {
   $id = mysql_result($get_Quote_res,$i,'id');
   $item_title = mysql_result($get_Quote_res,$i,'sel_item_id');
   $item_desc = mysql_result($get_Quote_res,$i,'sel_item_desc');
   $item_price = mysql_result($get_Quote_res,$i,'sel_item_price');
   $item_qty = mysql_result($get_Quote_res,$i,'sel_item_qty');
   $item_comment = mysql_result($get_Quote_res,$i,'sel_item_comment');


   if ($item_title == " >>>>>")
   {
$display_block .= "Comment:\n\naquablackbluefuchsiagraygreenlimemaroonnavyolivepurpleredsilvertealwhiteyellow\nCurrently:
$item_comment\n";   }
   else
   {
$display_block .= "\n\n";
$display_block .= "$item_title\n";
$display_block .= "";
$display_block .= "\n\n\n";
$display_block .= "\n";
$display_block .= "\n\n\n";
$display_block .= "\n";

   }
   $i++;
   }





   $addtocart = "replace into store_shoppertrack
values('$_POST[id]','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]','$_POST[sel_item_price]','$_POST[sel_item_desc]','$comment',
now(),'','','','')";

   mysql_query($addtocart);





I have a test set of data and stuff set up on my server:
http://lonewolf.homelinux.net/quoter

There are some errors in not getting to other tables, but they are
irrelevant for seeing what is there.  The data in the table is of course
bogus data, but you should see what I am getting at.

Thanks,
Robert


> Use a SELECT query to get the values (SELECT * FROM table) and a table
> that has form input fields in the cells.  The values for the form fields
> would be based on the array you get from the SELECT query.  The form could
> be something like .  In the
> script, before the body, you would have an if statement to check whether
> the submit button for the form is set; if it is set, it will run an INSERT
> INTO query:
>
> if (isset ($submit)) {
> $query = "INSERT INTO . . . ";
> $query_result = @mysql_query ($query);
> }
>
> If the form is submitted, then the values in all the form fields
> (including any changes) will go into the database.  If it's not submitted,
> the current values will be displayed in the tabled-embedded form.
> Actually, I think if the form is submitted, it will redisplay with the new
> values as defaults.
>
> Hopefully this will work, or lead you in the right direction.
>
>
>
> -Original Message-
> From: Robert Sossomon <[EMAIL PROTECTED]>
> Sent: Jun 3, 2004 6:23 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Bulk table updates
>
> I am looking for a tutorial or a already created class or file that I can
> use to learn how to create a form that is populated from a database table
> that can be edited in every row and column and takes only 1 SAVE button to
> upload all the changes.
>
> Thanks,
> Robert
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Bulk table updates

2004-06-03 Thread Robert Sossomon
I am looking for a tutorial or a already created class or file that I can
use to learn how to create a form that is populated from a database table
that can be edited in every row and column and takes only 1 SAVE button to
upload all the changes.

Thanks,
Robert

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



RE: [PHP] a passion to perform ;)

2004-05-13 Thread Robert Sossomon
I still stick with the old rule:
If it takes more then 2 seconds to load anything, 5 seconds to do a
complete page with lots of images on dial-up then you have to go back to
the drawing board.  2-5 seconds has always been your window to get a
page to load and keep the visitor.  On top of that stay away from
flash/shockwave and you are ahead of the game.

My $.02

Robert

-Original Message-
From: Matthias H. Risse [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 13, 2004 11:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] a passion to perform ;)



Hi,

i just benchmarked some of my applications with PEAR::Benchmark and
would like to know if any of you have good literature regarding PHP and
performance in generall? I am not talking about precompiled scripts
(ioncube, zend, ..)

Basically I am trying to find out how good a standard HTML rendering 
PHP-Applications usually performs? Furthermore I wonder of there are any

usability papers/studies regarding this topic?

(how long is long for a user? how
long is a user on broadband usually expectin a page to load without
thinking "damn. why does this take so long?")

Maybe anyone knows of a good free performace and memory profiler?

Yours,
Matthias

-- 
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] FIXED: Max file size for uploads?

2004-05-12 Thread Robert Sossomon
It's fixed now..

If using Apache on RedHat here is everything to fix at once:

FIRST AND FOREMOST DECIDE THE MAX SIZE YOU WANT IN MB, ADD A COUPLE MORE
TO IT, AND THEN CONVERT TO BYTES (MB * 1024 * 1024)

1.  httpd/conf.d/php.conf 
LimitRequestBody  ?? #byte size you calculated

2.  /etc/php.ini
max_file_size = ???M #Max size in MB
post_max_size = ???M #Max size in MB

/etc/init.d/httpd restart

Then upload!  

HTH!!

Robert

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



RE: [PHP] Max file size for uploads?

2004-05-12 Thread Robert Sossomon
I get this error message now in my httpd error log:

[Wed May 12 10:07:01 2004] [error] [client 66.43.177.38] Requested
content-length of 69888498 is larger than the configured limit of
524288, referer: http://dinghy.homeip.net/upload.php

Any thoughts?

TIA!

Robert

-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 9:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Max file size for uploads?


Hello Robert,

Wednesday, May 12, 2004, 2:37:23 PM, you wrote:

RS> I have an upload script that I am trying to allow for 725MB, I have 
RS> written the script to handle files of that size, and I modified the 
RS> upload_max_filesize = 730M

RS> I tried uploading a 15MB file and it blew up (current error message 
RS> is not in my brain).

RS> Is there a true max size or do I just have something messed up 
RS> somewhere that I need to tweak??

POST file size is the other one.

and that's HELL of a file size.. what is it, an ISO dump site? ;)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
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] Max file size for uploads?

2004-05-12 Thread Robert Sossomon
I have an upload script that I am trying to allow for 725MB, I have
written the script to handle files of that size, and I modified the
upload_max_filesize = 730M

I tried uploading a 15MB file and it blew up (current error message is
not in my brain).

Is there a true max size or do I just have something messed up somewhere
that I need to tweak??

Thanks,
Robert

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



[PHP] What's wrong with this IF statement?

2004-04-22 Thread Robert Sossomon
My IF statement should be picking up on the numbers, and if the number
matches not be displaying out the information, however I look at the
outputted page and the information is still there, what have I got wrong
on the code?


//Show categories first
$get_cats = "select id_num, id_name, description, cat_code from
categories order by id_name";
$get_cats_res = mysql_query($get_cats) or die(mysql_error());

if (mysql_num_rows($get_cats_res) < 1)
{
 $display_block = "Sorry, no categories to browse.";
}
else
{
 while ($cats = mysql_fetch_array($get_cats_res))
 {
  $cat_id = $cats[id_num];
  if ($cat_id != "53" || $cat_id != "54" || $cat_id != "55" || $cat_id
!= "117" || $cat_id != "118" || $cat_id != "74")
  {
  $cat_title = strtoupper(stripslashes($cats[id_name]));
  $cat_desc = stripslashes($cats[description]);
  $display_block .= "$cat_title
$cat_desc\n";
  while ($items = mysql_fetch_array($get_items_res))
   {
$item_id = $items[id];
$item_num = $items[item_num];
$item_desc = stripslashes($items[description]);
if ($item_num != "ABC-R37" || $item_num !=  "ABC-R42" || $item_num
!= "HB-99100" || $item_num != "RO-PUMPS" || $item_num != "ML-HDGALJUG"
|| $item_num != "PFS-CAC21" || $item_num != "PFS-CO2")
{
$item_num = ltrim($item_num);
$item_num = rtrim($item_num);
$display_block .= "$item_num -
$item_desc\n";
} 
   }


My assumption is that BOTH IF statements are not working correctly since
the logic is that if they are built the same they would react the same.
HELP!

TIA!
Robert

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



[PHP] Include Files Solution

2004-04-22 Thread Robert Sossomon
Here's the solution I came up with that works for the site:


   $display_block .= "";


I am only using the PHP parser once instead of twice, the \n makes the
whole thing nicely readable in the HTML source files that are generated,
and the paths were modified (and the navigation templates were as well)
to give the correct paths to all the images and files concerned.

The biggest reason I had path problems was that I set the page
generation in the home directory, the generated pages in their own
directory (as well as the rest of the pieces of the online catalog quote
request form) and the navigation sits in it's own directory off the root
folder.

/
 page generation
/catalog
 pages
/nav
 templates
/images
 images
/product_images
 images

What had me perplexed was I coded the product images correctly to work
right from the beginning with the leading '/' character and so since I
did it correct at the beginning it should hold true that I coded it
correctly throughout, right?  WRONG!  I completely bungled the whole
paths and was left with a bunch of garbage.  Now I have the paths all
loaded correctly, the templates were all modified to call images and
pages with a leading '/' character, and everything is working fluidly.

Now I'm ready to call it a week and go to the beach!!!  Who's with me?!

BTW, if you want to see the output pages then feel free to click here:
http://www.pfssales.com/catalog.html and click on any of the links.

Robert

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



RE: [PHP] Adding includes to files

2004-04-22 Thread Robert Sossomon
OK, so I figured out where it was barfing.  I looked deeper into the log
files as well as the generated pages, and found that somewhere the path
to the include files had become mangled, and the reason the files
weren't showing correctly in the HTML pages in the browser was because
it couldn't find the right files.  It's on track and working all neat
and tidy now.

Thanks for the help guys! I still feel like a doofus though...  

Robert

-Original Message-
From: Richard Harb [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 22, 2004 11:46 AM
To: Robert Sossomon
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Adding includes to files


You could either include the files without assigning the contents to a
variable - but that would display those right away:
   

or you could read the contents of the file like:

   

Richard
   
Thursday, April 22, 2004, 5:12:21 PM, thus was written:
> I need to add PHP calls to include a file to each page as it is 
> generated, the only thing is I can't get the includes to come through
> correctly:

> 
>$display_block .= "";
>$display_block .= "";  End Code>

> At the end of the generation I write $display_block to a file as 
> $display_block holds all the data it accumulates through the run. How 
> do I rewrite the inlclude to work, or do I need to find another way to

> make the includes?  The includes are all template files that I used on

> the site to keep everything consistent.

> Thanks,
> Robert

-- 
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] Adding includes to files

2004-04-22 Thread Robert Sossomon
Output buffering isn't going to help, the files, when completed need to
look like:  




Categories of Items



Html content





If all I was trying to do was pull in the files I could do that without
a problem, but what I need to do is generate the whole page with the
information.

I attached the php file that does the site generation and maybe it will
shed some light on what I am trying to do as well.

TIA!!

Robert

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 22, 2004 11:33 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Adding includes to files


From: "Robert Sossomon" <[EMAIL PROTECTED]>

> I need to add PHP calls to include a file to each page as it is 
> generated, the only thing is I can't get the includes to come through
> correctly:
> 
> 
>$display_block .= "";
>$display_block .= "";  End Code>
> 
> At the end of the generation I write $display_block to a file as

You can use output buffering:

ob_start();
include("nav/top_nav.html"); 
include("nav/side_nav.html"); 
$display_block = ob_get_contents();
ob_end_clean();

---John Holmes...

-- 
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] Adding includes to files

2004-04-22 Thread Robert Sossomon
I need to add PHP calls to include a file to each page as it is
generated, the only thing is I can't get the includes to come through
correctly:


   $display_block .= "";
   $display_block .= "";


At the end of the generation I write $display_block to a file as
$display_block holds all the data it accumulates through the run.  How
do I rewrite the inlclude to work, or do I need to find another way to
make the includes?  The includes are all template files that I used on
the site to keep everything consistent.

Thanks,
Robert

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



[PHP] Remove white space?

2004-04-22 Thread Robert Sossomon
I am pulling data from a MySQL DB and I need to remove the whitespace on
the variable and turn it to lowercase.



$get_items = "select * from PFS_items";
$get_items_res = mysql_query($get_items) or die(mysql_error());
while ($items = mysql_fetch_array($get_items_res))
{
 $item_id = $items[id];
 $item_num = $items[item_num];



Overtime I need to rewrite my DB loading script to handle this for me,
but right now I need to band-aid it so that I can auto-generate pages
and get them loaded into a catalog.

Thanks!

Robert

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



Re: [PHP] creating log files out of a delete statement

2004-04-11 Thread Robert Sossomon
How are you passing the name through??  If using a form to do it then just
use the $_POST[name] or $_GET[name] in the logfile.  You have to have the
name pull in the previous page, just pass it through:



or:
 got it will try that instead..
>
> - Original Message -
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> To: "Andy B" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, April 11, 2004 8:23 PM
> Subject: Re: [PHP] creating log files out of a delete statement
>
>
>> Andy B wrote:
>>
>> > i have a section of a website that deletes records from a mysql
>> table...
>> > right now all the query is is a delete statement but i need to make a
> "log
>> > file" in this format:
>> > current time::username who executed delete:: deleted(name of
> record)::delete
>> > completed
>> > or delete failed depending on what happened... i can do all of the log
>> > except dont exactly know how to extract the "Name" field of the
>> deleted
>> > record before it actually gets dumped.. that way i can use it on the
> log...
>>
>> There's no way to extract it from the DELETE. You'll have to do a SELECT
>> with the same parameters that you're going to do the DELETE with. Grab
>> your data with the SELECT then execute the DELETE.
>>
>> --
>> ---John Holmes...
>>
>> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>>
>> php|architect: The Magazine for PHP Professionals – www.phparch.com
>>
>>
>
> --
> 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] PDF Creating

2004-03-17 Thread Robert Sossomon
I'm looking into this and getting all my ducks in a row before I get
buried here, but I'm hoping you guys might have the answers since so far
my search has been fruitless.

I have the PDF librarys from FPDF and from Potential Tech, I have not
decided which one to use yet.

If you follow this and the PHP-DB list you'll see that I have been
building an online quote system for the office for the last 6 months (on
and off) and what I need to do now is create PDF files from the quotes
that I can then send to a fax program to be faxed out to the customers.
The information will be emailed as well, but I want to create PDF files
for the fax software to use, and to save for use later (if needed).

My question is how to I know how/where the pages will break, and how can
I make the generation of the PDF files work automagically?  The first
page will always have a header set of information, and then the quote
following it, all other pages will just have the quoted items.

Thoughts?

TIA!!
Robert

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



RE: [PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Robert Sossomon
Just place



In your web page in the location where the little box is.  Word wrap
typically only happens with images though, so you may have to turn your
text into an image, in which case you could just use a javascript
commands to change the image as needed.  If you are including the text
into a table it would be something like:


some text that keeps running and running



HTH,
Robert

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



[PHP] OT -> Pocket PC/PALM Application making/syncing?

2004-02-09 Thread Robert Sossomon
I know this is way off topic, but I figured some or most have hit upon
this problem, or may very well in the future.  I have been looking for
and not really found a reference online or a hardcopy book that will
tell me how to write a PALM or winDoze pocket PC application that when I
sync it to the PC will go to the web and download data.  I am finding
that I need to learn this quickly (they say) so that I can transform a
set of pages online onto a PDA for the users that can only connect at
6AM and 6PM to the website.

Any thoughts, suggestions, topics, books??

I am assuming I will have to turn the PHP pages into a web service but I
need to learn the PDA end as well.

Thanks,
Robert

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



RE: [PHP] PHP, Excel, and tab delimited files question

2004-02-09 Thread Robert Sossomon
It may wind up being a user-learning issue.

I dump things to pipe delimited file (whether in *nix land or winDoze)
and that way the users can open it in Excel.  The ones who have to open
the files I just go to their desks the first time and show them how to
open the file, delimit it on the | and then on the "Next" screen change
the ### field to TEXT to keep it formatted correctly.  A pain in the
betuty the first time, but once they are shown they understand it.  If
they have to do work with the file they then save it local to their
machine and start hacking it in the way they want.

Only way I found to work around quotes and things, but I'm always
willing to learn new tricks.  :)

Robert

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



RE: [PHP] New lines

2004-02-03 Thread Robert Sossomon
A LOT of this is pure speculation though, which is why I sent the one I
did.  Since with it he can patch whatever data he gets from $line into
his code wherever he needs it, whether he flat file is pure text or some
HTML or if the output is going to be a drop-down list (nl2br wouldn't
work in this case, right?) or just a straight display of the stuff line
by line (nl2br in this case) but as with I have found with my own stuff,
my bosses like to change the UI halfway through, so the less code I have
to go back and fiddle with while developing is worth the extra CPU
cycles.   2 * 2G processor and 1G of ram means cpu cycles I won't
miss...

Robert

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



RE: [PHP] New lines

2004-02-03 Thread Robert Sossomon
There was a wong answer and then there is the right answer:

$fp = fopen($file,"r");
  while (!feof($fp))
   {
$line = fgets($fp, 4096); //gets one line at a time
echo $line; // Or whatever else you want to do
   }
  fclose($fp);


HTH.
Robert

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



RE: [PHP] Logging on to a web based application

2004-01-30 Thread Robert Sossomon
Yuck!!

I personally turned off flash in all of my browsers and cut it out of
the systems in the office.  It's a resource hog, it's a pain in the
buttocks on a page, and now sites are using it for ads.  So on top of
having most registered ad servers blocked via hosts file I run pop-up
killers on everyone's PC with a new copy of my own database to keep it
up to date.

Yuck on using flash!!!

I think I sent a better way, but that is my opinion.  I can't see where
it is going to go wrong with using the PHP session to associate it with
the current user/PC.  Sure, 12 users might be trying to use the
application, but by the same token, it gives the user access to the
application multiple times in a day.  I track users on our intranet
using just webalizer and the httpd access log.  I go in and out and have
it NOT show my logins with the rest of the users, since I am in the site
about 12 times in a day.  So far I have not had a single issue with
folks and the session script.

Robert

-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 30, 2004 9:46 PM
To: Shaun; [EMAIL PROTECTED]
Subject: Re: [PHP] Logging on to a web based application


At 06:38 PM 1/30/2004 +, Shaun wrote:
>Hi,
>
>We are trying to develop a web based system where users a charged per 
>office. I would be grateful to hear anyone's experience in creating 
>such applications and how the users are managed. Our main concern is 
>how we stop a client paying for one office use and distributing their 
>password to other offices...
>
>Many thanks

Send Bruno 'round to break their knees!

The PC is not an inherently secure device, so anything is a kludge. At 
present, for a paid newsletter, accessible only via the Internet,  we do

two things:

1. Limit logins - they get 10/wk.
2. Use Flash to run the login / display the news, with PHP backend 
authenticating and fetching/returning the news stories as an XML feed to

the .swf.

This is all integrated in Flash to solve the problem of users forwarding

the newsletter to their "friends". If someone goes to the browser cache
and 
forwards the .swf, so what - the first thing the recipient sees when 
running it is a login screen. If the username/password gets passed
around, 
the allowed logins get used up v. quickly, so the damage is limited.

The check_key generated by the authentication script is stored by Flash
in 
a .sol file, so after initial authentication the login is automatic. 
Subscribers like that, and of course there is the minority who don't 
realize that  each time they open the news link they are using up a
login. 

Printing is handled somewhat obtusely. First of all a subscriber has to 
have permission to print, and popups from our site enabled. Flash calls
a 
JavaScript function which pops open a new browser window, which uses the

already established authentication to create a session and call the 
printing script. This window immediately then itself as its own parent
and 
closes.

The child called by this window is chromeless, has all text selection 
features etc. turned off, uses JavaScript to call the print dialog on
load, 
and offers only a "Close" button to the user. That is if there is a
valid 
session, otherwise it displays normally and suggests there may be a
problem 
with the subscription and the user should contact the office.

We have to go through these weird hoops for printing because printing
from 
Flash is a horrible experience, unless it's been improved in MX 2004. 
Judging by the threads on Flashcoders I'd say it hasn't. Because this is
a 
newsletter, and varies in length from day to day the flexibility of
browser 
output works better; we'd go nuts trying to fill and combine the right 
number of pages in Flash.

Before that, we had a convoluted system that everyone hated - it really 
tied the user down, and one staff person had to spend about 32~3 hr per
day 
resetting subscribers settings. Here's how it worked.

User logged in, a check_key was generated and sent to user's browser 
(cookie).  The check_key value and a logged_in flag set to true were
stored 
in the database along with the users other information.

The slick part was that once the user had gone through the process, on
one 
browser on one computer, when they went to the site again they did not
have 
to log in - they were automatically validated and the .pdf (newsletter)
was 
automatically downloaded.

The down side was that it would only work with one browser on one
machine. 
If a subscriber tried to log in from another machine the combination of 
logged_in = true, and a check_key resulted in a warning message to the 
effect that either the data could not be found or that there was
successful 
use of the site registered to another computer/browser combination.

The worst offenders for passing around the newsletter were lawyers. Over

the past year we've also  turned off the print function for most of
them.

We also looked at Adobe's PDF Merchant (or whatever it's ca

RE: [PHP] Logging on to a web based application

2004-01-30 Thread Robert Sossomon
I use a DB table to manage my users, I do not have to worry about
locking it down to one user, however one thought is to track the user
into a temporary DB, if the user name is there and the sessionID does
NOT match the one in the DB, then the user is not granted permission to
access the programs.  If they have logged out, then the logout page will
go in and delete the user from the DB field.  As each page is loaded it
checks the DB against the user's cached data.  If there is an issue, the
DB is treated as correct and the user is dropped.  Once that happens a
few times to someone logged into a "critical" app and they lose data (it
should check the data before storing information) then that will
essentially for the users to have their own user/pw combo.

HTH,
Robert

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



RE: [PHP] Re: how to open a webpage

2004-01-12 Thread Robert Sossomon
Output this to a new file each time and then use a blind page refresh
via 

$output = "

function openpopup(){
var popurl=\"$launch\"
winpops=window.open(popurl,\"\",\"width=400,height=338,toolbar,location,
directories,status,scrollbars,menubar,resizable,\")
}
openpopup()

";

if($file=fopen($pop.htm, "w")) {  //open file for writing
fwrite($file, $output);  //write to file
}

And then do this:

Header("Location:pop.htm");


HTH!
Robert

~~~
The marvels of modern technology include the 5¢ soda can which when
discarded will last for ever and a $35,000 car which when meticulously
cared for will rust out in 2 - 3 years. 
~~~

-Original Message-
From: bernard [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 12, 2004 11:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: how to open a webpage


Hi,

Thanks for the suggestions !

Problem is solved sofar.

But how can I open the link in a new window, I tried (with my limited
php
knowlegde) a lot of things, but i'ts not working :-(

Bernard



"Bernard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I am new to php and doing reasonable well (ok, copying other code and 
> learning ;-)
>
> I have a field with an URL
> The value of this in a variable $launch.
>
> How can I open this URL automatically ??
>
> TIA!!
> Bernard
> Antwerp, Belgium

-- 
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] Authentication

2003-12-16 Thread Robert Sossomon
Duh, OK, Now I REALLY feel stupid.  With the current setup using the
.htaccess files and everything I have in place all I needed to do was
get the information from: $_SERVER['PHP_AUTH_USER'] and
$_SERVER['PHP_AUTH_PW']. I kept thinking I had to use PHP to set those
values.  Thanks guys!!  Works like a charm now!

Robert
(still learning PHP)..  :)
~~~
Creditors have better memories than debtors. 
~~~

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



RE: [PHP] Authentication

2003-12-16 Thread Robert Sossomon
I am not trying to authenticate off of a database though.  I have
scripts that automatically modify the .htaccess file as I change a user,
so I need to authenticate off the .htaccess file and store the users
information into a cookie.  I think from the cookie I can do everything
else, just not sure how to get the information from the browser to show
me the user of the page.

~~~
"I am a quick leaner, dependable, and motivated."

-Real live resume statement 
~~~

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 16, 2003 11:53 AM
To: Robert Sossomon; [EMAIL PROTECTED]
Subject: Re: [PHP] Authentication


--- Robert Sossomon <[EMAIL PROTECTED]> wrote:
> I currently use a .htaccess file for users to login, and now I need to

> make some changes to how the site works.
> 
> I need to be able to have the users login, and once that is done the 
> login needs to be used to pass through the database.

Search PEAR (http://pear.php.net/), because I'm pretty sure there are
aome authentication classes that let you use a database to store the
access credentials.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



[PHP] Authentication

2003-12-16 Thread Robert Sossomon
I currently use a .htaccess file for users to login, and now I need to
make some changes to how the site works.

I need to be able to have the users login, and once that is done the
login needs to be used to pass through the database.  And to pull files
from a directory as nobody seems to listen when I tell them no emailing
files over 1.5 MB in size and so files the users need are not able to be
downloaded or used.

Code samples would be great, or links to pages or both...

I am looking at something like:

1. User logs in
2. Main page shows: $name click here for your files
3. clicking link provides /$name/files directory listing (how do I do
this in PHP??)
4. When going to a quote system -> $name is passed through the database
to get the list of customers for them.

TIA!

Robert 

~~~
A Diplomat is some one who can tell you to go to hell and make you feel
happy to be on your way.


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



RE: [PHP] DB / Tables Question

2003-12-04 Thread Robert Sossomon
Personally, as a design practice I would make the 2 tables in their own
separate database.  This would allow it to port anywhere, even a new
server you bring online and shift everything to.  I have been working on
a catalog/quote system for our salesmen to use and have given it to a
sister corporation and the only things I have had to change within the
system was the DB access and passwords, as well as the company
information.  This allows for a quick and dirty database build and is
independent on the server hosting it.

My $.02

Robert

~~~
A sucking chest wound is nature's way of telling you to slow down.

-Another Murphy's Law (of combat) 
~~~

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



[PHP] Sessions, ending and starting new with just a click

2003-12-03 Thread Robert Sossomon
Hey guys and gals,

I am working on a shopping cart and using some code to write it from 2
temp databases to a full end databases (which will then be used via PERL
to send to an archaic order system) but right now I need to come up with
a way to clear their current session ID after finalizing the order and
then dropping them into the new session variable so they can start a new
order.  

I currently have:



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



[PHP] RE: [PHP-DB] keyword searching

2003-11-12 Thread Robert Sossomon
Explode the kewords list.  I have mine explode the keyword and search
the description field.  It CAN limit it by category AND/OR by Vendor.
But this will do the trick without the limiters.

$keyword = $_POST[keyword];
$keywords = explode(" ", $keyword);
// so you can search for each word they enter
if ($category == "") {
$category = '%';
}

if ($vendor == "") {
$vendor = '%';
}
$query = "select * from DATABASE where vendor like '$vendor' AND
cat_code like '$category'";
// set up the part of the query that will always be the same
if (!$keywords) {
$keywords = '%';
//in case they don't enter any text
} else {
for ($i = 0; $i < count($keywords); $i++) {
$query .= " AND description like '%$keywords[$i]%'";
//modify the query to search for each word they enter
}
}
$query .= " order by item_num asc";
// to sort alphabetically
$result = mysql_query($query);

/* Determine the number of records returned */
while ($row = MYSQL_FETCH_ROW($result))
$number = mysql_numrows($result);

if (!$number)
{
print("There are no results that match your query");
}
else
{
/* Print the relevant information */
$i = 0;
 
print  "";

while ($i < $number)
{
$item_id = mysql_result($result, $i,"id");
$item_name = mysql_result($result, $i,"item_num");
$item_desc = mysql_result($result, $i,"description");

if ($i%2 == 0)
{
print "What do you want done with the data\n";
}
else
{
print "What do you want done with the data\n";
}
$i++;
}
print "";
}

/* Close the database connection */
MYSQL_CLOSE();
?>




~~~
Love and you will be loved, and you will be able to do all that you
could not do unloved.

-Marques de Santillana. 
~~~

-Original Message-
From: Adam Williams [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 12, 2003 12:50 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP-DB] keyword searching


Hello,

I am selecting a field in a database called description for keyword 
searching.  The field contains names of people, states, years, etc.
When 
someone searches for say "holmes north carolina" the query searches for 
exactly that, fields which have "holmes north carolina", and not fields 
that contaim holmes, north, and carolina.  So I run a str_replace to 
replace all spaces with *, which turns it into "holmes*north*carolina", 
but say that north carolina is before holmes in the field, it won't
return 
those fields (it only returns fields in which holmes is infront of north

carolina).  So how can I have it return all fields which contain all 
the words holmes, north, and carolina in any order, in that field?

-- 
PHP Database 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] Changing case

2003-11-12 Thread Robert Sossomon
I have a form that allows for an item to be entered, the other pieces
have been fixed so far that were bogging me down, but now I am looking
for a way to convert any entry in the form to be UPPER case so that when
the quote is listed, they are alphabetical.  

The problem is if someone enters aa-1234 and the other items in the
quote are FF-2345 and QQ-3456 then the aa-1234 is UNDER them, instead of
on top.

/
//
//   Store.php
//
/
/*
  The following code allows for the addition of a non-stock item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= "Input a new item: Item ID:Description:Quantity: ";
$display_block .= "01";
for ($i=2; $i < 301; $i++){
 $display_block .= "$i";
}
$display_block .= "Price:";


/
//
//  addspec.php
//
/
if ($_POST[sel_item_qty] != "0")
{
 if($_POST[sel_item_id] != "")
 {   
   //add info to cart table
   $addtocart = "insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$_POST[sel_item_desc]', now())";
  
   mysql_query($addtocart);
  
   //redirect to showcart page
   header("Location:$_POST[url]");
   exit;
 } else {
  //send them somewhere else
  header("Location:ohcrud.php");
  exit;
 }
} else {
  //print message
  $display_block .= "You must select a Quantity. Please continue to shop!";
 } 


TIA!!

Robert

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



RE: [PHP] Re: Adding a log file

2003-11-05 Thread Robert Sossomon
Like I said, syntactically bogus, I was trying to write it out fast
while I was away from the actual scripts...  Like I said, for the MOST
part the pieces are working, however on some items it is acting
correctly yet the items are not showing up in the shopping cart or in
the database anywhere.

Here's the script pieces.
//addtocart.php
   $addtocart = "insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$item_desc', now())";
  
   mysql_query($addtocart);
  
   //redirect to showcart page
   header("Location: showcart.php");

//Additem.php
   $addtocart = "insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_name]','$_POST[sel_item_qty]
','$_POST[sel_item_price]','$item_desc', now())";
  
   mysql_query($addtocart);

//Addspec.php
   //add info to cart table
   $addtocart = "insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$_POST[sel_item_desc]', now())";
  
   mysql_query($addtocart);

//Seestore.php
/*
  The following code allows for the addition of a non-stock item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= "Input a new item: Item ID:Description:Quantity: ";
$display_block .= "01";
for ($i=2; $i < 301; $i++){
 $display_block .= "$i";
}
$display_block .= "Price:";

$display_block .= "";

/*
  The following code allows for the addition of a stocked item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= "Input item: ";
$display_block .= "Item ID:Quantity: ";
$display_block .= "01";
for ($i=2; $i < 301; $i++){
 $display_block .= "$i";
}
$display_block .= "";
$display_block .= "";
$display_block .= "Price:";
$display_block .= "";
$display_block .= "";

//categories.php
$display_block .= "$item_name<
/strong> - $item_desc";
$display_block .= "01";
for ($i=2; $i < 301; $i++){
 $display_block .= "$i";
}
$display_block .= "
~~~
A bachelor can only chase a girl until she catches him.


-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:00 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Re: Adding a log file


$Addcart() -- is Addcart() a function (in which case you should remove 
the dollar sign) or are you specifically trying to do some magic there 
by running a function whose name is stored in that variable?

Bogdan

Robert Sossomon wrote:

> I am seeing some errors with a program I wrote and I need to write 
> everything to a log file that the program is doing.
> 
> The following syntax I KNOW is wrong, but not sure they are important 
> to put here correctly yet. //script addtocart $Addcart (info1, info2)
> Mysqlquey($addcart)
> 
> I am seeing random items NOT being added to my shopping cart.  The 
> reason, I have no clue. I can pull another catgory of items and the 
> first 20 will do fine, I go back to the first category I have and the 
> script seems to work correctly but the data is not written to the 
> shopping cart.  Problem with the shopping cart???  I wouldn't think 
> so. Problem with the add page, I don't see how.  So where is the error

> coming from?  No clue, which is why I want to log everything.  I use 3

> different add pages so that each form uses a different way to add.
> This works for me, and seems to work rather well.  But I need to log 
> everything on the 3 forms to see where the errors are coming from.
> 
> TIA!
> 
> Robert ~~~
> To rest is to rust. 
> ~~~

-- 
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] Adding a log file

2003-11-05 Thread Robert Sossomon
I am seeing some errors with a program I wrote and I need to write
everything to a log file that the program is doing.

The following syntax I KNOW is wrong, but not sure they are important to
put here correctly yet.
//script addtocart
$Addcart (info1, info2)
Mysqlquey($addcart)

I am seeing random items NOT being added to my shopping cart.  The
reason, I have no clue. I can pull another catgory of items and the
first 20 will do fine, I go back to the first category I have and the
script seems to work correctly but the data is not written to the
shopping cart.  Problem with the shopping cart???  I wouldn't think so.
Problem with the add page, I don't see how.  So where is the error
coming from?  No clue, which is why I want to log everything.  I use 3
different add pages so that each form uses a different way to add.  This
works for me, and seems to work rather well.  But I need to log
everything on the 3 forms to see where the errors are coming from.

TIA!

Robert
~~~
To rest is to rust. 
~~~

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



  1   2   >