RE: [PHP] Windows Authoring Tools

2002-09-12 Thread Dave at Sinewaves.net



In the past I've been using TextPad and UltraEdit but really want
something that picks up on PHP syntax and function spelling (eg
Homesite would 'bold' a function word if it was splt correctly).



Just download the PHP syntax file for TextPad.

Dave




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




RE: [PHP] Re: Generating CSV files on the fly and getting the browser to download

2002-09-10 Thread Dave at Sinewaves.net

try making the generated csv file an attachment to the php file...  like
so...



usually works for me.

incidentally, what browser version are you using?  on what os?

dave


-Original Message-
From: Henry [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 2:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Generating CSV files on the fly and getting the
browser to download


It didn'ti work ;-(

Just showed a page with the data in!

How would I do it with a file in any case?

Henry

"Lallous" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try this:
>
>  $fileextension="csv";
> $filename="report";
> $fnsave = "$filename.$fileextension";
>
> header("Content-disposition: filename=$fnsave");
> header("Content-type: application/force-download");
>
> // generate your CSV content here and print them to the browser via ECHO
> echo 'a,b,c,d,1';
> //.
>
> ?>
>
> Elias
>
> "Henry" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi All,
> >
> > I suspect this is a commonly asked question but; how do I generate a CSV
> > files on the fly and get the browser to download it.
> >
> > Do I actually need to generate a file or can I just generate a variable
> > contain the data that would be in the file?
> >
> > Any help is greatly appreciated.
> >
> > TIA
> >
> > Henry
> >
> >
>
>



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


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




RE: [PHP] Re: Proposal for securing PHP sessions

2002-09-07 Thread Dave at Sinewaves.net

You're going to be shutting out a lot of AOL users (bah! who needs em! ;p)
if you do that, as AOL changes a user's IP address about as often as you
read the word "the"...

Dave


-Original Message-
From: M1tch [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 07, 2002 12:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Proposal for securing PHP sessions


Why not just use IP?
I created a nice system, whereby if your IP is changed (or someone is
hacking your session), the session is destroyed, and the user must log in.
Does not add much overhead either.

Also, I built it using database (using my own session functions in
savehandler), that stores the ip as well.
This prevents people snooping.

Still not 100% secure I imagine, but much better.

Andy

"Mar Tin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Dear all:
>
> Until I read the article "PHP Session security"
> (http://www.webkreator.com/php/configuration/php-session-security.html)
> I haven't noticed how insecure PHP Sessions are.
>
>
>
> Basically there're 2 problems:
>
> *) It's possible to hijack a session if you know the
> SID (session id)
>
>  1) If you're on a shared server (cheap webhosting)
> other users can get the SIDs by doing "ls /tmp/sess_*"
> (/tmp/ is defined on session.save_path on the config
> file, so it may be different).
>
>  2) When a user clicks on an external link, the
> browser sends the REFERER url and sometimes it
> contains the SID (if session.use_trans_sid is enabled)
>
> PHP offers a security measure: with
> session.referer_check it will reject SIDs comming from
> other referers, but the referer url can be easily
> forged.
>
> *) Users can read session data from the session files,
> which are owned by the server process (every user
> which has an account on the webserver can read server
> owned files)
>
> (If you're intrested in the subject I would recommend
> to read full the article:
> http://www.webkreator.com/php/configuration/php-session-security.html)
>
> I have developed some functions to avoid this
> problems. They replace the standard session functions
> (using session_set_save_handler), so you only have to
> include the file at the beggining of your script and
> (afaik) you're safe :)
>
> This is the idea:
>
> Apart from the session cookie, I set another one (with
> the same name and the string '_sec' appended). On this
> cookie I set a random KEY.
> The name of the file which contains the session data
> is the md5 hash of the SID and the KEY together. This
> turns impossible to guess the session id by looking at
> the filenames.
>
> To hide the data inside the file, the serialized
> string is crypted using the KEY as password, so nobody
> can see the content of your user's sessions.
>
> You can find the code here:
> http://www.n3rds.com.ar/files/docs/php_sessions/sess_handler.txt
>
> Im looking for suggestions to make it 100% compatible
> with the standard session functions, and I would like
> to hear some thougts about the idea
>
> Martin Sarsale
> [EMAIL PROTECTED]
>
> __
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com



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


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




RE: [PHP] Image Resizing ... lets try this again.

2002-09-06 Thread Dave at Sinewaves.net

search the archive - i posted a gd1 solution about 2 or 3 weeks ago...

dave



-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 7:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Image Resizing ... lets try this again.


I sent this email out earlier this morning and got no response. It was quite
early so I thought I would send it again now that more people are hopefully
at work :-)





I have been trying to figure out the best way to resize photo quality images
to thumbnail size and have them come out looking good. I have read about the
function "  >

imagecreatetruecolor()" and it looks like it may do this. However I do not
have GD 2 installed which is required for this function to work. In the
process of trying to figure out how to install GD v2 I came across the
following page.



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


 >



On this page is says;







 "Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled
version has some additional features like alpha blending and should be used
in preference to the external library since it's codebase is better
maintained and more stable."







I thought the most recent version of php was 4.2.2?







Anyway if there is a better way to resize images to create "high quality"
thumbnails I would love to hear about it. I am on a redhat 7.3 server and
not very familiar with linux. I would prefer not to have to take the time
involved in learning how to install new packages right now, but realize this
may be unavoidable.







Thanks in advance for any help.





























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




RE: [PHP] cant find the wrong?

2002-09-06 Thread Dave at Sinewaves.net

you're missing an equals sign.

try this:


dave

-Original Message-
From: Meltem Demirkus [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 1:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] cant find the wrong?




> Hi,
> I am using this on a page to move  'new_id' to another page:
> 
> 
> 
> and onthe other page I qm tring to get the data like this:
> 
> $id= $_POST['id'] ;
> 
> even I tried 

 echo $new_id;  (directly use the data)
> but it is not working..WHY?
> 
> 
> thanks 
> meltem demirkus
> 


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


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




RE: [PHP] mail() function problem

2002-08-31 Thread Dave at Sinewaves.net

Most mailing lists reject mail if the Subject is blank.

That would probably explain why your subjectless 2nd example is disappearing
into the void.

Dave



-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 31, 2002 3:20 AM
To: Akhmad D. Sembiring; [EMAIL PROTECTED]
Subject: Re: [PHP] mail() function problem


I think mailing list managers like Yahoo, ezmlm, etc all have "features" in
them to suspect bots and programs from subscribing/posting to the groups.  I
know I've had trouble subscribing/posting to groups managed by ezmlm...

Probably there is a header or two that PHP automatically sets which makes
the mailing lists suspicious... or something!! I don't know enough about
email to really come up with an answer!!!

You could try setting some headers similar to what your email client sets,
to see if it's something "missing"... or try sending yourself an email from
a php script and analysing the headers it sets.

It could also be the lack of a return address or something similar that
throws the lists off too.


Justin


on 31/08/02 6:32 PM, Akhmad D. Sembiring ([EMAIL PROTECTED]) wrote:

> Dear All,
>
> I have a little problem with mail() function,
>
> PHP Code:
>
> --
> mail($email, "Membership ok", $themsg,
> "From: [EMAIL PROTECTED]\r\n");
>
> mail("[EMAIL PROTECTED]",
> "", "", "From: $email\r\n");
> --
>
> Why does the second mail() function did not ever send the email to
> yahoogroups?
>
> I wonder, can the mail() function be put in a loop structure (that
traverse
> an array of emails) and send all emails successfully?
>
> Thanks for your advice,
>
> Daniel
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02
>


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


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




RE: [PHP] how to have a form keep values when user hits back button?

2002-08-30 Thread Dave at Sinewaves.net

A better, NON-CLIENT-SIDE way to do it, is you could have the page you're
submitting to write the POST values to a session.

So the top lines of your form handler page would be something like:

 $val)
{
if($val != '')
{
$HTTP_SESSION_VARS[$key] = $val;
}
}
?>

And on your form page, populate the VALUE fields of the form with
conditional statements evaluating the session variables.  Like so:



...or a quick n dirty way (suppressing errors):



For checkboxes, it's just a minor change:
>


One caveat to consider:

If the user returns to the form and changes checkbox values to the unchecked state, 
when the form is posted the variable will not be reposted with an empty value.  Form 
checkboxes only post if they are checked, and then they evaluate to 'on' - if it is 
unchecked, there will be no $HTTP_POST_VARS value for that field.  So in the above 
session writing code, before you set the session variables with the POSTed data, you 
should loop through all of the existing session vars, setting them to ''.  Take care 
to exclude the variables that you are using to keep the user authenticated, or to 
store the other data that you will need site wide.  Like this:

 $val)
{
// just an example of some session vars you might include
$persistent_sitewide_session_vars = array ('loggedinstatus', 'userid', 
'browser');

// well use a counter to make sure we're keeping track correctly
$counter=sizeof($persistent_sitewide_session_vars);

// Loop through each of your persistent 
// site-wide session vars
foreach($persistent_sitewide_session_vars as $key_p => $val_p)
{
// if the current session var is one of 
// the session vars you need site wide, 
// set it to itself and exit loop
if($HTTP_SESSION_VARS[$key] == 
$persistent_sitewide_session_vars[$key_p])
{
$HTTP_SESSION_VARS[$key] = $val;
break;
}
$counter--;
}

// if you know you looped through all the variables
// and none of your persistent variables were found, 
// it's safe to reset the session var to a blank var
if($counter == 0)
{
$HTTP_SESSION_VARS[$key] = '';
}
}


// NOW YOU CAN ADD YOUR CODE TO SET SESSION VARS 
// WITH THE POSTED FORM VARIABLES

?>


It's a bit bulky, but it does work like a charm.  Remember to add start_session() to 
the top of the form page if it's not there already!

Happy form hacking!

Dave



-Original Message-
From: Brent Baisley [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 30, 2002 6:12 AM
To: Jean-Christian Imbeault
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] how to have a form keep values when user hits back
button?


As others have probably told you, you can't rely on the back button and 
don't try to disable it, it's part of the user interface. The user 
really needs to live with the fact that if they leave the page, they 
will lose the data entered.

However, there is a way to retain the data as they enter it. You can use 
Javascript to write the data to cookies as they enter it. This means 
setting traps on every field, checkboxes and radio button would have an 
onClick, data entry fields would have an onBlur (is that write?). So as 
they enter the data, it is save in local cookies.
You would also want to add an onLoad trap on the page to check for and 
read the cookies if present to populate the fields. Most people aren't 
used to cookies management via Javascript, so it may be a little 
daunting at first. But this will work. If cookies javascript
 are enabled
that is.


On Thursday, August 29, 2002, at 05:22 AM, Jean-Christian Imbeault wrote:

> I have php page that creates an html form. When the user hits the
> submit button another php script is called to parse the form and
> display some output.
>
> However I find that if I hit the back button the form values get reset.
> How can I make it so that if I hit the back button the values I entered
> in the form will still be displayed?
>
> Jc
>
> -- PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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


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




RE: [PHP] Average Number For Math Functions

2002-08-29 Thread Dave at Sinewaves.net

if i remember 4th grade math class correctly...

 $value)
{
$total += $array_of_the_numbers[$key];
++$count;
}

// wow, that's a toughie!
$average = $total / $count;

// then you could make it pretty
$pretty_average = number_format($average, 1);
?>

booyah. :)

dave



-Original Message-
From: JohnP [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 5:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Average Number For Math Functions


Ok I looked at all the math functions for PHP but saw no way of returning
the average of a set of numbers - I plan on using this for a rating system -
any help?

--
John


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




[PHP] Numbers to Roman Numerals - Native PHP Function?

2002-08-25 Thread Dave at Sinewaves.net

Does anyone know if there is a native function within PHP to convert numbers
to roman numerals?

I could easily write a little convertor, but I was hoping there was an
simple function - although I couldn't seem to find anything like that in the
manual.

Dave


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




RE: [PHP] GD lib. image quality!

2002-08-25 Thread Dave at Sinewaves.net

 imageCreate will create an image, but its palette will be very limited, so
when you try to copy your photo onto it, it will maintain the palette of the
original picture.  Obviously, this is not what you want, since the picture
comes out looking all grey and faded (probably 8-16 colors!).

What works for me is creating a blank image using imageCreate(), then saving
it as a temporary jpeg (using imageJpeg). This action will set the palette
of the image to a jpeg's palette (close to 16-bit or better colorspace).  If
you imageCopyResized over this temp.jpg (which you need to create whenever
you run the script to ensure sizing is perfect), it will come out with the
full palette of colors.

Pseudo code:



Then all you have to do is a little cleanup with imageDestroy() and you
should have a nice looking thumbnail!


I usually add a line like this to the script to make sure everything went
smoothly:
Thumbnail Generator'
.''
.'';
?>

It lets me see the quality of the thumbnail the second the script completes.


Try it - you'll get perfect thumbnails every time.  I used this technique
for all of the pictures at www.arkestraclandestina.com with GD1.6 - and all
of them actually had custom color profiles!  Works like a charm.

I like this method because I can be sure that the script won't break on
sites with older PHP and GD versions - which is an important consideration
when you're deploying applications to other sites...

However!  If you are sure it will only be run on a PHP4, GD2 system, you can
avoid all of the temp jpg madness altogether by just altering your code to
use imageCreateTrueColor() instead of imageCreate()!!  ;P  Easy as pie!

Dave



-Original Message-
From: Arcadius A. [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 25, 2002 4:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] GD lib. image quality!


Hello!
I wrote a little script for generation thumbnails of larger images

$origImage = imageCreateFromJpeg($sourcePath."/".$currentImageName);
$thumbnail = imageCreate($thumbWidth,$thumbHeight);// create empty image

imageCopyResized($thumbnail,$origImage,0,0,0,0,$thumbWidth,$thumbHeight,imag
esX($origImage),imagesY($origImage));
imageJpeg($thumbnail, $targetPath."/".$thumbNamePrefix."_thumb.jpg"); //
Store it
imageDestroy($thumbnail); // cleanup
echo "Image ".$targetPath."/".$thumbNamePrefix."_thumb.jpg"."
created successfully!";



then, I've noticed that the quality of the thumbnails created is very bad!
my "phpinfo()" page shows  "2.0 or higher" as GD version

So, I'm wondering whether I'm doing something wrong in my code or whether
there exist a better library to use with PHP ... a library able to generate
good quality JPG files...

Thanks in advance.

Arcadius.




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


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




RE: [PHP] count link clicks

2002-08-13 Thread Dave at Sinewaves.net



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 12:23 PM
To: 'Rasmus Lerdorf'; 'vic'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] count link clicks


I think I'm on the right track with:


New paragraph

';

// Isert form html into $data_fields variable
$data_fields = '

New paragraph
';


// CHANGE THIS:
//
// while ($i = $value) {
// echo $data_fields;
// }
//

// TO THIS:
for($i=0; $i<$add_form; $i++)
{
echo $data_fields;
}

?>

The only problem is that it runs for an infinite number of times, I want
it to run for as many times as the http://domain.com?add_form=1 (IE: 1
in this case) defines.

- Vic

__ 
Post your ad for free now! http://personals.yahoo.ca

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


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




[PHP] Win PHP Editor...

2002-08-09 Thread Dave at Sinewaves.net

Just have to add one little fine piece of free software that nobody's
mentioned yet, Crimson Editor (http://www.crimsoneditor.com )

No code completion, but it's got every other feature of the big commercial
beasts... definitely check it out - I just switched over, and it's great.


>From the site:
--
Edit multiple documents
   - switch between documents using file selection tab
   - pressing Ctrl+Tab brings the last accessed document to top

Syntax highlighting
   - configurable via custom syntax files
   - preconfigured for more than 50 computer languages

Multi-level undo / redo
   - all editing actions are recorded from the opening of a file
   - unlimited undo and redo buffers

Find & Replace
   - replace specified text one by one, or as a whole
   - support regular expression

Natural word wrapping
   - word wrapping does not affect syntax highlighting
   - configurable wrapping indentation (easer to understand the syntax)

Spell checker
   - around 10 words were added in the dictionary
   - users can register new words in their own dictionary
(InstallDir/user.dic)

User tools and macros
   - execute external programs with proper arguments
   - compile, execute and test your code
   - ease your fingers with key stroke recording (record & replay)

Directory tree view window
   - click to open documents
   - filter to display only selected file class

Edit remote files directly using built-in FTP client
   - open, edit, and save documents in remote FTP servers
   - save account information (encoded) for automatic logon

Print & Print preview
   - configurable page header and footer
   - print with line numbers
   - print with syntax highlighting (used in color printer)
   - true type font selection for printer

Other useful features
   single instance / multiple instances, ability to detect changed files,
   bookmark & go to, highlight active line, highlight matching pairs,
   multi-byte support with integrated IME (for eastern languages),
   auto indent, wheel mouse support, copy & paste, line numbers,
   configurable line spacing, option to save files in Unix format,
   option to set working directory




Very nice little IDE, and the price is right! Nothing!

Dave


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




RE: [PHP] Banner Ad Serving...

2002-07-23 Thread Dave at Sinewaves.net

Here's the URL for mod_layout if anybody's interested...

http://software.tangent.org/projects.pl?view=mod_layout

It's powerful, but just a little heftier than what I want.  Since all I need
is .html and .htm support, I think I'm just going to end up modifying my
http.conf - I'd rather mess with Apache a little versus giving PHP another
mod to stress over.

PHP makes a good pipe.  :D

Thanks again, everybody.  I love this list!

Dave



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 11:13 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Banner Ad Serving...


On Wednesday 24 July 2002 12:07, Dave at Sinewaves.net wrote:
> I think you may have it on that one!  You get the gold star! :)
>
> Thanks for the help -- I probably would have banged my head against my
> keyboard for another week or so before I thought of that!

Or you can use something called mod_layout.

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

/*
I'm not even going to *__bother* comparing C to BASIC or FORTRAN.
-- L. Zolman, creator of BDS C
*/


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


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




RE: [PHP] Banner Ad Serving...

2002-07-23 Thread Dave at Sinewaves.net

I think you may have it on that one!  You get the gold star! :)

Thanks for the help -- I probably would have banged my head against my
keyboard for another week or so before I thought of that!

Dave

-Original Message-
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 9:06 PM
To: Dave at Sinewaves.net; [EMAIL PROTECTED]
Subject: RE: [PHP] Banner Ad Serving...


Tell apache that .html files are to be served through php

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Dave at Sinewaves.net [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 11:00 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Banner Ad Serving...


That works fine for files with .php extensions, but I need something to add
code to html pages as well...  Any ideas???

Dave



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 8:55 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Banner Ad Serving...


On Wednesday 24 July 2002 11:47, Dave at Sinewaves.net wrote:
> Is there any way of automatically adding a certain bit of code to every
> page on a web server (or within a given directory)?

php.ini --> auto_prepend_file, auto_append_file

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

/*
An eye in a blue face
Saw an eye in a green face.
"That eye is like this eye"
Said the first eye,
"But in low place,
Not in high place."
*/


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


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



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


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




RE: [PHP] Banner Ad Serving...

2002-07-23 Thread Dave at Sinewaves.net

That works fine for files with .php extensions, but I need something to add
code to html pages as well...  Any ideas???

Dave



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 8:55 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Banner Ad Serving...


On Wednesday 24 July 2002 11:47, Dave at Sinewaves.net wrote:
> Is there any way of automatically adding a certain bit of code to every
> page on a web server (or within a given directory)?

php.ini --> auto_prepend_file, auto_append_file

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

/*
An eye in a blue face
Saw an eye in a green face.
"That eye is like this eye"
Said the first eye,
"But in low place,
Not in high place."
*/


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


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




[PHP] Banner Ad Serving...

2002-07-23 Thread Dave at Sinewaves.net

Is there any way of automatically adding a certain bit of code to every page
on a web server (or within a given directory)?

As in, is there any kind of Apache-specific PHP stuff that will add a banner
ad or copyright notice to pages (without editing the actual pages themselves
and without changing their file names)?  I've looked around a bit, and I
can't seem to brainstorm how it could be done.

Any help will be greatly appreciated (with good karma to boot). :)

Dave


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




[PHP] parsing

2002-07-23 Thread Dave at Sinewaves.net

Okay,

I want to know if anybody has a clue which is more efficient,
processorwise/parsingwise:

this:
--
echo
"".$somevar."".$somevardesc."";

or this:
--
echo "{$somevar}{$somevardesc}";


I almost always use the first method (just seems more readable to me), but
with all of the discussion popping up about curly brackets, i was wondering
if it really makes a difference?  Any vets out there care to put in their
$0.02?

Dave Tichy
http://sinewaves.net/


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




[PHP] NEVERMIND! [PHP] problems with variable variables...

2002-07-12 Thread Dave at Sinewaves.net

Nevermind!

I figured out the curly bracket syntax...

Doh!  It was buried in the manual the whole time!

Dave

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




[PHP] problems with variable variables...

2002-07-12 Thread Dave at Sinewaves.net

I'm having a huge problem with getting variable variables to work.

Here's what the code looks like...

// This is set from a previous array...
/
$the_variablename[0] = "processors";

// Now I include a file called vars.processors.php
// (which contains an array called processors[] )
/
include("vars.".$the_variablename[0].".php");

Everything works fine so far.  Then i make the variable variable, and the
shit happens.

// I want to set a javascript array value - already
// set up in the script...
// So I want to retrieve a value from the included
// file dynamically and create a javascript statement
// like this:
//  processors[0] = (whatever the value of $processors[0] within the
included file)
/
echo $the_variablename[0]."[0] = ".$$the_variablename[0][0].";\n";


And what do I get for wanting total control and dynamic code??
Undefined variable.

Is it because i'm accessing an array within the array?

Should I be calling it as:
$($the_variablename[0])[0]
or
$$the_variablename[0][0]

or do I need to establish a separate temp variable to take care of the array
value, like this:
$temp = $the_variablename[0];
echo $$temp[0];


Please help!!?!

Dave


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