Re: [PHP] when is a PDF not a PDF?

2004-03-06 Thread Jeff Harris
On Mar 6, 2004, Rick Fleischer claimed that:

|The simple example from http://www.php.net/pdf (hard-wired to paper.pdf)
|just displayed the pdf data as a dump.  I can ftp the file and it's OK.  My
|hard-wired version is shown below.
|
|?php
|$len = filesize(paper.pdf);
|header(Content-type: application/pdf);
|header(Content-Length: $len);
|header(Content-Disposition: inline; filename=paper.pdf);
|readfile(paper.pdf);
|?
|
|// Thanks,
|// Rick

IF you're using IE, this might help you:
http://marc.theaimsgroup.com/?l=php-generalm=106001984503131w=2

HTH
Jeff
-- 
Registered Linux user #304026.   |  52FC 20BD 025A 8C13 5FC6
gpg key: B0890FED|  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.
[http://www.faqs.org/rfcs/rfc1855.html]

A: Because it messes up the conversation.
Q: Why is top posting bad?
A: Top posting.
Q: What's the most annoying thing on mailing lists?

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



Re: [PHP] Weird result from query...?

2004-02-27 Thread Jeff Harris
|Ryan A wrote:
|
| Hey everyone,
| Thanks for your response,
|
| I did try the query without the single quote, with double quotes but didnt
| work.
| I do think that a dot is valid in the URL coz it seems to be working if
| there are 2 zeros in the
| decimal part. I even tried running the SQL in PHPMyAdmin with same
| results...
| and I did try this:
|
| total='.$p.';
|
| I wonder if total is a mysql reserved word or something
|
| Like I said before, i took that out and everythings running fine 'n
| dandy...but am just curious as
| to what was wrong...never know if it may come up again in future.
|
| Cheers,
| -Ryan
|
|
|

Sounds to me like your variable is being passed/interpreted as a string.
As such, 4 will never equal 4.00. 2.1 will never equal 2.10. You should
probably look at the printf() or sprintf() function to make sure that your
$p will be inserted into your query string as you expect it.

I'm not up on sprintf() format, but you would probably want something like
?php $sql_p = sprintf(%1.2f, $p); ?
then use $sql_p in your sql querystring.

HTH

Jeff

-- 
Registered Linux user #304026.   |  52FC 20BD 025A 8C13 5FC6
gpg key: B0890FED|  68C6 9CF9 46C2 B089 0FED
http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0xB0890FED
Responses to this message should conform to RFC 1855.

A: Because it messes up the conversation.
Q: Why is top posting bad?
A: Top posting.
Q: What's the most annoying thing on mailing lists?

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



Re: [PHP] How to display?

2003-08-12 Thread Jeff Harris
On Aug 9, 2003, Ryan A claimed that:

|Hi,
|I am running a pretty simple statement (thanks to ben from the list) that i
|have already checked via phpmyadmin, but i dont know how to display it
|
|eg:
|
|$tt = SELECT  COUNT(*), 'Count1' FROM shared WHERE user ='.$my_user.' and
|cno=.$mmy_cno. UNION
|SELECT COUNT(*), 'Count2' FROM dedicated where user='.$my_user.' and
|cno=.$mmy_cno. UNION
|SELECT  COUNT(*), 'Count3' FROM reseller WHERE user ='.$my_user.' and
|cno=.$mmy_cno. UNION
| SELECT COUNT(*), 'Count4' FROM colocated WHERE user ='.$my_user.' and
|cno=.$mmy_cno. UNION
| SELECT COUNT(*), 'Count5' FROM freehosting WHERE user ='.$my_user.' and
|cno=.$mmy_cno;
|
|what am i doing wrong?
|
|Kindly reply,
|-Ryan

First, you aren't reading the manual, which has some examples. The
referred page also has See also: with some good references.
http://www.php.net/mysql_query

Second, you haven't [apparently] bothered to search the web for any
php/mysql tutorials. Search some good tutorial sites and they will give
you some good examples of printing and of php/mysql in general.

Have fun learing
Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] grabbing variable from bottom to top

2003-08-04 Thread Jeff Harris
On Aug 3, 2003, Micah Montoy claimed that:

|Anyone know of a way to use a variable that isn't defined until further down
|the script at the top.  I have a counter and once everything runs through
|the script, the count is complete, I need to display this at the top above
|the displayed results.  I thought about and tried a function but I still run
|into the same problem.
|
|thanks

You could use some dHTML. At the top of the page, you would print
something like
p ID=CountingIDCalculating count./p
Then, after the computing,
SCRIPT LANGUAGE=JavaScript
document.all(MyID1).innerText = 'Total Count: $count.';
/SCRIPT

This code is probably very browser dependant, so YMMV.
Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] tags to lowercase

2003-07-31 Thread Jeff Harris
|
|On Wednesday, July 30, 2003, at 02:53  PM, Jeff Harris wrote:
|
| On Jul 30, 2003, Curt Zirzow claimed that:
|
| |* Thus wrote Justin French ([EMAIL PROTECTED]):
| | Hi all,
| |
| |hello.
| |
| |
| | has anyone developed or know of a function to convert all tags to
| | lowercase, but still preserves the contents of the tags and the
| content
| | of the attributes of the tags?
| |
[snip]
On Jul 31, 2003, Justin French claimed that:

|Sounds great, although I doubt my host will install... has anyone
|considered such a beast running as a PHP function/class?
|
|Justin
|
If you have enough space, you could download the tidy binary yourself and
stick it in ~/bin/tidy. It's about 155Kb. Then, you can do whatever you
want with it.

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




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



Re: [PHP] PHP or CGI in C/C++

2003-07-31 Thread Jeff Harris
On Jul 31, 2003, David Nicholson claimed that:

|Hello,
|
|This is a reply to an e-mail that you wrote on Thu, 31 Jul 2003 at
|13:38, lines prefixed by '' were originally written by you.
| Greetinx,
| I'm a newbie and wondering which PHP script or CGI in C/C++
|generally
| can
| run/respond faster via http from the same server doing the same
|tasks.
| I appreciate your comments in advance.
|
|I would expect compiled C/C++ to be faster as there is no need for
|the code to be interperated and compiled on each request.  You will
|need to do your own benchmarking to see if the difference bothers you
|though.
|David.
|--

Usually, though, the speed difference you pick up or lose from one
instruction set is miniscule compared to the time it takes for the html to
speed across the Internet. Asking about speed of a script on one language
against another is a moot point. If you ask is it faster to save a cookie
on the user's machine or save it in a database, you'd get an answer that
would probably help you design a faster site.

If you have a site getting enough hits per second to actually make a
difference, then there are some other speed considerations before getting
to the output. In this case, you'd have to ask yourself if the speed
picked up on the output is worth the time difference in the development
cycle.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Re: include help please

2003-07-31 Thread Jeff Harris
On Aug 1, 2003, LoonySalmon claimed that:

|and btw, this is my code now:
|
|?php
|require 'files.inc.php';
|
|if (isset($page)) {
|include $$_GET['page'];
|} else {
|$page = $main;
|include $page;
|}
|?
-- 

Is $main being set inside a function?
http://www.php.net/language.variables.scope
Also, for future compatability, you should probably change the 3rd line to
if (isset($_GET['page'])) { That will also help incase files.inc.php is
inadvertently setting varables incorrectly.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Cookies on WinXP

2003-07-31 Thread Jeff Harris
On Jul 31, 2003, Steve Buehler claimed that:

|I still can't figure something out.  I am using WinXP/Apache 1.3.24/PHP
|4.2.3 on my laptop and my cookies still don't work like they
|should.  Hopefully someone can explain to me why.
|?
|$cookhost=$_SERVER[HTTP_HOST];
|header(Set-Cookie: aa_host=$cookhost;);
|setcookie (aa_host, $cookhost,0,/,$cookhost);
|setcookie (aa_host, localhost,0,/,localhost);
|setcookie ('aa_host', 'localhost',0,'/','localhost');
|?
|
|I can set the cookie with the header line with no problem, but either one
|of the setcookie lines will not set the cookie.  Has anybody seen
|this?  Does anybody know why this might be happening?  BTW, no, I do not
|try to set all of these at once.  Just showing the lines that I use.  The
|header line and the first two setcookie lines work just fine on a
|RedHat 7.3/Apache 1.3.27/PHP 4.2.2 machine.
|
|Thanks
|Steve

1st, what is the difference between what you are expecting and what you
are getting?

2nd, you do realize that since you're setting the cookies to have an
expiration of 0, that will delete the cookies when the brower is closed.

3rd, you know that you can't pick up the cookies in the same page where
they are set.

try letting some defaults persist to track downm errors:
setcookie (aa_host, $cookhost,time()+3600);

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Strip Numbers

2003-07-30 Thread Jeff Harris
On Jul 30, 2003, Joe Harman claimed that:

|Hey could someone help me out here
|
|I need to strip numbers from a passed variable
|
|ex. 3899007
|
|all the numbers will have 990 (so that is the 4th, 5th  sixth
|numbers... from the right...) I want to keep everything to the left of
|the two 9s... is there an easy way to do that
|
|Joe Harman
|
|http://www.HarmanMedia.com
|
Since a problem should be stated in its basic and simplest terms, it
appears that you want to simply divide the
number by 1 and take the integer portion:
$number=floor($passed/1);

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Re: debuging and getting mor information about failures

2003-07-30 Thread Jeff Harris
On Jul 30, 2003, Ivo Fokkema claimed that:

|Chrstian Brensteiner [EMAIL PROTECTED] wrote in message
|news:[EMAIL PROTECTED]
| whats the best option to get more information about a failure in your
|sorce
| code ?
|
| whenever i get failures that are situated at the very end of my script how
| do i get to know wherer they start?
|
| now i have get from apache + php  this return
|
| Parse error: parse error, unexpected $ in
| c:\programme\easyphp\www\cms\procede_presse.php on line 268
|
| 268 is the last line of my script how to deal with those failures in an
| intelligent way?
|Getting these errors at the last line in your script generally means that
|you omitted a closing '}'.
|
|So when you would do :
|
|?php
|function something () {
|  print (done);
|?
|
|You will get a similar error. Check all of your functions and
|if/else/foreach/ etc. structures for an omitted '}' to fix your script.\
|
|Good luck!
|
|--
|Ivo Fokkema

Proper indenting should help you solve this issue. Check other threads or
the pear manual for ideas. As annoying as this error is, it is not so
nearly difficult to fix as the you're missing something and php is only
going to output a blank page with no error information error that I get
way too often.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Querying a form

2003-07-30 Thread Jeff Harris
On Jul 30, 2003, Gerard Samuel claimed that:

|Im looking for links to tutorials, or if someone can post code here,
|where php
|can be used to query a form, so that I can retrieve its results.
|Thanks for any pointers...

How about some of these?
http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=php+form+tutorial
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Simple date question

2003-07-30 Thread Jeff Harris
On Jul 30, 2003, Roy W claimed that:

|If I have:
|
|$firstdate = 2003-06-28;
|
|then how can I get $firstdate plus 4 days?
|
|Thanks!

It looks like that date may have come from a [mysql] database. If that's
the case, you should be able to add 4 days in your query, by using
DATE_ADD()
check http://www.mysql.com/doc/en/Date_and_time_functions.html

Jeff
-- Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] tags to lowercase

2003-07-29 Thread Jeff Harris
On Jul 30, 2003, Curt Zirzow claimed that:

|* Thus wrote Justin French ([EMAIL PROTECTED]):
| Hi all,
|
|hello.
|
|
| has anyone developed or know of a function to convert all tags to
| lowercase, but still preserves the contents of the tags and the content
| of the attributes of the tags?
|
|nice little tool:
|http://tidy.sourceforge.net/
|
|Some one built a function that uses that tool to filter, you'll
|have to search the archives, cause I dont know of it off hand.
|
|
|Curt


I use tidy built into my scripts. In your tidy config file you can set
covert to lower case, indent, output XHTML or whatever. Curt refers to
phpTidyHt which basically does the same thing but with a function call.
Most pages come out crisp and clean. The others are inherently wacked and
need fixing anyway.

?php
ob_start();
// process stuff
print(/body/html);
$str = addslashes(ob_get_contents());
$fp = popen(echo \ . $str .
  \ | /path/to/tidy -config /path/tidy/config, r);
$newstr = ;
do {
$data = fread($fp, 99);
if (strlen($data) == 0) {
break;
}
$newstr .= $data;
}
while(true);
pclose($fp);
ob_end_clean();
$modtime = filemtime($_SERVER['PATH_TRANSLATED']);
$gmt_modtime = gmdate('D, d M Y H:i:s', $modtime). ' GMT';
header(Last-Modified:  . $gmt_modtime);
header(Content-length:  . strlen(stripslashes($newstr ) ) );
echo stripslashes($newstr);
?

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Re: Set Cookie in PHP and call with Perl

2003-07-28 Thread Jeff Harris
On Jul 28, 2003, Jason Wong claimed that:

|On Monday 28 July 2003 13:52, TWSC HQ wrote:
|
| Sorry - by caling I meant to echo the cookie value on a .pl page - and
| include it (the cookie value)then in an email.
|
| Any help would be appreciated because the PERL list people said I must try
| a PHP list -
|
|A cookie is a cookie regardless of what mechanism was used to set/create it.
|
|Just ask on the perl list how to read a cookie (no need to mention php).

Or, you could do a web search and find
http://perl.about.com/library/nosearch/P031400.htm

A perl list would be better for all your perl needs, but I think you'll
find the PHP people, in general, when you don't repeat your original post
every day, and you follow the suggestions, and post relevant portions of
your code, and wrap your messages correctly, and don't ask a question that
was just asked by someone else, and don't send UCE, and aren't a troll, to
more helpful.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] replacing but not special chars

2003-07-28 Thread Jeff Harris
On Jul 28, 2003, Ford, Mike   [LSS] claimed that:

| -Original Message-
| From: Shawn McKenzie [mailto:[EMAIL PROTECTED]
| Sent: 27 July 2003 08:36
|
| I have some URLs in hrefs that have an .  This does not
| validate HTM4.01
| transitional, so I want to replace them with amp;
|
| So I buffer the output and do a replace, but suppose there is
| already an
| amp; then I get amp;amp; or if I have anything else like
| quot; then I get
| amp;quot;
|
|Why can't you just put amp; in the href string?  Seems like the simplest
|way to me.
|
|Cheers!
|
|Mike
|-
|Mike Ford,  Electronic Information Services Adviser,

Thus sayeth the manual,
Note: Be careful about variables that may match HTML entities. Things
like amp, copy and pound are parsed by the browser and the actual
entity is used instead of the desired variable name. This is an obvious
hassle that the W3C has been telling people about for years. The reference
is here: http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2 PHP
supports changing the argument separator to the W3C-suggested semi-colon
through the arg_separator .ini directive. Unfortunately most user agents
do not send form data in this semi-colon separated format. A more portable
way around this is to use amp; instead of  as the separator. You don't
need to change PHP's arg_separator for this. Leave it as , but simply
encode your URLs using htmlentities()(urlencode($data)). Example 2.
urlencode() and htmlentities() example

echo 'a href=mycgi?foo=', htmlentities(urlencode($userinput)), '';

This is the word of PHP.

Therefor, if _you_ are constructing the query strings, you can change your
arg_separator (arg_separator.output, PHP_INI_ALL; arg_separator.input,
PHP_INI_SYSTEM|PHP_INI_PERDIR) setting and in code, then you should be
able to use amp; OR, change your  to something else, like ; before you
send it, then change it back when you $_GET it.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] List Problems

2003-07-28 Thread Jeff Harris
On Jul 28, 2003, skate claimed that:

|
|
| Any body else getting a message back with subject like:
|  [ERR] Re: [PHP] subject of message.
|
|
|yeah, i'm getting that every now and then. maybe 1 or 2 a day tho...

[Regression mode] Not to start the discussion all over again, but if the
responses bounced back to the list management software...[/Regression
mode]

Doing a search of [this] particular individual ([EMAIL PROTECTED]) reveals
that [s]he has been kicked off of two other lists for spamming. I'll bet
it's not even a real address anymore.

I'm also getting bounce backs from [EMAIL PROTECTED]

Jeff
-- Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.





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



Re: [PHP] Script Execution Time

2003-07-28 Thread Jeff Harris
On Jul 29, 2003, Petya A Shushpanov claimed that:

|?
|class  jTimer  {
|[snip]
|
|$timer-stop();
|echo round($timer-elapsed(),5);
|?
|
|--
|Petya A Shushpanov
|

Or, you could use http://pear.php.net/package-info.php?package=Benchmark
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




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



Re: [PHP] just looking for some opinions...

2003-07-24 Thread Jeff Harris
On Jul 24, 2003, Dan Joseph claimed that:

|Hi,
|
|   Just looking for an opinion on how you would do this...
|
|   Let's say I have a number: 1281924
|
|   The rules call for removing 1280+, meaning remove 128 and all 0's that
|come after it, until you run into another number.
|
|   In the end, it would leave 1924, and everything else on the beginning would
|be gone.
|
|   How would you setup your logic for this?
|
|-Dan Joseph

If you know that all numbers are the same number of digits, I'd just do
$newNumber = oldNumber - 128;

Otherwise, as the released enlisted man I am, I'd just follow the Captain.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Include Problems

2003-07-24 Thread Jeff Harris
On Jul 24, 2003, Eric Fleming claimed that:

|I am having some problems using variables in included files.  Can someone
|please look at my code below and see how I might accomplish what I am trying
|to do?
[snip]
|Now, when I try to reference the subnav variable in the inHeader.php or
|incFooter.php files, it comes up blank.  I am basically trying to adjust the
|navigation on each page depending on the page I am on.  I am just learning
|PHP, have programmed in ColdFusion for years and in ColdFusion this was not
|a problem.  Any ideas?
|
|Eric Fleming
|

http://www.php.net/language.variables.scope
Jeff Harris
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] PHP webpage like MySQL, PART 2

2003-07-24 Thread Jeff Harris
On Jul 24, 2003, Matt Hedges claimed that:

|Many hanks for ya'lls help earlier.
|
|I've figured out how to pull the data and edit it:
|http://www.hedges.org/aoii/olemiss/updatesister.php
|
|However, for some reason I can't get it to edit whatever row.  In the code
|(pasted below) I have to specificy $id=row to edit...
|
|I can't figure out how to make it to where the user can select the field
|(which is the id/row) and edit it.  I've tried putting a ?id=# at the end of
|the url, but that doesn't work...  Any thoughts?  So what I want is where it
|says
|
|$id=1
|
|to have it someway where that is a variable that the user can define...

[some code snipped]
|  else
|  {
|$query = SELECT * FROM table WHERE id='$id';
|$result = mysql_query($query)
| or die (Couldn't execute query.);
|$row = mysql_fetch_array($result);
|extract($row);
|  }
|
|Thank you.
|Matt
|

Your page gives me Warning: extract() expects first argument to be an
array in /c36/mhedges/aoii/olemiss/updatesister.php on line 32. Are you
sure you're using the correct table name? BTW, table is a MySQL
reserved keyword, so if it is the table name, it should be enclosed in
backticks: http://www.mysql.com/doc/en/Reserved_words.html

Jeff Harris
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] Link acting as a submit button

2003-07-24 Thread Jeff Harris
|-Original Message-
|From: Matt Palermo [EMAIL PROTECTED]
|Sent: Thursday, July 24, 2003 3:35 PM
|
| I am trying to create a submit button out of a hyperlink using the
| following
| code:
|
| (this is in a file called index.html)
| A DEFANGED_href=javascript:go_where_my_variable_says('this.php');this
| page/a
|
| DEFANGED_SCRIPT LANGUAGE=JavaScript
| !--
| function go_where_my_variable_says(where)
| {
| document.forms[0].action = where;
| document.forms[0].submit();
| }
| //--
| /DEFANGED_SCRIPT
|  This works fine as an html document, however, when I try to echo the
| same code out in a PHP page, it gives me javascript errors.  I am using
| the following to echo it out in PHP:
|
| echo 
| A href=\javascript:go_where_my_variable_says('this.php');\this
| page/a
|
|
| DEFANGED_SCRIPT LANGUAGE=\JavaScript\
| !--
| function go_where_my_variable_says(where)
| {
| document.forms[0].action = where;
| document.forms[0].submit();
| }
| //--
| /DEFANGED_SCRIPT
| ;
|
| This displays the link fine for the submit hyperlink, but it gives the
|
| javascript error:
|
| Error:  Object doesn't support this property or method.
| Code:  0
| Like I said before, this code works perfectly fine if I have it an html
| document.
|
| Anyone got any ideas?
|
| Thanks,
| Matt
|
|From: Jim Lucas [mailto:[EMAIL PROTECTED]
|Sent: Thursday, July 24, 2003 6:40 PM
|To: Matt Palermo
|Subject: Re: [PHP] Link acting as a submit button
|
|Your javascript is wrong.
|
|change this
|document.forms[0].action = where;
|to this
|document.forms[0].action.value = where;
|
|Jim Lucas
|
|- Original Message -
On Jul 24, 2003, Matt Palermo claimed that:

|Fixing the javascript that you specified still gave me the same
|errors...  Got any more suggestions?
|
|Thanks for your help,
|
|Matt

When you converted it to PHP did you include the form tags? I received a
similar error until I added the form tags. Other than that, try adding a
name value to the form and change 'document.forms[0].action = where;' to
'document.form_name.action = where;'

Except for the fact that I don't have this.php, it appeared to work for me
after the addition of the form tags as posted.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] closing windows

2003-07-23 Thread Jeff Harris
On Jul 23, 2003, Jon Phipps claimed that:

|I am curious as to how, from within php, you could emulate the javascript
|window.close() function. The other thing is how would I blend javascript and
|php, it call javascript functions from php. The javascript will be located
|in the same page as the php.
|
|Jon
|
Since JavaScript is client side, and PHP is serverside, you would blend
Javascript and PHP the same way you blend HTML and PHP.
?php
print(script language=\JavaScript\\n);
print(window.close(););
?

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] OK

2003-07-22 Thread Jeff Harris
On Jul 22, 2003, Rausch Alexandru claimed that:

|Sorry, i didn't itent to be a spam, believe me. But i don't know how to
|do this aplication
|

In that case, you might want to start with something a bit less ambitious,
maybe learning to wrap your mail, and some tutorials?
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_1/page1.html

Maybe a web search to see if what you want to do has already been done?

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] changing the name of a variable by another variable.

2003-07-22 Thread Jeff Harris
On Jul 22, 2003, Tony Crockford claimed that:

|I really am having a difficult day.
|
|I want to do an incrementing while loop that will echo out the values of
|$variable1 , $variable2, $variable3 which exist previously.
|
|so how do I get the incrementing number onto the word variable? to make
|a new variable that matches thename of the existing ones..
|
|I tried echo $variable$increment ; but $variable doesn't exist alone so
|all I get is $increment.
|
|I'm not sure what I should be looking for in the manual - google's not
|much help either.
|
|anyone give me a clue?
|
|TIA
|
|Tony
|
Would an array be too difficult to implement into your code?

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] REDIRECT STATUS CGI

2003-07-22 Thread Jeff Harris
On Jul 22, 2003, Freek van de Griendt claimed that:

|Hi,
|
|I just started using PHP and installed it on my Windows machine, together
|with Xitami (Web server). But now, when I try to write a simple PHP file I
|get the following error:
|
|Security Alert! The PHP CGI cannot be accessed directly.
|This PHP CGI binary was compiled with force-cgi-redirect enabled. This means
|that a page will only be served up if the REDIRECT_STATUS CGI variable is
|set, e.g. via an Apache Action directive.
|
|For more information as to why this behaviour exists, see the manual page
|for CGI security.
|
|For more information about changing this behaviour or re-enabling this
|webserver, consult the installation file that came with this distribution,
|or visit the manual page.
|
|How can I change this redirect status? I tried to do it in my php.ini file
|but I am not sure what I have to change.
|
|Any help? Thanks in advance.
|
|Freek

Looks like you have a bad configuration in your php.ini file. First,
search your hard drive for all instances of php.ini, then, maybe one of
these will help:

http://lists.xitami.org/pipermail/xitami/2002-January/002141.html
http://www.devarticles.com/forum/printthread.php?threadid=2518
http://www.php.net/security.cgi-bin

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Backing up: Database and scripts...

2003-07-22 Thread Jeff Harris
On Jul 22, 2003, Michael Smith claimed that:

|Hi,
|
|So I can create the files, move them, etc. to backup my database and a
|couple of directories, but how do I create a gzip file of that and send
|it to the user? I need to basically execute a command to gzip a couple
|of files/directories... I also need to figure out how to un-gzip a gzip
|file... (and extract those files). Please help!
|
|-Michael
|
http://www.devshed.com/Server_Side/PHP/TAR_File/page1.html
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] FTP Synching

2003-07-22 Thread Jeff Harris
On Jul 22, 2003, jwulff claimed that:

|How would I download any new files on a remote machine to my local one (in a
|specific folder) via ftp?

You do realize that this is like subscribing to a automotive mail list and
asking how to buy groceries.

I would start by checking the man page for wget.

If I were to use ftp functions in PHP, I would start with
http://us2.php.net/ftp


-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



[PHP] RE: [PHP:OT] IE Issues

2003-07-22 Thread Jeff Harris
On Jul 22, 2003, Chris W. Parker claimed that:

|Pete Morganic mailto:[EMAIL PROTECTED]
|on Tuesday, July 22, 2003 7:39 AM said:
|
| so which tag should i use .. DEFANGED_div DEFANGED_span ???
|
|You should use proper mark up is what you should use. Or I think some
|people call it the semantic web. Not exactly sure. But here is an
|example.
|
|You might normally have:
|
|font size=1 face=verdanaHi this is bmy/b text/font
|
|Instead you should have this:
|
|pHi this is strongmy/strong text/p
|
|You will also need a CSS file to define how the p tag should look.
|
|p {
|   font-family: verdana;
|   size: 100%;
|   }
|
|
|rule of thumbIf you need something special that is not a block element
|use DEFANGED_span. If you need to group sections together use DEFANGED_div./rule 
of
|thumb
|hthaihinw*,
|chris.
|* hope that helps and i hope i'm not wrong

SPAN should only be used where no other HTML inline element provides a
suitable meaning. If a presentation such as bold or italic text would be
suitable on visual browsers, authors may prefer to use an appropriate font
style element. For example:

PSPAN LANG=frLa Rvolution Tranquille/SPAN shook Quebec in the early
1960's.
PI LANG=frLa Rvolution Tranquille/I shook Quebec in the early
1960's.

The DIV tag is used to mark up divisions in a document. It can enclose
paragraphs, headers and other block elements.

However, the DIV element defines a generic block-level container,
allowing authors to provide style or language information to blocks of
content. The element may contain any inline or block-level element,
including another DIV.

HTHemaiat (... even more and in addition to)
Jeff

-- Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] RE: new browser window in php

2003-07-18 Thread Jeff Harris
On Jul 18, 2003, Jeffry Lester claimed that:

|How do I start a new browser window when using print in php?
|
|Jeffry Lester
|[EMAIL PROTECTED]

Not quite sure how this is PHP, but you might want to check here:
http://www.htmlgoodies.com/tutors/new_win.html

I guess one way of doing it would be something like
?php
print(h1Hey! Press Ctrl-N/h1\n);
?

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] HTTPS POST without user/client intervention

2003-07-16 Thread Jeff Harris
|-Original Message-
|From: PHP List [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, July 15, 2003 1:02 PM
|To: [EMAIL PROTECTED]
|Subject: [PHP] HTTPS POST without user/client intervention
|
|I am writing a php script to accept an HTTPS POST of data from a remote
|site, process the data, and send an HTTPS POST response back (not
|necessarily to the same remote site). I can do this pretty easily in
|PERL (which I may have to if I can't find a PHP solution).  Also I need
|to do the https post without any kind of client or user interaction. I
|have checked through php.net and phpbuilder.com but have only come up
|with things for HTTP POST (no SSL Encryption).  Anyone run across
|something like this, or can point me in a direction to look?
|

On Jul 16, 2003, Ralph Guzman claimed that:
|
|I think what you are looking for is socket connections:
|http://www.php.net/manual/en/function.fsockopen.php
|
|Or CURL
|
|http://www.php.net/manual/en/ref.curl.php
|

Another option for you is to ouput a blank page with just a form pointing
where you need it to, with hidden inputs, and at the end of the page or in
a body onLoad='',

script language=JavaScript
document.form.submit();
/script

Assuming your client has JavaScript.

Jeff Harris
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Passing $Vars between 2 php pages

2003-07-16 Thread Jeff Harris
|Valentin wrote:
|
|Hi, is any way to pass a $Var from one to other php pages without using
|DEFANGED_FORM and Cookies?
|
|Thanks,
|
On Jul 16, 2003, John Manko claimed that:

|page1.php
|$_SESSION['myvars_VARNAME'] =  $varname;
|the 'myvars_' is just for identification purposes, so avoid over-writing
|anthing that you might not want to.
|
|page2.php
|$varname =  $_SESSION['myvars_VARNAME'];

Session still either use cookies or URI:
There are two methods to propagate a session id: Cookies, URL parameter

Thus sayeth the oracle:
http://www.php.net/manual/en/ref.session.php

The only way that I can see of passing a variable from page to page
without using cookies or URI would be to make sure that only one person
can access the entire site at one time and use either a database or a file
on the server.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] multiple databases

2003-07-15 Thread Jeff Harris
On Jul 16, 2003, Paulo Neves claimed that:

|Hi,
|
|How can I set up PHP to work with multiple databases in the same page?
|(not tables)
|
|That's all,
|
|Thanks
|
|PN
|
How do you work with multiple variables in the same page?

?
$database1_link = mysql_connect('localhost', 'user', 'password');
mysql_select_db('database1', $database1_link);

$database2_link = mysql_connect('localhost', 'user', 'password');
mysql_select_db('database2', $database2_link);

$result1 = mysql_query(SELECT * WHERE 1=1, $database1);
$result2 = mysql_query(SELECT * WHERE `foo` = 'banana split', $database2);

require_once ('DB.php');
$dblink=DB::connect(oci8://user:[EMAIL PROTECTED]);
$insert = $dblink-query(INSERT INTO useronline VALUES (3, 4, 'Joe Momma');

?

The key is either to use DB.php and define different hooks, or to use the
second argument of your _query function.

Jeff Harris
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Turning string into a table

2003-07-14 Thread Jeff Harris
On Jul 13, 2003, zavaboy claimed that:

|Is there a way to make for example:
|
|// (Column info)
|// String 1:
|[This column holds
|[Col 1]
|[Col 2]]
|[This second column holds
|[Col 3]
|[Col 4]]
|
|// (Row)
|// String 2:
|[Col 1 (row1)]
|[Col 2 (row1)]
|[Col 3 (row1)]
|[Col 4 (row1)]
|
|// (Row)
|// String 3:
|[Col 1 (row2)]
|[Col 2 (row2)]
|[Col 3 (row2)]
|[Col 4 (row2)]
|
|// How do I turn the above strings into a table?
[snipped]
|You get the idea...
|So, any idea how to do that?
|I want it to work correctly no matter how many rows and columns there are.
|


Not sure if this is exactly what you need, but it makes the design of
HTML tables easy, flexible, reusable and efficient.

http://pear.php.net/package-info.php?package=HTML_Table
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Can PHP Build XML Pages?

2003-07-14 Thread Jeff Harris
On Jul 14, 2003, Jeffrey Fitzgerald claimed that:

|
|Looking for direction PHP and XML. I have a need to build a simple
|XML doc from a PHP set of form vars. Any tips or examples are greatly
|appreciated.
|

You mean something like
?php
header(Content-Type: text/xml);
print (?xml version=\1.0\ ?\n);
print (shows\n);
print ( listing id=\{$_POST['formdate']}\\n);
print ( venue{$_POST['venuename']}\n /venue);
print ( /listing\n);
print (/shows\n);
?

Lay out your xml document first, then plug in the form variables. Make
sure you use that header() command, too.

Jeff Harris

-- Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




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



Re: [PHP] Logging PHP Execution time to a file?

2003-07-14 Thread Jeff Harris
On Jul 14, 2003, Marek Kilimajer claimed that:

|I use this function:
|function echo_pt($add='') {
|   static $pt = 0;
|   if($pt==0) {
|  $pt = miro_time();
|  return;
|   }
|   $time_start = explode(' ', $pt);
|   $time_end = explode(' ', microtime());
|   $parse_time = number_format(($time_end[1] + $time_end[0] -
|   ($time_start[1] + $time_start[0])), 3);
|   echo '!-- Parse Time '.$add.': ' . $parse_time . 's --';
|   $pt=microtime();
|}
|
|Usage:
|it needs to be initialized first:
|echo_pt();
|then simply call as many times as you need:
|echo_pt('some string');
|and it will show you seconds elapsed from the last call to this
|function, so you can easily see where the script spends most of its
|time. Instead of echoing it you can append it to a file.
|
|Lasse Laursen wrote:
|
| Hi all,
|
| We are debugging some web applications to try to determine where the
| problems with long execution time is.
|
| Is it possible to log the execution time of each script executed to a
| logfile? The PHP processes are run as FastCGI under Zeus.
|
| Regards
| --
| Lasse Laursen · VP, Hosting Technology · NetGroup A/S
| St. Kongensgade 40H · DK-1264 Copenhagen K, Denmark
| Phone: +45 3370 1526 · Fax: +45 3313 0066
|
| - Don't be fooled by cheap finnish imitations - BSD is the One True Code
|
--

It seems to me that many people (usually CMS systems or shopping carts)
try to re-invent the wheel. The pear repository is filled with many
packages, hopefully more to come, and the Benchmark Package is one of
them.

require_once Benchmark/Timer.php;
$timer = new Benchmark_Timer;
$timer - start();
// Plenty of code...
$timer - stop();
print(!-- Total execution time: );
print($timer- timeElapsed());
print( seconds. --\n);

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] SquirrelMail + Writable Directories

2003-07-14 Thread Jeff Harris
|-Original Message-
|From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED]
|Sent: Monday, July 14, 2003 12:14 AM
|To: [EMAIL PROTECTED]
|Subject: [PHP] SquirrelMail + Writable Directories
|
|My question is simple - I want to install Squirrelmail on my webserver,
|but I can't chmod or chown the data directory. Is there any way to stop
|Squirrelmail from trying to write to the directory without limiting
|functionality too much, or is there a way to allow it to write without
|using chmod, chgrp or chown?
|
|I can't SSH into the box, only set up cron jobs. :S Can anyone help!?
|
On Jul 14, 2003, Ralph Guzman claimed that:

|Most ftp programs allow you to chmod. If using windows, check out wsftp
|www.ipswitch.com.
|
|I don't think there is another way to change directory/file privileges
|other than chmod.

Might be kind of an inconvenience, but you might be able to set up a
cronjob for one minute out for the command you want to do, then delete the
cronjob.

Or, maybe this might help: http://www.gimpster.com/wiki/PhpShell

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



[PHP] PHP Perl information sharing

2003-07-14 Thread Jeff Harris
I'm working on a site which is mostly in PHP. However, I have to use perl
for a couple of scripts. Does anyone have any experience in sharing
session information between PHP and perl?

I'm writing for a client who I will know has cookies enabled, and I have a
mySQL database, so I'm looking for what people think will generate easier
code to maintain and expand.

Jeff Harris
--
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] How to hide url on a php link NOT post...

2003-07-11 Thread Jeff Harris
On Jul 10, 2003, Joey claimed that:

|How can I hide this link so value can't be changed?
|I don't want to change anything at the server level, and its not from a
|form so I cant do a post -vs- a get.
|
|http://www.abcd.com/popup_SearchRepSet.php?searchby=cust_nosearch=1value=WOR032
|
|Thanks !
|

#1) [Not PHP] Make it a post that looks like a link. See previous posting
at http://marc.theaimsgroup.com/?l=php-generalm=105597453308214w=2

#2) [Not PHP] If the values will never change, try http://tinyurl.com. If
you're keeping track of referrals, it might mess up your statistics.

#3) [Not PHP] Make that link inside a frame. One frameset would be
invisible, the other would be the link.

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] numbers to text

2003-07-11 Thread Jeff Harris
On Jul 11, 2003, Pete Morganic claimed that:

|Anyone know of a class or function that converts numbers to readable text
|
|eg inputing the number would output text as in
|
|120 = one hundred and twenty
|3600 = three thousand six hundred
|
|
|tia
|
|pete
|

How about http://pear.php.net/package-info.php?pacid=140 ?
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




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



Re: [PHP] Storing SQL Queries for Reuse in Apps

2003-07-11 Thread Jeff Harris
On Jul 10, 2003, Jacob C claimed that:

|Hello All,
|
|I just want to survey the list and see what kind of solutions people are using
|for the storage and reuse of SQL queries.
|
|Right now I am working on an application that has native SQL queries as well
|as custom queries that can be added by developers as they build on the
|framework.
|
|In the past I have done several things to store large sets of SQL queries.
|Some are better than others and some just shouldn't be used (hardcoded):
|
|- Hardcoded into the application (written into classes or procedural code as
|needed).
|- Stored in a delimited text file.
|- Placed into a function or class method using switch to iterate by category
|and ID.
|- Stored in an XML file.
|
|I am kind of leaning towards the XML solution since the native queries can
|then easily be updated for people using the application. Of course using XML
|adds execution time and complexity to the app.
|
|Anybody have any other solutions I haven't thought of or trick/tweaks to the
|ones I have listed?
|
|Thanks!
|Jacob

IIRC, phpMyAdmin uses stored queries. It places them in a table in the
database. http://sourceforge.net/projects/phpmyadmin/

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] passing commands via ssh

2003-07-09 Thread Jeff Harris
On Jul 9, 2003, Mignon Hunter claimed that:

|Hello all,
|
|I am trying to execute a command on another server from my web
|application.
|
|I need to execute the command via ssh for security reasons. I have a
|private key/passphrase installed for ssh so that I can run ssh without a
|password.
|
|The command:
|
|ssh -i vertex [EMAIL PROTECTED] TX 77041 COD 1.00
|
|Works from my box's command line. The vertex 'key' for ssh is also in
|the same directory.
|
|But when I run
|system(ssh -i vertex [EMAIL PROTECTED] TX 77041 COD 1.00)
|from my script I get an error:
|
|Host key verification failed.
|
[snip]
|Any help is as always greatly appreciated.
|
|Thx
|Mignon

Do you have the private key/passphrase installed as a regular user or the
httpd user of the local machine on the remote machine?

PHP will run the scripts as the httpd user, not as the user who owns the
script.

?php
$line = exec(/usr/bin/id);
print (PHP runs as $line\n/pre\n);
?

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




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



Re: [PHP] Re: NEW SPAMMER - [PHP] New Krysalis version released

2003-07-08 Thread Jeff Harris
On Jul 8, 2003, Alexandru COSTIN claimed that:

|Hi,
|I've just read the other thread about spammers and such.
|Indeed, my announcement - even for a free platform - was not complying
|to the posting guidelines as it not a response to any questions asked.
|
|I apologize.
|
|Alexandru
|

I've just started poking around with XML. Does anyone know anything that I
might use to learn more about it? Optimally, it would be available in the
pear repository, and have plenty of documentation.

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] XML

2003-07-08 Thread Jeff Harris
|-Original Message-
|From: Petre Agenbag [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, July 08, 2003 6:27 AM
|To: [EMAIL PROTECTED]
|Subject: [PHP] XML
|
|
|Hi List
|
|Firstly, this question is arguable more about XML than PHP, but they are
|interlinked, so I hope it is topical for this list.
|
|Firstly, Where I come from:
|
|I am VERY comfortable with PHP/MySQL on Linux and understand all those
|concepts.
|
|Now I'm trying to see the benefits of XML, and quite frankly, I just
|cannot see why one would want to use it...
|
[snip]

On Jul 8, 2003, Joe Harman claimed that:

|Okay Petre... You have asked the question that I always wanted to ask!!!
|I can't wait to see peoples answer... I simply can't find a use for it
|either
|
|Joe

This probably should be on another list, but it might give someone an idea
on how to create something in PHP. I've been trying to figure out if some
of what I'm doing would be good for XML. The answer for that is no, use a
database.

It seems to me, that XML is a way of encoding data for the transmission
between two processors. For example, the database uses XML to transfer
data to the PHP engine. The weather magnet uses XML to transmit
information to your PHP script, which parses it and produces the HTML
output. My page asks your script for some information, and it's returned
as well-formed XML.

As far as using an XML file to act as a database and your parser to create
the HTML, it's probably better to use a database.

Jeff
(my $.015 [after taxes] )
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] php pages without .php extension on linux and windows

2003-07-07 Thread Jeff Harris
On Jul 7, 2003, Heiko Mundle claimed that:

|I try to use PHP and Apache on both Linux (SuSE 8.1) and Windows (2K).
|
|On Linux I can access the PHP scripts without adding the .php extension.
|E.g.
|http://mydomain/myscript?para1=TRUE
|for
|http://mydomain/myscript.php?para1=TRUE
|But on Windows it doesn't work (page not found - HTTP 404)
|
|How do I switch on 'adding .php' on windows? Does it run on windows too?
|What is responsible for that functionality, Apache/PHP?
|Which module or directive?
|
|My system:
|SuSE Linux 8.1 - PHP 4.2.2 - Apache/1.3.26
|Windows 2000 - PHP 4.2.3 - Apache/1.3.24
|
|Thanks for helping
|
|Heiko

This might be better done in httpd.conf. See what's going on at
http://www.phpbuilder.com/columns/tim19990117.php3 It might be able to
do what you're looking for.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] qry not running??

2003-07-07 Thread Jeff Harris
On Jul 7, 2003, Micah Montoy claimed that:

|Well, I redid the code a bit but it is still blowing up with the same error
|message.  I also did the echo bit and it returned Resource id #10.  What
|ever that is.  At least I know its returning something.  But when I did
|mssql_row_nums($result), it returned the value 0.  I'm not sure if this is
|where its encountering problems or not.  Here is the script that I'm using
|for everything.  I believe the syntax is correct but let me know if you see
|anything out of place.

[snip]
If the number of rows being returned is zero, what data do you expect to
get? Shouldn't you check to see if the number of rows returned is zero and
produce some other message and stop processing the non-existant results?

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Table trouble

2003-07-07 Thread Jeff Harris
On Jul 8, 2003, phpu claimed that:

|Hello
|I need help.
|I'm querying a database then printing the results in a table. I want the result to be 
in a table with 2 columns per row.
|something like that
|
|
|--  row 1  -- row 2 --
|
|--  row 3  -- row 4 --
|

|How can I do that?
|Please help me asap
|

I suggest you learn to count by 2's and create a loop using that counting
pattern. It looks like you want the odd rows on the left and the even
rowss on the right.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] New to PHP

2003-07-07 Thread Jeff Harris
On Jul 7, 2003, Steve Keller claimed that:

|At 7/8/2003 03:30 AM, Hiren Mehta wrote:
|
|  Thnx alot guys You have been of great help :D
|
|And don't forget this list! There are a lot of really talented people on
|this list, so if you're trying to figure something out and haven't been
|able to find an answer on your own, don't hesitate to ask here.
|
|I've learned a lot just by reading the threads started by other people;
|more often than not, someone has already asked or is in the process of
|asking questions about the exact same problem I'm working on.

[snip]

|--
|S. Keller

After coding for a while, I would suggest that while you're reading
through coding excercises, you find a coding style that works for you and
keep it consistant. One of the least fun parts of creating your php pages
is reading some code that you coded months (years) ago, and it's totally
out of style with everything else that you're doing.

One good place is the Official Pear Coding Standard:
http://pear.php.net/manual/en/standards.php

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] date() function and timestamps

2003-07-04 Thread Jeff Harris
On Jul 3, 2003, Garrick Linn claimed that:

|Hello all,
|
|I seem to be running into a problem where the date() function appears not
|to differentiate properly between unix timestamps.
|
|For example, the code:
|
|?php
|
|$seconds = 1054278483;
|echo $secondsbr;
|echo date(d-m-Y H:m:s, $seconds);
|echo brbr;
|
|$seconds = ($seconds - 60);
|echo $secondsbr;
|echo date(d-m-Y H:m:s, $seconds);
|echo brbr;
|
|?
|
|outputs
|
|1054278483
|30-05-2003 02:05:03
|
|1054278423
|30-05-2003 02:05:03
|
|I would expect the second date() to output 30-05-2003 02:04:03 as the
|second timestamp is exactly 60 seconds behind the first, but I might be
|missing something.  I see the same behavior on two redhat linux machines
|running Apache 2.0.40 + PHP 4.2.2 and Apache 1.3.26 + PHP 4.3.2
|respectively.  Any ideas?
|
|Thanks,
|
|Garrick Linn
|

As has been pointed out before, you expect incorrectly. The value of 'm'
won't change depending on what's around it. The correct formats are listed
at http://www.php.net/manual/en/function.date.php

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Multiple posts.

2003-07-03 Thread Jeff Harris
On Jun 30, 2003, news.php.net claimed that:

|I was wondering if there is a way to solve my problem. I want to send
|certain information to certain webpage for about 25 times ( I wanna make a
|webpage to send a SMS to every player in our soccer team). I can send the
|needed information to one server and it sends an SMS but how to do it 25
|times in a row. I have a form where I can write the message and I take the
|phonenumbers from db and there's a button to send the sms. If I do it once
|it works fine, but how to do it multiple times? The real problem is that
|after I do it once the browser opens a web page returned from the
|sms-server. So what should I do to prevent the browser doing this and can I
|make a php-script to my webserver that sends the needed information as many
|times as I want and without opening the requested page?
|

If you're sending the SMS message through another web page, perhaps one of
the Pear HTTP packages might work for you:
(http://pear.php.net/packages.php?catpid=11catname=HTTP)

I haven't started experimenting with any of them yet, but I'm sure someone
will be able to help out if you need assistance.

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Get Rid of this Crook

2003-07-03 Thread Jeff Harris
On Jul 3, 2003, Jason Wong claimed that:

|On Thursday 03 July 2003 19:48, Christian Wach wrote:
|
| Just to chime in on the reply to thread earlier, Daryl, by hitting reply
| all has now sent his email address to these 401 scamsters as well as the
| list. Hopefully he'll not suffer any consequences from doing this, but the
| risk is there.
|
|A decent mail client would allow you to at least:
|
| reply (to sender)
| reply (to list)
| reply to all (which means sender, and anyone else on the To: and Cc: fields)
|
| Guess which side of the header-munging debate I sympathise with...
|
|It's a short-coming of your mail client, not the list -- guess which one
|should be changed?
|

Should people bend to the technology they use, or should the technology be
manipulated to do the people's bidding?

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] PHP and Mysql Limit

2003-07-02 Thread Jeff Harris
|- Original Message -
|From: [EMAIL PROTECTED]
|To: [EMAIL PROTECTED]
|Sent: Wednesday, July 02, 2003 9:23 AM
|Subject: [PHP] PHP and Mysql Limit
|
|
|
| I've created a script that reads a sorted mysql query and outputs specific
| results into text files defined by the start and limit of mysql. The
| database holds 178 records. I want to start my output on #9 with 10
| records per page. Should leave me with 17 equal pages right?
|
| $count = 178
| $start = 8; (Mysql starts at record 0)
| $per_page = 10;
| $page = 1;
|
| while ($start = $count) {
|
| $fp = fopen(Page$page.txt, w);
[snip]

On Jul 2, 2003, Chris Sherwood claimed that:

|It looks like your adding 10 to 8 thus getting 18... of course I maybe
|looking at this wrong
|

Then, once you've done it enough times, $start = $count = 178.
[code]
while ($start = $count) {
// when $start = $count = 178, you won't retrive any data
[/code]

I would probably also move as much of the mysql_connect as possible to
outside the loop. It only needs to be done once.
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED



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



Re: [PHP] Hi All i need help..

2003-07-02 Thread Jeff Harris
On Jul 2, 2003, Beogradjanin claimed that:

|Hi All I want to install PHP under Suse 8.2. How can I do it?
|
|
|
|Thanks

Unless you have a custom install, probably the easiest way is to install
the rpms through YaST.

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] print html code

2003-07-02 Thread Jeff Harris
On Jul 2, 2003, Karina S claimed that:

|Hello,
|
|I want to make a php site which can generate a html code and display it on
|the screen. (Display the code itself.)
|I use htmlspecialchars() function. It works fine, but now I have to add
|about 200 lines of static html code to print it out. If I put all of the
|code in a string than it will appear in a single line. (Maybe it works, but
|not nice)
|
|How can I easy print out more lines of html code with php?
|
|Thanks!
|

Make sure you're putting \n in the string, then print
nl2br(htmlspecialchars($string));

Use php's wordwrap() or find another word_wrap function then print
wordwrap(htmlspecialchars($string));

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Break, Exit, Die, Kill, Maime and Stab

2003-07-02 Thread Jeff Harris
On Jul 2, 2003, Jonathan Pitcher claimed that:

|I have some scripting that includes files.  The included files are
|executed and everything works great.
|
|The included page needs to check multiple information.
|
|Currently if I want the scripts to end correctly I have to:
[snip]

|I would love to:
|
|if()
|{
|   //Blah
|   break;
|}
|
|and have that break only stop the rest of the execution of the include
|file but allow the script that included it to finish running.
|
|I have tried break, exit and die with no luck.  Even tried break 1; and
|break 2; to break out of levels but that didn't seem to work either.
|
|Is there a solution or should I continue to do what I have done.
|
|Thanks in advance,
|
|Jonathan Pitcher

Perhaps you might want to rewrite your code using the switch?
http://www.php.net/switch

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] how can I logout autamaitcally (using session)

2003-07-02 Thread Jeff Harris
On Jul 2, 2003, Hardik Doshi claimed that:

|Hi,
|
|You can add last_request_time variable into the
|session when user logs into the system. Initially set
|the time at which user logs in to the system. Now
|every user click you need to check your
|last_request_time with the current_time. If the
|difference of last_request_time and current_time is
|greater than the thresold limit you have decided (idle
|time of user) than just logout that particular user
|otherwise set the current_time to the
|last_request_time and proceed..
|
|I hope the algorithm is clear to you.
|
|Let me know if u need any help
|
|thanks
|
|Hardik Doshi
|

I just saw a banking site that allows a 15 minute session. I'm guessing
that the session time is set to 15 minutes for the cookies, and one frame
contains a countdown clock. When the clock hits zero, it uses javascript
to redirect to a page that removes the sessions and lets you log in again.
I'm sure you might be able to recreate it to your needs (as long as they
don't lay claim to a patent of a count down timer to end a session).

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] print html code

2003-07-02 Thread Jeff Harris
On Jul 2, 2003, Jim Lucas claimed that:

|well, tell me.  What browser follows the standards 100% ??

The same one that is 100% bug free?

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Parsing fgetcsv using tab (\t)

2003-07-01 Thread Jeff Harris
On Jul 1, 2003, Chris claimed that:

|I'm trying to create an form where the user can upload a datafile to the
|server. The datafile will be txt or csv and contain multiple records. I
|would like the user to supply the field delimiter like (,) comma , (\t)
|tab or something else. The data records are then parsed using fgetcsv.
|
|The problem I'm having is trying to recover the tab character from the
|form post. If I print out what is received from my form I see the
|following \\t. I realize that the addition of the extra slash is
|expected, but what I don't know how to do is prepair this varable to use
|it in my fgetcsv argument.
|
|I've tried using stripslash but nothing seems to work for me.
|
|Strangely, if is set a variable in my processing script like:
|
|$field_terminater = \t;
|
|Then supply this to: $newRecord = fgetcsv($f, $size,$field_terminater)
|everything works fine. If I use the variable passed from my form the
|records are not getting parsed.
|
|Any suggestions would be appreciated.
|Chris
|
[Not PHP]
Hard code the choices using radio buttons or a select on the form. There
shouldn't be too many commonly used delimiters, and those that use
uncommon delimiters will have to adjust.
[/Not PHP]

Then, use the value submitted to choose the delimiter in the php script.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] .inc.php

2003-07-01 Thread Jeff Harris
|- Original Message -
|From: Kyle Babich [EMAIL PROTECTED]
|To: PHP-General [EMAIL PROTECTED]
|Sent: Tuesday, July 01, 2003 3:38 PM
|Subject: [PHP] .inc.php
|
|
| When .inc.php files are included they are also executed whenever the
| script is executed right?
| --
| Kyle
|

On Jul 1, 2003, Suhas Pharkute claimed that:

|it not because of extension .php
|it is because of start and end tags
|you can have a file .abc with php tags and it will work
|
|I have it working on my server
|
|Suhas
| --

php.net (http://www.php.net/include/) quoth

When a file is included, parsing drops out of PHP mode and into HTML mode
at the beginning of the target file, and resumes again at the end. For
this reason, any code inside the target file which should be executed as
PHP code must be enclosed within valid PHP start and end tags.


-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Items displayed left and right, help newman.

2003-07-01 Thread Jeff Harris
On Jul 2, 2003, Mark Tehara claimed that:

|Where should i start with the lodgic.  I'm trying to list a group of items
|
|
|Left: item one, Right: Item 2
|
|
|This is repeated
|
|I can only seem to get them to go str8 down not left then right.
|
|
|Any Ideas?
|
|/ Mark

Perhaps you want an html table?

Maybe using a counter of some sort to keep track of your tr td left
/td td right /td /tr?

Perhaps you want to use preto output left item, 20-strlen(left_item)
spaces, right item \n?

Perhaps to pull the values, your counter will increment by 2.
value[counter] on left, value[counter+1] on right?

Perhaps create the page in only html the way you want it to appear, then
look for patterns that can be created by looping through a logic structure
(like www.netfobs.org/dates.php)?

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Re: Why Can't I get this to work

2003-06-30 Thread Jeff Harris
On Jun 28, 2003, Ron Clark claimed that:

|OK, normally I do not respond to my own posts, but I have been shown that I
|did not get the whole script. So here it is:
|
|for ($i=0; $i$number_of_alerts; $i++) {
|
|// Split each line
|
|$line = explode( , $ipfwlog[$i]);
|
|$line[1] = intval($line[1]);
|
|$IPFWsql = INSERT INTO Firewall_Logs (month, date, time, fw_name, kernel,
|fw_engine, rule_number, action, protocol, src_ip_port, dst_ip_port,
|direction, via, interface) VALUES ('$line[0]', '$line[1]', '$line[2]',
|'$line[3]', '$line[4]', '$line[5]', '$line[6]','$line[7]', '$line[8]',
|'$line[9]', '$line[10]', '$line[11]', '$line[12]');
|
|$results = mysql_query($IPFWsql) or die (Could not execute query);
|
|}
|Again, any help with this issue is appreciated.

|Thanks,
|
|Ron Clark
|

Could it be the fact that 1) `date` and `time` are reserved mysql keywords
and should be enclosed in back ticks, and 2) you're listing 14 columns
and adding 13 values?

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] SEARCH ENGINE

2003-06-26 Thread Jeff Harris
On Jun 26, 2003, David Elìas Sánchez Vásquez claimed that:

|
|Hi folks
|
|First, thanks to Jim for the greeat tree-menu, we are just editing it.
|Ok, we are doing the tutorial for the Intranet of our University. There is
|just a lot of information and we want to give the user all the ways to find
|the information he's looking for. Hence, we need a great search engine too.
|
|We have all our information stored in a MYSQL database. We need a search
|engine to look for the keywords we have in our tables and that show the
|related results. Anyone knows a good search engine -free- for this treat?
|
|thanks
|
|David.
|

http://www.phpbuilder.com/columns/clay19990421.php3?print_mode=1

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] pdf routine - good local / bad online

2003-06-25 Thread Jeff Harris
On Jun 25, 2003, Floyd Baker claimed that:

|
|Hi.
|
|I have a routine creating a pdf file.  Here is the script that works
|on the win98 dev box.   But when I upload it to the linux online, it
|does not work.
|
|It stops at 'create handle'.  Can someone please tell me why?
|
|// GET COMPANY INFO
|   while($row = mysql_fetch_array($mysql_result)){
|   $name1 = $row['name1'];
|   $name2 = $row['name2'];
|   $addr1 = $row['addr1'];
|   $addr2 = $row['addr2'];
|   $city = $row['city'];
|   $stat = $row['stat'];
|   $zipc = $row['zipc'];
|   $phone = $row['phone'];}
|
|// START PDF FILE
|   unlink('f:/localhost/adobe/' . $cocode . '_info.pdf');
|
|// create handle for new PDF document
|   pdf_delete($pdf);
|   $pdf = pdf_new();
|
|// open a file
|   pdf_open_file($pdf, 'f:/localhost/adobe/' . $cocode . '_info.pdf');
|
|
|I do change the 'f:/localhost' to https://xx.xx.xx,xx when uploaded.
|
|Any thoughts will be greatly appreciated...  TIA
|
|Floyd
|
|--
Not sure you can unlink a file by https:// protocol. Make sure that it's
pointing correctly to a file for which httpd has write permissions.
http://www.php.net/unlink

unlink('f:/localhost/adobe/' . $cocode . '_info.pdf');'
unlink('/usr/local/httpd/htdocs/' . $cocode . '_info.pdf');

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] PHP cached data when using browser back button

2003-06-24 Thread Jeff Harris
On Jun 25, 2003, Ow Mun Heng claimed that:

|Hi All,
|
|   How can I prevent the browser from sending in cached data after the
|user pressed the 'back' button and re-inputted data.
|
|Eg: Originall I enter 3 isbn numbers, submitted it, then the user presses
|the 'back' button to re-input 1 new data and then re-submits the data,
|instead of only having the 1 new data, I get the 1 new data + 3 old data.
|
|Can anyone help explain this? (if I were to clear the browser's cache, then
|there's no problem.)
|
|Cheers,
|Mun Heng, Ow
|H/M Engineering
|Western Digital M'sia
|DID : 03-7870 5168
|
|--
|PHP General Mailing List (http://www.php.net/)
|To unsubscribe, visit: http://www.php.net/unsub.php
|
http://marc.theaimsgroup.com/?l=php-generalm=105613536620953w=2

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] PHP Mysql Error Code 1062 - Duplicates found

2003-06-24 Thread Jeff Harris
On Jun 25, 2003, Ow Mun Heng claimed that:

|Hi PHP'ers,
|
|   I've got a question regarding the input of (multiple) data into
|mysql through PHP.
|
|If there is already an entry in the database, then an mysql will generate an
|error 1062 stating that the entry is a duplicate. (This will happen only if
|I input the data through mySQL using xterm, if I use PHP, then I only get
|the 'duplicate entry found', partly cause I don't know how to get the error
|code as well as the duplicate entry returned to PHP to be output'ed to the
|browser.
|
|Below is my code. $my_query is concatenated from an array.
|
|$my_query = $my_query.
|\n('.$SN[$i].','.$DCM[$i].','.$Supp[$i].','.$time_now.'),;
|$query = INSERT INTO pioneer(serial_no,dcm,supplier,fa_timestamp) VALUES
|$my_query;;
|$result = mysql_db_query('tracker',$query);
|
|if ($result)
|echo brbr.mysql_affected_rows(). Drives  DCM combo inserted into
|database.;
|else
|echo \nbrbrDuplicate entry found. Data not inserted.;
|
|
|Can anyone help me out?
|
|
|Cheers,
|Mun Heng, Ow
|H/M Engineering
|Western Digital M'sia
|DID : 03-7870 5168
|
|--
http://marc.theaimsgroup.com/?l=php-generalm=105606491624771w=2
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] Performance question

2003-06-24 Thread Jeff Harris
On Jun 25, 2003, Ow Mun Heng claimed that:

|Can someone help explain how I can perform a benchmark on the queries or
|whatever?
|
|
|Cheers,
|Mun Heng, Ow
|H/M Engineering
|Western Digital M'sia
|DID : 03-7870 5168
|
|
Do it many times and time it.

--
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.









?
require_once (Benchmark/Timer.php);
require_once (DB.php);
$timer = new Benchmark_Timer;
$dblink=DB::connect(mysql://$dbuser:[EMAIL PROTECTED]/$dbname);
print(starting...BR\n);
ob_flush();
$timer-start();
$SQLQuery=SELECT * FROM table;
for ($i = 1; $i = 10; $i++) {
$insert= $dblink-query($SQLQuery);
}

$timer-stop();
print(Total execution time: );
print($timer- timeElapsed());
print( seconds.\n);
?


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



[PHP] RE: PHP General Mailing List php-general@lists.php.net

2003-06-24 Thread Jeff Harris
Summary: I have to create a word document on the fly. what's the best way
to go about it?

Okay so I have a client that would like something output to a word
document. I already have HTML and PDF versions... I'm trying to figure out
the best way to do this. I am already aware of the open html in word hack.
The way I see it, these are my choices:

1) Use the hack that I'm really don't like. It never looks quite right
(which is the whole point of this). 2) Move everything over to a windows
host and use COM. 3) Somehow convice host (hurricane electric) to run PHP5
CVS w/ Sterling's mono extension, and use .net to create the word document
(does mono support that class yet?). I hate C#. VB is even worse. 4) Find
an open-source library that writes word documents (quick search revealed
nothing...), write an extension for php. 5) Find a spec for word docs and
write a library in php 6) find a spec and write a library in c, then
create php extension.  I'm willing to do this, but it would take a long
time... 7) Tell my boss to sod off (politely, though), it's not currently
feasible...  I think this is what he's expecting, anyways.

So, does anyone have any suggestions/comments? Anyone know where I could
find a library (in c or php) or a spec? I'm kinda thinking aloud here
hoping someone will prod me in the right direction...

Thanks Evan

-- 

This might help you: http://www.phpreports.com/html/article.php?sid=2

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.





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



Re: [PHP] PHP Mysql Hit Counter

2003-06-24 Thread Jeff Harris
On Jun 25, 2003, [EMAIL PROTECTED] claimed that:

|Hi All,
|I'm after a fairly neat PHP mysql hit counter with date reporting/url
|reporting and perhaps some graphs but not nessasary. i've done my own little
|one which simply reports hits, but i'm wondering is there a free one that is
|da busiess.  :)
|
|anyone?
|ta
|M

Not sure. Why not check a search engine?
http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=php+mysql+counter
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] free dynamic MENU

2003-06-23 Thread Jeff Harris
On Jun 23, 2003, David Elìas Sánchez Vásquez claimed that:

|
|Hi folks
|
|I'd like to know if you know any page where I can download a tree dynamic
|menu made in PHP.. The options of this menu will be pulled from a mysql
|database
|
|thanks
|
|David

I know this breaks the rules/recommendations that were just discussed on
this list about whether a function should output, but tough. IRIC, this
was lifted from somewhere on phpbuilder.com

?php
function build_select_box($result, $name, $checked_val=*Choose an Option*)
 {
 /*
 Takes a $result set, with the first column being the id or value
 and the second column being the text you want displayed.
 The second parameter is the $name you want assigned to this form element
 The third parameter is optional. Pass the value of the item that should be
 selected by default.
 */
 $rows=mysql_num_rows($result);
 print(SELECT NAME=\$name\);
 for ($i=0; $i$rows; $i++) {
  print(\nOPTION VALUE=\.mysql_result($result,$i,0).\);
if(mysql_result($result,$i,1) == addslashes($checked_val)) {
print( SELECTED style='background-color: #CE'); }
print(.stripslashes(mysql_result($result,$i,1)));
  print(/OPTION);
 } // End for
 print(\n/SELECT\n);
}  // End function

print(HTMLBODYFORM action=\action.php\);
$SQLQuery=SELECT col1, col2 FROM table ORDER BY col2;
$mysql_result=mysql_query($SQLQuery, $database_link);
build_select_box($mysql_result,selected_item);
print(/form/body/html);
?

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Re: saving TEXTAREA data into mysql database

2003-06-21 Thread Jeff Harris
On Jun 21, 2003, John W. Holmes claimed that:

|Artoo wrote:
| Is it better to use that function before the INSERT query and save it to the
| database like that or use that nl2br() function while displaying the results
| of the SELECT query,
|
|Use it while displaying. You generally want to save the data in the
|database exactly as it was entered. This will allow you to display it
|back to the user for editing without them wondering what all the br /
|are in their sentences and also use it in other places, like mail or
|files...
|

I believe, that alternatively, you can wrap the output within pre/pre
tags for the html out.

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] Re: Passing Variables

2003-06-21 Thread Jeff Harris
On Jun 21, 2003, George Pitcher claimed that:

|Jay,
|
|I've never ventured into 'sessions' (not ones without drinks) but I've a
|feeling that if the user has turned cookies off then sessions are out as
|well as they require a cookie being stored on the user's machine.
|
|Someone will surely correct me if I am wrong.
|
|I went to the PHP conference in Frankfurt about 18 months ago and Rasmus was
|talking about 'clean' URLs (ithout the 'query' string. I never did find out
|how though?
|
|Cheers
|
|George
|

http://marc.theaimsgroup.com/?l=php-generalm=105597453308214w=2

form name=myform method=POST action=validate.php
input type=hidden name=secret1 value=15
input type=hidden name=secret2 value=secret login code
a href=javascript:void(document.myform.submit())next page/a/form

If you really want to keep the values a secret, you will have to
substitute them with a reverable hash or some other method to keep prying
eyes away.

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] clearing cache

2003-06-20 Thread Jeff Harris
 On Jun 20, 2003, Mark McCulligh claimed that:

|I am building a two page search feature. The user fills out page one, that
|takes them to page two. Then from page two they get the results page from
|the search.  If the user hits the back button in their browser I want them
|to go back to page one, NOT page two.
|
|Is the some way I can make page two cache clear, so when the user hits the
|back up button the page has to be reload from the server at which point I
|can forward them back to page one.
|
|Thanks,
|Mark.

The problem isn't how do I clear the cache for page 2, it's really how
do I allow for people to press the back button on the results page and go
back to page 1.

So, why not create a link a href='page1.php'Change search criteria/a?

Or, you can also insert a session variable on the results page. Page 2
will check for the existance of it. If it exists, clear it and bounce the
user to page 1.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




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



RE: [PHP] strange crypt() problem

2003-06-19 Thread Jeff Harris
It looks like Some operating systems support more than one type of
encryption. In fact, sometimes the standard DES-based encryption is
replaced by an MD5-based encryption algorithm. The encryption type is
triggered by the salt argument. At install time, PHP determines the
capabilities of the crypt function and will accept salts for other
encryption types. If no salt is provided, PHP will auto-generate a
standard two character salt by default, unless the default encryption type
on the system is MD5, in which case a random MD5-compatible salt is
generated. PHP sets a constant named CRYPT_SALT_LENGTH which tells you
whether a regular two character salt applies to your system or the longer
twelve character salt is applicable.

The first server you were using was using DES, this new server is using
MD5. Since hashes are one-way algorithms, you appear to be SOL. However,
you might be able to work something with mcrypt and someone who knows
anything about it.

http://www.php.net/manual/en/ref.mcrypt.php

Jeff

On Jun 19, 2003, Sævar Öfjörð claimed that:

|
|Well, if you don't find another solution for this, you could generate
|random passwords for each member and mail them to them. Then you would
|md5() them and update the DB with new md5()'ed passwords... This is not
|the easy way out so I hope someone finds out why the crypt() is behaving
|strangely.
|
|Sævar - ICELAND
|
|-Original Message-
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 22:43
|To: [EMAIL PROTECTED]
|Subject: Re: [PHP] strange crypt() problem
|
|I already have about 1000 members their password crypted using crypt();
|would they able to login using their password or they have to change it
|again??
|
|Thanks
|
|
|SævË Ölêöyp [EMAIL PROTECTED] wrote in message
|news:[EMAIL PROTECTED]
|Try using md5() instead because it is more widely supported than crypt()
|and it leaves no room for errors.
|
|Hope it helps,
|Sævar ICELAND
|
|
|-Original Message-
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 21:43
|To: [EMAIL PROTECTED]
|Subject: [PHP] strange crypt() problem
|
|I have this bit of code to crypt user password in user registration as
|shown
|below.
|
| $cryptpass=crypt($makepass);
|which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0
|
|And am using the codes below to check for valid login..
|// $pass -  from login page
|// $dbpass - from the database
| $pass=crypt($pass,substr($dbpass,0,2));
|}
|if (strcmp($dbpass,$pass)) {
|return(0);
|}
|
|
|Recently i have moved the same file to a new server with php 4.3.1 the
|problem is the same piece of codes above generates completely differen
|crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
|codes above does not work... :(
|
|Please someone tell me that  i am not going mad
|
|please help
|huzz
|
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED



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



Re: [PHP] Strange roblems with sessions

2003-06-18 Thread Jeff Harris
|- Original Message -
|From: Logan McKinley [EMAIL PROTECTED]
|To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
|Sent: Wednesday, June 18, 2003 12:51 PM
|Subject: [PHP] Strange roblems with sessions
|
|
| what it is meant to do:
| take a querystring set it to a session variable (outputs error if neither
| querystring nor sesison exist) then reloads the page (to remove the
| querystring)
| what it (appears) to do:
| it sets the querysting to the session, reloads the page and outputs an
|error
| saying it doesn't have the session variable
| if you reload the page with a querystring back in and it works as it is
| meant to
| --  the code in question 
| ?
| session_start();
| if(!isset($_SESSION['HID'])  !isset($_SERVER['QUERY_STRING']))
|  die(There was an error registering your product please call techinal
| support at (111)-111-);
| else if(!isset($_SESSION['HID'])  isset($_SERVER['QUERY_STRING']))
| {
|  $_SESSION['HID'] = $_SERVER['QUERY_STRING'];
|  header(Location: http://localhost/PHP/registration_form.php;);
| }
| ?
| -
| I have attached the actual files if that would be of more help,
| Thanks in advance for any help,
| ~Logan

On Jun 18, 2003, Kevin Stone claimed that:
|
|
|
|Logan,
|
|When you're activating the script through the browser then
|$_SERVER['QUERY_STRING'] is always set.  It is only empty or not empty.  You
|should modify your conditional statements to reflect that..
|
|?
|session_start();
|if(!isset($_SESSION['HID'])  empty($_SERVER['QUERY_STRING']))
|{
|die(There was an error registering your product please call techinal
|support at (111)-111-);
|}
|elseif(!isset($_SESSION['HID'])  !empty($_SERVER['QUERY_STRING']))
|{
|  $_SESSION['HID'] = $_SERVER['QUERY_STRING'];
|  header(Location: http://www.helpelf.com/test2.php;);
|}
|?
|
|This is tested.
|
|HTH,
|Kevin
|

It seems to me, from this thread, and from other recently asked questions,
that people are trying to hide query strings. In this case, unless there
is a reason to do so, change the action to POST then you don't have to
worry about any redirecting.

form method=POST name=form action=Register.php onsubmit=return
validate(this);

In other cases, where an a href.. is followed, it can be turned into a
post as well:

form name=myform method=POST action=validate.php
input type=hidden name=secrethash
value=Secret.HidingFromSourceCode
a href=javascript:void(document.myform.submit())validate me/a/form

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




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



Re: [PHP] mysql_errno codes

2003-06-16 Thread Jeff Harris
On Jun 16, 2003, Thomas Hochstetter claimed that:

|Hi.
|
|[3rd try] ... where can i get mysql_error codes from? The ones that
|mysql_errno returns.
|
|Thanks
|Thomas
|

All mysqld error messages are located into the file
$MYSQL_ROOT_DIR/$LANGUAGE/errmsg.txt (or thereabouts) and listed in
numerical order from 999 to 1175. You can change the output language as
well, issuing the '-L spanish' option for example. See the manual for more
details.

try a $ locate errmsg.txt

Or, if you need them at runtime, try
http://www.php.net/manual/en/function.mysql-error.php

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.





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



Re: [PHP] sessions security (no problems just question)

2003-06-14 Thread Jeff Harris
On Jun 14, 2003, Ryan A claimed that:

|Hi,
|I have been reading up on the old discussions on this list as i was very
|busy for the past few daysand i saw a very intresting topic regarding
|sessions and security.
|
|I really didnt understand some of the things you guys wrote on hi-jacking a
|session...do you have any examples of this?
|How can someone else have the session info of another user?
|after looking at the session id i see that its a long garbled string and
|even if someone is a good guesser...isnt that a very very very long shot? or
|am i missing something?
|
|I looked up on google and i didnt see anything major...
|
|I dont mean to drag this topic up all over again so if any of you have any
|URLs that you think would shed some light on this matterplease do post
|it to me.
|
|This concerns me a lot as I have a very sessions heavy site...which is
|also a kind of paysite/freesite.
|
|Cheers,
|-Ryan

From http://www.php.net/manual/en/print/ref.session.php

There are several ways to leak an existing session id to third parties. A
leaked session id enables the third party to access all resources which
are associated with a specific id. First, URLs carrying session ids. If
you link to an external site, the URL including the session id might be
stored in the external site's referrer logs. Second, a more active
attacker might listen to your network traffic. If it is not encrypted,
session ids will flow in plain text over the network. The solution here is
to implement SSL on your server and make it mandatory for users.

Another way is to monitor session.save_path of another domain on a server
that you have access to. Using some screen scraping techniques it might
not be hard to extract passwords or (using something similar to Amazon's
'one-click' purchasing) to buy a bunch of crap using someone else's money.

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] php editor?

2003-06-14 Thread Jeff Harris
On Jun 14, 2003, M-Ali Mahmoodi claimed that:

|hi all
|i'm a beginner in php
|can anyone help me about useful and powerful editors in php?

vi

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] shopping cart and login system

2003-06-14 Thread Jeff Harris
On Jun 14, 2003, olinux claimed that:

|hi
|
|--- electroteque [EMAIL PROTECTED] wrote:
| hi there , i am about to build a shopping cart which
| will interact with a
| paypal payment system , the cart will use sessions
| to store the items and
| basket information before checking out and posting
| to the paypal form , what
| i'd like to know is would the cart require a login
| system to track users and
| to prevent ppl from making dodgy orders ,
|
|if pure simplicity is a goal, i dont think you need a
|login for customers. who cares if they add items and
|then dont purchase. obviously they would not be able
|to log in again to see the previous orders or current
|order status but you could always implement later.

Actually, to be more simple, for paypal paying customers, I would use
paypal's buy it now buttons. Let them deal with the shopping carts and
sessions.
http://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/rec/singleitem-intro-outside

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] extracting text from text file to be used in PHP

2003-06-13 Thread Jeff Harris
On Jun 13, 2003, Lance Q claimed that:

|Hello all,
|
|One of the sites I host is a radio station. Their computer has been setup to
|automagically upload the current song and the next song to their web site
|via FTP. Unfortunately, the format it comes in is pretty awful. (See below).
|tag
|The CURRENT CutID is: 70428
|The Type is: MUS
|The ArtistName is: Nena
|The SongTitle is: 99 Luft Balloons (German)
|The Duration is: 00:03:48
|/tag
|
|What I would like to know how to do is extract the relevant info (everything
|after the : for instance) and manipulate it, possibly as a variable so that
|$ArtistName=Nena for instance.


http://us3.php.net/manual/en/function.explode.php
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] Headers in body - what am I doing wrong???

2003-06-12 Thread Jeff Harris
On Jun 12, 2003, -{ Rene Brehmer }- claimed that:

|You have an extra \r\n.  There is one contained in the variable $from so the
|line $headers .= From: .$from.\r\n; is putting \r\n\r\n which signifies
|the end of the headers and the begining of the message body.
|
|Stupid me ... so simple, of course ... thanks ... first thing to go is the
|eyes...
|
|Rene

Eyes are the THIRD thing to go. Second is memory. I can't remember the
first thing to go, though.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] 4.3.2 -- does connection_status() actually work?

2003-06-12 Thread Jeff Harris
On Jun 12, 2003, news claimed that:

|Shouldn't the following work - or rather why doesn't it :
|
|
|ignore_user_abort(0);
|
|for( $i=100; $i; $i-- )
|{
|if ( connection_status() ) exit(0);
|print  blurp.br/; flush();
|sleep(1);
|}
|print Done.br/;
|
|This is php4.3.2 on apache 2.0.45.
|/Per

I'm just guessing here, because you didn't give us the desired result,
but how about:
if (connection_status() ) break;

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Downloading a file.

2003-06-11 Thread Jeff Harris
On Jun 11, 2003, Alex Earl claimed that:

|
| If he wants to download, in the file downloadit.php, there is:
| header(Content-type: application/octet-stream\n);
| header(Content-Disposition: attachment; filename=mysoft-1.0-truc.zip);
| header('Cache-Control: public');
| header(Content-transfer-encoding: binary\n);
| header(Content-length:  . filesize($path) . \n);
| $fp=fopen($path, r);
| fpassthru($fp);
|
| But, with IE, it saves the file with [] as:
| mysoft-1.0[1]-truc.zip
| And with Netscape 7.x, it saves the file with the .php extension:
| mysoft-1.0-truc.zip.php
|
That seems to be a Netscape/Mozilla feature. It seems to always save the
file with the source file's extension. I have the same issue sending a
data that should be a .csv file ending up as a .csv.cgi.


| Does anyone know what to do to make it saved as: mysoft-1.0-truc.zip
|
| And I would like to display a page telling Thanks for download or
| something...but if I had to the end:
| header(Location: http://www.mywebsite.com/thanks.html;) ;
| I does not work :(

header(Location:...); must not be sent after any html, so you won't be
able to redirect that way.

|
| Does anyone know how change the location and is there is anyway to know
| if the download has been perfomed 'till the end...
|
| Thanks,
| Vincent.
|
|There is no way to tell if the download completes, I don't think, that is
|a client side thing that if you send the content-length header it should
|know if the file downloaded successfully or not, the browser does not send
|a success signal back. Also, if you put quotes around the filename in
|the Content-Disposition header, it will save the file with the exact
|filename you specify, the RFC doesn't specifiy that it has to be this way,
|but I have found that putting quotes around it makes it work for pretty
|much any browser I have tried.
|

Perhaps if you know approximately how much time it takes to download the
file, you can use a meta http-equiv=refresh... to redirect to a
thanks for downloading page, with a link back to the download.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.




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



RE: [PHP] .htaccess

2003-06-10 Thread Jeff Harris
On Jun 9, 2003, John W. Holmes claimed that:

| Just one question, is there any way that when a person logs in via the
| htaccess popup that i can know via my php script...and can i also get his
| username?
|
|Have you read the chapter on HTTP Authentication? No. Read the very
|first paragraph:
|[snip]
|You're welcome.
|
|---John Holmes...

I love the brutal honesty on this list. Anywhere else in the world you
would be looked on as evil or mean-spirited, but on a maling list,
you're [sometimes] older and wiser, and know how to do a search for php
http authentication.

Jeff
-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



[PHP] popen() in 4.3.2

2003-06-08 Thread Jeff Harris
My webhost just upgraded to php 4.3.2, and now I have a problem with
popen. I'm opening an output buffer then piping it through htmltidy to
make nice looking output.

?php
ob_start();
// Other unimportant coding goes here

 $str=addslashes(ob_get_contents());
 $fp=popen(echo \ . $str . \ | /bin/tidy - config /my/home/htmlrc, r);
 @$newstr=fread($fp, 99);
 ob_end_clean();
 header(Last-Modified:  . $gmt_modtime);
 header( Content-length:  . strlen( $newstr ) );
 echo stripslashes($newstr);
?


This code worked perfectly before the upgrade, now strlen( $newstr ) is
only getting back 4096 bytes. Is anybody else having this issue, and how
can I fix this? I don't see any configuration setting that looks like it
fits to this situation. It is running under redhat with Apache/1.3.27

Thanks, Jeff
--
Registered Linux user #304026. lynx -source
http://jharris.rallycentral.us/jharris.asc | gpg --import Key fingerprint
= 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this
message should conform to RFC 1855.



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



Re: [PHP] popen() in 4.3.2

2003-06-08 Thread Jeff Harris
Wow. 6 minutes for a response. Of course, I thought my error was in the
popen(), not fread(), so I didn't even check there. I've just fixed the
code, and it works! Thanks, Philip.


On Jun 8, 2003, Philip Olson claimed that:

|
|PHP 4.3.0-1 has a bug that made your previous code work,
|have a look at the fread() docs for why, here's a quote:
|
|  Note:  When reading from network streams or pipes, such
|   as those returned when reading remote files or from
|   popen() and proc_open(), reading will stop after a packet
|   is available.  This means that you should collect the data
|   together in chunks as shown in the example below.
|
|It goes on to show that you must loop threw it to get
|fread() to do what you want in the below code.  Although,
|the example it eludes to is wrong (a correct example will
|show when the manual next builds), you get the point... :)
|
|Regards,
|Philip
|
|
|On Sat, 7 Jun 2003, Jeff Harris wrote:
|
| My webhost just upgraded to php 4.3.2, and now I have a problem with
| popen. I'm opening an output buffer then piping it through htmltidy to
| make nice looking output.
|
| ?php
| ob_start();
| // Other unimportant coding goes here
|
|  $str=addslashes(ob_get_contents());
|  $fp=popen(echo \ . $str . \ | /bin/tidy - config /my/home/htmlrc, r);
|  @$newstr=fread($fp, 99);
|  ob_end_clean();
|  header(Last-Modified:  . $gmt_modtime);
|  header( Content-length:  . strlen( $newstr ) );
|  echo stripslashes($newstr);
| ?
|
|
| This code worked perfectly before the upgrade, now strlen( $newstr ) is
| only getting back 4096 bytes. Is anybody else having this issue, and how
| can I fix this? I don't see any configuration setting that looks like it
| fits to this situation. It is running under redhat with Apache/1.3.27
|
| Thanks, Jeff
| --

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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