Re: [PHP] Multiple cookies on the same computer

2009-03-26 Thread dg


On Mar 26, 2009, at 7:14 PM, Ken Watkins wrote:

To keep up with their identities, I created a script for each family  
member to run (dad.php, mom.php, etc.), and it sets a cookie on each  
computer and uses sessions so I know who is connecting.


Each family member only uses her/his own page?  Maybe set a unique  
cookie name based on each page?


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



Re: [PHP] Having trouble with a form to mail script.

2009-03-22 Thread dg


On Mar 22, 2009, at 12:46 PM, Linda Stark wrote:

what you guys thought about the PHPMailer-FE from

http://phpmailer.codeworxtech.com/index.php?pg=phpmailerfe


I'm not familiar with this.

You might want to check with your web provider. I'm with Pair and they  
make security recommendations for code and pre-made scripts.




if you want to accept html mail,
use this script, but he does not recommend
it because when browsers are configured to not accept html mail  
there should

also be a text alternative anyway.


That would depend on what the form is for.  If the results are only  
going to a few people, and they accept HTML, it shouldn't be a  
problem.  It is safer that way too, so your form can't be used to send  
off email to everywhere.


There's an awful lot of variables to consider.  This is a good start:
http://shiflett.org/blog/2005/dec/essential-php-security-forms-and-urls





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



Re: [PHP] ruby / rails within a php site

2009-03-03 Thread dg
If it's html that Ruby generates, you could probably call that file as  
an include?


Something like...

$ruby = file_get_contents('rubyfile.html');

then where ever in the document you want that content use:
?php print $ruby; ?

On Mar 3, 2009, at 9:56 PM, ravi Ruddarraju wrote:

I have a regular php site. I also have a ruby / rails application.  
Now I
want to put the HTML generated by ruby / rails application within a  
div
section of a php page. This should be similar to like calling a php  
function

within a div section, which would produce the HTML output of the php
function.
Is such a thing possible between php and ruby / rails? Any help will  
be

appreciated.

Thanks
ravi



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



Re: [PHP] piecing together basic knowledge of paypal nvp api PHP - to work together

2008-12-01 Thread dg


On Dec 1, 2008, at 5:50 PM, Govinda wrote:

I am successfully using the sample scripts paypal provides, but  
moving towards our own solution,


You might have better luck with custom solutions for Paypal at: 
http://www.paypaldeveloper.com/pdn/

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



Re: [PHP] is there a problem with php script pulling HTML out of database as it writes the page??

2008-07-15 Thread dg


On Jul 15, 2008, at 3:06 PM, Rod Clay wrote:

All of the text is being correctly retrieved from the database and  
written to the page, including the img src=xxx statement,  
because I see it all in the page source of the page in my browser.   
However, the img src= statement is NOT working, that is,  
the image does NOT appear on the page.


What exactly is it printing? What is the doctype?


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



Re: [PHP] is there a problem with php script pulling HTML out of database as it writes the page??

2008-07-15 Thread dg
It would be helpful if you could clarify the error you are getting,  
but could be something involving quotes, stripslashes() and  
addslashes();



On Jul 15, 2008, at 2:36 PM, Rod Clay wrote:

Hello.  Again, I'm fairly new to php so please forgive me if my  
question is a very simple or obvious one.


I've just tried testing for the first time some php code that is  
pulling text out of a database to print it on the webpage.  Some of  
this text includes HTML, specifically in this case an img  
src=x statement.  Much to my surprise, this is not  
working.  Is there a problem with pulling HTML out of a database  
like this as the page is being written?
There's no problem of course if my php code is writing the HTML to  
the page - in this case, the img src=xx statement works fine  
and the image is displayed.  Why is it a problem when my php script  
pulls the HTML code out of a database and writes it to the page from  
there??


It would appear that when my php script writes HTML to the page a  
process of some kind is executed to, in this case, get the image and  
put it on the page.  Apparently this same process is NOT executed if  
the HTML is retrieved from a database and simply written to the page  
from there.  Is this correct?  And, if it is, can anyone suggest a  
workaround, another way to get done what I'm trying to do here?


Thanks for any help you can give me.

Rod Clay



--
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] string comparison

2008-07-13 Thread dg


On Jul 13, 2008, at 9:17 AM, Sudhakar wrote:


hi

i am writing a small application where a user enters a phrase in the
textfield and i would like to display all the files present in the  
root
directory which consists of the keyword or keywords entered by the  
user.


i have used a few comparison functions but i am not getting the  
expected

result.


I use this script to list archive files from a directory based on  
keyword.  I'd guess a modified version using the keywords from users  
might work:


// create archives box
if ($handle = opendir('../diaryarchives/')) {
while (false !== ($file = 
readdir($handle))) {
$pos = strpos($file, diary_);
$pagemarked = diary._;
if ($pos !== false) {
//print $filebr;
$file_name = ereg_replace 
($pagemarked,,$file);
$file_name = ereg_replace 
(.php,,$file_name);
//print * $file_namebr;
//print $filebr;
			$archive_list_gather[] = 'lia href=/diaryarchives/'. 
$file.''.$file_name.'/a/li';

}
}
closedir($handle);
}
rsort($archive_list_gather);
foreach($archive_list_gather as $value) {
$archive_list .= $value;
}
// build archives box
$archives_box = 'div id=diary-archives
h3 class=sideimg src=/images/h3s_diaryarchives.gif  
alt=Diary Archives width=225 height=20 //h3

ul
'.$archive_list.'
/ul
/div';

// publish archives box
$filename = PATHA.'/diaryarchivesbox.php';
publishpages($archives_box, $filename);


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



[PHP] include_path, permissions question

2008-07-10 Thread dg

Hello,

I'd greatly appreciate some help with some problems I'm hitting.

I have a site set up on a dev server and it works fine.

In transferring it to the clients server, it's getting all weird.

When I first transferred created files, the owner was joe.  And they  
worked fine.


When I republished those files using fwrite, the owner changed to  
httpd.


And includes and file_get_contents stopped working.

I tried changing the owner, but couldn't.
I changed include_path.


I turned on error reporting and got:

Warning: include(includes/common.php): failed to open stream:  
Inappropriate ioctl for device in /**/local/home/**/dev.**.net/ 
alb**acl.php on line 5


Warning: file_get_contents(): SAFE MODE Restriction in effect.  The  
script whose uid/gid is 398/398 is not allowed to access includes/ 
lyrics_box_scripts.txt owned by uid/gid 191739/191739 in /**/local/ 
home/**/dev.**.net/alb**acl.php on line 11



Thanks in advance for any assistance.

-dg



Re: [PHP] Re: What font/size do you use for programming?

2008-07-10 Thread dg

On Jul 10, 2008, at 9:33 PM, Robert Cummings wrote:


On Thu, 2008-07-10 at 16:29 -0500, Philip Thompson wrote:

On Jul 10, 2008, at 3:35 PM, Omar Noppe wrote:


Is there any reason to pick a black background en white fonts in
your editor (for example writability)?


I think a black background is much easier on the eyes


And on the environment since the energy needed to sustain it is lower.

Cheers,
Rob.


I find if I read stuff on a black background, I start seeing fuzzy  
streaks.  I do use a light grey to edit in though.


Be cool to see screenshots of people's set-ups.  The light grey is the  
only alteration I've ever made from BBedit's default settings.


-dg



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



Re: [PHP] Re: What font/size do you use for programming?

2008-07-10 Thread dg


On Jul 10, 2008, at 10:31 PM, Robert Cummings wrote:


http://www.interjinn.com/bleh/snapshot.20080711.png


very kewl. Maybe I'll ask Rich Siegel to pose shirtless for my BBedit  
background...


I'm used to line numbers along the side, especially given all my  
errors, how do you zoom in on them without seeing them there?


-dg


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



Re: [PHP] how can make like http://wallpaper.pc86.com ?

2008-02-02 Thread dg

Looks like Treeview

http://developer.yahoo.com/yui/treeview/


On Feb 2, 2008, at 1:33 PM, RandMan wrote:


how can make like http://wallpaper.pc86.com ?

look like XP file manager, any body have idea ?
i feel this so simple, but i have't any direction

thank you !

--
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] Digital Downloads and Scale

2008-01-20 Thread dg

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



Re: [PHP] looping through a $_POST variable

2007-12-30 Thread dg

You might want to check the loop alone and check each value of $value:

$array = explode(' ', $_POST['emails']);
foreach($array as $value) {
print '$value'br;
}

if it works that way, at least you narrow down the possibilities of  
weirdness.


On Dec 30, 2007, at 5:34 PM, Richard Kurth wrote:


When I do a var_dump($_POST['emails']); it has all the emails in it
string(65) [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] 


I will validate the emails after I get the loop to work
$memberid comes from a part of the script I did not show you   
$memberid =$_POST[members_id];

safe_query  is a function that I call that does query stuff

function safe_query ($query = ){
   include (dataconf.inc.php);
   dbconnect($dbname,$rootusername,$rootpassword,$roothostname);
  global$query_debug;

  if (empty($query)) { return FALSE; }

  if (!empty($query_debug)) { print pre$query/pre\n; }

  $result = mysql_query($query)
  or die(Query Failed: 
  .lierrorno=.mysql_errno(). br
  .lierror=.mysql_error(). brbr
  .liquery=.$query
  );
  return $result;
}


On Sun, December 30, 2007 5:29 pm, Richard Kurth wrote:

I am trying to loop through a $_POST variable.   It comes  from a  
text
area and it will have data like many email address or just one  
listed
with a space or on a new line. I can't seam to get the data to  
extract

properly. I have tried this below

$array = explode(' ', $_POST['emails']);



//see what you have.
//maybe it's not hat you think
var_dump($_POST['emails']);




foreach ($array as $value) {



//you should probably validate the emails using:

http://php.net/imap_rfc822_parse_adrlist

$value_sql = mysql_real_escape_string($value);



$sql = SELECT id FROM contacts where emailaddress = '$value' AND
members_id = '$memberid';



Use '$value_sql' here.

And I dunno where $memberid came from, but maybe it should be escaped
as well.



$sql_result=safe_query($sql);



I'm not sure what safe_query is doing, and maybe you think it can
escape the data you embedded into the SQL, but I don't see how you  
can

do that...  Sort of a Humpty-Dumpty problem...



while ($row=mysql_fetch_array($sql_result)){
$id = $row[id];
$sql1=UPDATE contacts SET emailstatus ='Unsubscribed' WHERE id =
'$id';
safe_query($sql1);
}}







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