[PHP] Re: php framework, large site

2007-06-17 Thread itoctopus
cakephp is not bad, why write your own?

-- 
itoctopus - http://www.itoctopus.com
martins [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 hi, can some body help me, how to start php framwork for large site? 

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



[PHP] Re: PHP Form isnt emailing me

2007-06-08 Thread itoctopus
Remove the @ next to the mail function, probably there's a warning 
somewhere. Additionally, are you sure that your mail server is actually 
working?
-- 
itoctopus - http://www.itoctopus.com
Austin C [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hello, I just finished making a PHP contact form for my webite, and I can
 run through the whole thing, and get no errors, but it doesnt email me the
 form contents.

 *Here is th actual form page:*
 ?php include(../header.php); ?
   td bgcolor=#BFC4CBbfont color=#33Contact
 Me/font/b/td
  /tr
 /table
 /td
/tr
tr
td bgcolor=#BFC4CB
 p
 font color=#33
 Please use this form to contact me:
 p
 brcenterform action=processcontactform.php method=post
 Name: input type=text name=name size=20
 brEmail Address/Method of Contact: input type=text name=contact
 size=30
 brReason for Contact: select name=reasonforcontact
 option value=questionQuestion/option
 option value=suggestionSuggestion/option
 option value=gcommentGeneral Comment/option
 option value=fanmailFan Mail/option
 option value=otherOther/option
 /select
 brMessage: brtextarea name=message1 rows=10 cols=30/textarea
 brinput type=submit value=send
 /form/center
 ?php include(../footer.php); ?

 *Here is the form page processor:*
 ?php include(../header.php); ?
 td bgcolor=#BFC4CB
 b
 font color=#33Processing your information . . ./font/b/td
   /tr
  /table
  /td
 /tr
 tr
 td bgcolor=#BFC4CB
  p
  font color=#33
 ?php
 $name = $_POST['name'];
 $email = $_POST['contact'];
 $reason = $_POST['reasonforcontact'];
 $message = $_POST['message1'];

 $to = [EMAIL PROTECTED];

 $subject = Contact Form Submitted at GWD-Dev;

 $body = Hello Austin,

 .$name. has sent in a contact form at GWD-Dev. The reason he/she
 contacted you was for .$reason.. Here is the message they submitted with
 their form:



 .$message.

 The contact field of the form contained the following information:
 .$email.
 Please remember to get back to them ASAP!!;

 $headers = From: .$name. .$email.\n;



 echo Collecting information . . . . . . . . . . DONE!p;

 $mail_sent = @mail($to, $subject, $body, $headers);

 echo $mail_sent ? brSending contact form to webmaster . . . . . . . .
 DONE!p : scriptalert('The mail did not go through')/script;


 echo br. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
 .
 . . . .p;

 echo brThank you for contacting us, please expect a reply in anywhere
 from 1 to 24 hours. Make sure that our email address, 
 [EMAIL PROTECTED]
 [EMAIL PROTECTED], are not sent to your spam folder.;


 include(../footer.php); ?

 -- 
 Thanks, the webmaster of Galacticneo
 

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



[PHP] Re: directories - again

2007-06-07 Thread itoctopus
use the function chmod

chmod($img_url, 0777); //note the leading 0, it should be there

I hope this is what you want:


-- 
itoctopus - http://www.itoctopus.com
Ross [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi,

 I can make the files now after setting the permission to my images folder
 but I cannot delete the folder or images in it. I have tried unlink and
 rmdir with no success. Even with filezilla cannot delete it


 The problem seems to be the images that are set to chmod of 600 and cannot
 be changed. I upload the file with this

 move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $img_url)

 is there a way to set the permissions of the images on upload to anything
 other than 600?

 R. 

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



Re: [PHP] Strings

2007-06-06 Thread itoctopus
I noticed that too :)

-- 
itoctopus - http://www.itoctopus.com
Robert Cummings [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Tue, 2007-06-05 at 19:57 +0200, Jochem Maas wrote:
 do you notice the totally weird string delimiters in your original post?
 using either single quotes or double quotes (if you want variables named 
 inside
 the string to be interpolated). read up on php strings here:

 http://php.net/string

 He's probably using MS-Word to write code... those look very similar to
 dumb-quotes. Have you notice they open with a superscript 3 and close
 with a superscript 2?

 Cheers,
 Rob.
 -- 
 ..
 | InterJinn Application Framework - http://www.interjinn.com |
 ::
 | An application and templating framework for PHP. Boasting  |
 | a powerful, scalable system for accessing system services  |
 | such as forms, properties, sessions, and caches. InterJinn |
 | also provides an extremely flexible architecture for   |
 | creating re-usable components quickly and easily.  |
 `' 

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



[PHP] Re: Making thumbs same size

2007-06-04 Thread itoctopus
$thumb_width=50; //change this number to your preference
$thumb_height=50;

-- 
itoctopus - http://www.itoctopus.com
Humani Power [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hey hi!!.

 I have a few pages that uploads images to the apache server and makes a
 registry on a mysql database. Everything is going well just for a few
 details.

 When I make the upload for an image, it creates me a thumb image, but not 
 as
 I want. For example, if I have an image that its of 2000 x 2000 px, the
 thumb created is 200 x 200, If I upload another with 300x300 px, my thumb
 will be 30x30 px, making look the gallery pretty bad.  The only thing that 
 I
 need is that all my thumbs were on the same size.
 I've tried to modify the thumb width and height size, but doesnt work..
 Probably I am not undersatnding hoy to use the resampling() tool.

 here is my code.

 ?php
 include(connection.php);
 //make variables avaliable
 $image_caption = $_POST['image_caption'];
 $image_username = $_POST['image_username'];
 $image_tempname = $_FILES['image_filename']['name'];
 $image_date = date($_POST['image_date']);
 $today= date(Y-m-d);
 //upload image and check for image type
 $ImageDir=/var/www/apache2-default/images/;
 $Imagethumb=$ImageDir.thumbs/;
 $ImageName=$ImageDir . $image_tempname;
 if (move_uploaded_file($_FILES['image_filename']['tmp_name'],
 $ImageName)) {
 //get info about the image being uploaded


 list($width, $height, $type, $attr)= getimagesize($ImageName);

 //insert info into the table
 $insert= insert into rsiis_images
(image_caption,image_username,image_date,image_date_upload)
values
('$image_caption','$image_username','$image_date','$today');
$insertresults=mysql_query($insert)
or die(mysql_error());
$lastpicid=mysql_insert_id();


$newfilename=$ImageDir . $lastpicid ..jpg;
if($type==2){
rename($ImageName, $newfilename);
} else {
 if ($type==1){
$image_old=imagecreatefromgif($ImageName);
}elseif ($type==3){
$image_old=imagecreatefrompng($ImageName);
}

//convert the image to JPG

$image_jpg=imagecreatetruecolor($width,$height);
imagecopyresampled($image_jpg,$image_old, 0, 0, 0, 0, $width,
 $height,$width,$height);

imagejpeg($image_jpg,$newfilename);
imagedestroy($image_old);
   imagedestroy($image_jpg);
}

 $newthumbname=$Imagethumb.$lastpicid..jpg;
 //get dimensions of the thumbnail

 $thumb_width=$width*0.10;
 $thumb_height=$height*.10;

 //Create thumbnail
 $largeimage=imagecreatefromjpeg($newfilename);

 $thumb=imagecreatetruecolor($thumb_width,$thumb_height);
 imagecopy($thumb, $largeimage, 0, 0, 0, 0,$width,$height);
imagecopyresampled($thumb, $largeimage, 0, 0, 0, 0,

 $thumb_width,$thumb_height,$width,$height);
 imagejpeg($thumb,$newthumbname);
 imagedestroy($largeimage);
 imagedestroy($thumb);


 $url=location:showimage.php?id=.$lastpicid;
 header($url);


 }


 ?



 thanks for your help
 

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



[PHP] Re: Is the GD module standard?

2007-06-04 Thread itoctopus
The GD module is an option that most sys admins install with php (It also 
installs by default on OS such as Centos, Ubuntu, etc...)

-- 
itoctopus - http://www.itoctopus.com
Dave M G [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 PHP General,

 I have been using the imagepng() function in my local testing environment 
 for a while now to make CAPTCHA images.

 In my testing environment, I hadn't done any customization to my PHP set 
 up. I went with the default set of installation options that Ubuntu offers 
 for a LAMP server.

 Recently, I uploaded my site to a web hosting server, and the CAPTCHA 
 would not display.

 At first, I didn't understand that it was a module issue, because I 
 thought the imagepng() function was standard in PHP.

 However, by using the phpinfo() command on my hosting service, I realized 
 they don't have the GD module installed.

 So my assumption that imagepng() will be available on any standard 
 installation of PHP is wrong.

 However, I'm surprised that it wouldn't be as common as, say, the MySQL 
 module.

 Is it that my Ubuntu installation comes with an unusual amount of bells 
 and whistles? Is it that my web hosting server is lacking in what can be 
 expected for standard PHP features?

 I want to write code that most people can expect to run on their hosting 
 services without having to reconfigure their PHP installation. So, can I 
 expect that most servers would have the GD module? If not, what do people 
 usually do to manipulate images?

 Thank you for any advice.

 -- 
 Dave M G
 Ubuntu Feisty 7.04
 Kernel 2.6.20-15-386 

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



[PHP] Re: How can I DomDocument-renameNode?

2007-06-03 Thread itoctopus
Create a copy manually and then rename the node.

-- 
itoctopus - http://www.itoctopus.com
Eric Wiener [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Apparently renameNode is not yet implemented into Dom, so how can I
rename a node without affecting its value and/or child nodes?



I have tried making a new node, inserting it before the old node then
removing the old node but I could not figure out how to get the
nodeValue to include the child nodes, so they get stripped out leaving
only the text value.

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



[PHP] Re: Error logging

2007-06-02 Thread itoctopus
I've had the same weird problem before, and eventually I discovered that the 
error_reporting was set on the script level (eg in the PHP page) using the 
function error_reporting. The thing is any setting in your php pages would 
overwrite the php.ini setting (as far as I know).

-- 
itoctopus - http://www.itoctopus.com
Clark Alexander [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 We have the following php.ini settings:
 error_reporting  =  E_ALL
 display_errors = Off
 display_startup_errors = Off
 log_errors = On
 log_errors_max_len = 1024
 ignore_repeated_errors = Off
 ignore_repeated_source = Off
 report_memleaks = On
 track_errors = Off

 on a SuSE 10.1 server and the errors are being logged to
 /var/log/apache2/error_log
 (although I can't seem to find a setting that is making that happen.)

 parse errors ARE being logged to this file and that would be extremely
 useful information for students to be able to have when trying to find
 problems in their scripts. I can't just make that file readable to them.

 So, I had students create a logs directory within their file area and 
 set
 the permissions so that the server can to it. I have them adding the
 following to the script(s) that they wish to troubleshoot:

 ini_set(log_errors, On);
 ini_set(error_reporting, E_ALL);
 ini_set(error_log, logs/error_log);


 Parse errors are not being written to their personal log file, though. Why
 not?? About the only going in there are NOTICE level entries.

 Thanks.

 Clark W. Alexander 

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



[PHP] Re: php upload files

2007-05-23 Thread itoctopus
As far as I remember, IIS used to have a reserved user that it ran all its 
actions under.
All you have to do is to give this user the necessary permissions (I 
remember the username started with I).

Here's a link that might help : http://support.microsoft.com/kb/812614

-- 
itoctopus - http://www.itoctopus.com
kats Ant [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Hi all a i am running a windows 2003 server with IIS. I have created a php 
script that uploads a file to a server.

in the server i have users and a user1 has permission to folder1, user2 has 
permissions to folder2. I want an administrator to run the script and upload 
a file to these foldes. how can the script access the folders that only 
various users have access?
_
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+worldmkt=en-USform=QBRE 

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



[PHP] Re: format date field

2007-05-23 Thread itoctopus
SELECT DATE_FORMAT('open', '%m-%d-%Y') FROM your_table_name;

-- 
itoctopus - http://www.itoctopus.com
Mike Ryan [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am reading in a date field from a mysql database the field on the screen
 shows up as 2007-05-01  on the screen I would like the field to show
 05-01-2007  currently I am issueing the following command  print
 $row['open']; how can I format this field???

 while I am at it how can I accept the date field as 05-01-2007; 

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



[PHP] Re: Include file questions

2007-05-23 Thread itoctopus
1- No
2- Yes

-- 
itoctopus - http://www.itoctopus.com
Stephen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 1) Does the filename extension matter? I prefer *.inc? It seems to work
 fine, but I only see others using *.php

  2) Does the include file need an opening ?php and ending ? ?

  Not big issues, but I am curious.

  Thanks
  Stephen


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



[PHP] Re: convert numerical day of week

2007-05-22 Thread itoctopus
I think what you need is simply something like this:

function get_day($int_day){
$arr_day_of_week = array('1'='Sunday', '2'='Monday', '3'='Tuesday', 
'4'='Wednesday', '5'='Thurdsay', '6'='Friday', '7'='Saturday');
}

echo(get_day(1)); //will print Sunday


-- 
itoctopus - http://www.itoctopus.com
Bosky, Dave [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
How can I convert the numerical day of week to the string version?

Example, if the day of the week is 1 I would like to print out 'Sunday'.



Thanks,

Dave




**
HTC Disclaimer:  The information contained in this message may be privileged 
and confidential and protected from disclosure. If the reader of this 
message is not the intended recipient, or an employee or agent responsible 
for delivering this message to the intended recipient, you are hereby 
notified that any dissemination, distribution or copying of this 
communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by replying to the 
message and deleting it from your computer.  Thank you.
**

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



[PHP] Re: Enabling LDAP on Plesk 8

2007-05-22 Thread itoctopus
Hope this helps:
http://forum.mamboserver.com/showthread.php?t=55page=6

-- 
itoctopus - http://www.itoctopus.com
Sn!per [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Am currently running Plesk 8.0.1 . A php script with phpinfo() will give:
 ...
 ...
 '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,
 ...
 ...

 But am not able to locate the LDAP section that normally looks like:

 LDAP Support enabled
 RCS Version $Id: ldap.c,v 1.130.2.11 2005/01/19 00:28:49 bigtoy Exp $
 Total Links 0/unlimited
 API Version 2004
 Vendor Name OpenLDAP
 Vendor Version 20025

 As such, when running a script that uses any LDAP functions, I will get 
 error msgs like:
 Fatal error: Call to undefined function: ldap_connect() ...

 Any idea how I can go about solving this issue? Please advise. TIA

 --
 roger



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

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



[PHP] Re: Enabling LDAP on Plesk 8

2007-05-22 Thread itoctopus
ok, I read the whole thread and it seems it went absolutely nowhere. 
Sorry...

-- 
itoctopus - http://www.itoctopus.com
itoctopus [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hope this helps:
 http://forum.mamboserver.com/showthread.php?t=55page=6

 -- 
 itoctopus - http://www.itoctopus.com
 Sn!per [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
 Am currently running Plesk 8.0.1 . A php script with phpinfo() will give:
 ...
 ...
 '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,
 ...
 ...

 But am not able to locate the LDAP section that normally looks like:

 LDAP Support enabled
 RCS Version $Id: ldap.c,v 1.130.2.11 2005/01/19 00:28:49 bigtoy Exp $
 Total Links 0/unlimited
 API Version 2004
 Vendor Name OpenLDAP
 Vendor Version 20025

 As such, when running a script that uses any LDAP functions, I will get 
 error msgs like:
 Fatal error: Call to undefined function: ldap_connect() ...

 Any idea how I can go about solving this issue? Please advise. TIA

 --
 roger



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

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



[PHP] Re: Adserver programming with php

2007-05-20 Thread itoctopus
My approach would be to build now using the fastest way and get the thing up 
 running, and then see if the needs arise to build the application using a 
somehow slower way.

-- 
itoctopus - http://www.itoctopus.com
Merlin [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi there,

 I am thinking about creating a kind of adserver which is customized for my 
 needs. As I would be most confident in doing this with php, I am asking 
 myself if this is the right choice or if it would be wiser to take a C++ 
 aproach for example to get a higher performance just in case the site 
 grows fast.
 Do you guys think that a php build webserver would be able to scale and 
 perform well enough for serving millions of adimpressions daily?

 Thank you for any advice,

 Merlin 

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



[PHP] Re: Marketplace Framework

2007-05-20 Thread itoctopus
Try osCommerce

-- 
itoctopus - http://www.itoctopus.com
PHP Mailing List [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi All,

 Is there any PHP's framework for developing a marketplace site ?

 Regards,

 Dino 

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



[PHP] Re: PHP Data Mining/Data Scraping

2007-05-20 Thread itoctopus
In case you have no control on the other URL, then CURL is probably your 
best solution.
Otherwise, a better way to do it is probably to interact with a web service 
installed on the other website.

-- 
itoctopus - http://www.itoctopus.com
Shannon Whitty [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi,

 I'm looking for a piece of software or coding that will let me post a form 
 to another URL, accept the response, search it for a specific success 
 string and then let me continue processing the rest of my program.

 I want to accept queries on behalf of my supplier, forward it to them 
 behind the scenes, accept their response and display it within my website.

 Has anyone had any experience with this?  Is there a simple, basic utility 
 to let me do this?

 I was kind of hoping I could avoid developing it myself.

 Thanks
 Shannon 

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



[PHP] Re: Uploading Files Should I use MySQL or Server for storage?

2007-05-20 Thread itoctopus
I have tried both, and I tell you that I really felt that the filesystem is 
a more convenient way of doing it.

-- 
itoctopus - http://www.itoctopus.com
[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am in the process of adding a part to my website which would include
 pictures, pdf files, txt files, and excel files.  The files sizes
 could be anywhere on average of 100k to 2mb.  Do you think I should be
 uploading the files to a MySQL database or to my server?

 I have head that there are pros and cons to both, but have never
 really received a definitive answer that helps much.  I appreciate all
 your opinions on the pros and cons of both. 

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



[PHP] Re: showing source

2007-05-18 Thread itoctopus
yup, highlight_file($file_name) is your magical answer.
http://ca.php.net/highlight_file
Make sure this function will only access specific directories.

-- 
itoctopus - http://www.itoctopus.com
M.Sokolewicz [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Why don't you use:
 highlight_file(__FILE__) ?

 - tul

 James Lockie wrote:
 This almost works but all my  and  are replaced with .

// open this file to show the source
if (($fh = fopen( __FILE__, 'r' )) === FALSE){
die ('Failed to open source file (' . $_FILE_ . ') for 
 reading!');
} else {
$tags  = array( ,  );
$safe_tags = array( \\, \\ );

print pre\n;

// read the file line by line
while (! feof( $fh )) {
$currentLine = fgets( $fh, 255 );
$noTags = str_replace( $tags, $safeTags, $currentLine );
print $noTags;
}

fclose( $fh );
print /pre\n;
} 

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



Re: [PHP] stay logged in for session

2007-05-18 Thread itoctopus
Exactly!
I still can't believe how many sites out there have the SQL injection 
problem.

-- 
itoctopus - http://www.itoctopus.com
Edward Kay [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]


 -Original Message-
 From: Joshua [mailto:[EMAIL PROTECTED]
 Sent: 18 May 2007 12:09
 To: Edward Kay
 Subject: RE: [PHP] stay logged in for session


 On Fri, 2007-05-18 at 11:53 +0100, Edward Kay wrote:
 
   -Original Message-
   From: Joshua [mailto:[EMAIL PROTECTED]
   Sent: 18 May 2007 11:43
   To: PHP.net
   Subject: [PHP] stay logged in for session
  
  
   hey guys, i am trying to set up a session so that when a user logs 
   in,
   they will stay logged in until they close their browser.  i have the
   session set up, however i keep getting an error saying:
  
   The page isn't redirecting properly
  
   Firefox has detected that the server is redirecting the
 request for this
   address in a way that will never complete.
  
   --
   this is my code, any help plz.
   --
   checklogin.php:
  
   ?php
   session_start();
   //set session variables
   $_SESSION['txtSurname'] = $_REQUEST['txtSurname'];
   $_SESSION['txtPassword'] = $_REQUEST['txtPassword'];
   session_write_close();
  
   include('includes/dbconnect.php');
  
   $nextpage = $_REQUEST['np'];
   $profile = $_REQUEST['ob'];
  
   //Matching usernames and passwords
   $uname = $_REQUEST['txtSurname'];
   $pword = $_REQUEST['txtPassword'];
   $user = SELECT * FROM oldboys WHERE OBSURNAME=' . $uname . ' AND
   PWORD=' . $pword . ';
   $ResSql = mysql_query($user) ;
   //If any errors then print `em out
   if (!$ResSql)  {
 echo(pError performing query:  . mysql_error() . /p);
 exit();
 }
   //if user does not exist
   if (mysql_num_rows($ResSql)==0)  {
 echo 'Incorrect username or password have been specified.br';
 echo 'a href=updlogin.phpClick here to Log In/a';
 exit;
 }
   else  {
 header(Location: . $nextpage . ?ob= . $_REQUEST['ob'] .
   uname= . $_REQUEST['txtSurname'] . pword= .
   $_REQUEST['txtPassword']);
   }
   ?
  
   verify.php:
  
   ?php
   session_start();
   if(!isset($_SESSION['txtSurname']) 
 !isset($_SESSION['txtPassword']))
   {
 header(location:updlogin.php?np= . $_REQUEST['np'] . ob= .
   $_REQUEST['ob']);
   }
   else  {
 header(location: . $nextpage . ?np= . $_REQUEST['np'] . ob= 
   .
   $_REQUEST['ob']);
   }
   ?
  
 ---
 
  HTTP Location headers require the full hostname, i.e.
 
  header(Location: http://www.example.com/page_to/redirect/to.php;);
 
  As others on this list will say however, you don't have to use a full
  redirect. Just use different PHP includes.
 
  E
 
 thx so much, it works now.


 Excellent. Please include the list on replies so that it all gets archived
 and others can see your responses.

 By the way, I suggest you have a read up on PHP security, especially SQL
 injection attacks. Looking at the code above, what would happen if the
 username I supplied was the following:

   foo'; DELETE FROM oldboys; #

 E 

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



[PHP] Re: php5 cert

2007-05-18 Thread itoctopus
I know someone who easily passed PHP4, but never made it on PHP5, so don't 
expect the same level of questions.

-- 
itoctopus - http://www.itoctopus.com
Greg Donald [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Anyone wanna share their insights into the php5 cert test?  The php4
 test was pretty simple for me, but that was a couple of years ago.  It
 seems there's quite a bit of new material being covered on the php5
 version.  I figure with the same number of questions, things had to
 get more general if anything, right?


 -- 
 Greg Donald
 http://destiney.com/ 

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



Re: [PHP] Security Question, re directory permissions

2007-05-18 Thread itoctopus
I'm genuinely interested to know with whom you're hosting...

-- 
itoctopus - http://www.itoctopus.com
Tijnema [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On 5/19/07, Al [EMAIL PROTECTED] wrote:
 How can anyone, other than the staff, get into my site?  Far as I know, 
 other users can't get out of their own domain
 space and into mine.

 That's quite easy, especially when you have SSH access.
 Of course, it will only work with specific settings, and that might be
 blocked on some hosts, but it works for me.
 On my host, accounts for domains are just in /home
 so let's say i have 2 accounts, account a  b.
 their directorys are resp. /home/a  /home/b.
 When i create a diretory with account a at /home/a/dir, and i chmod it
 757, i can write a file there from account b.

 Tijnema

 Tijnema wrote:
  On 5/19/07, Al [EMAIL PROTECTED] wrote:
  But, SSH and telnet, etc. require authentication login-in and all the
  executables you mentioned [and others] require
  someone who has access to upload a harmful file to start with.  Right?
  Once they are in there, they can do anything they
  please anyhow.
 
  Al.
 
  Well, you were talking about a shared linux host, so other people,
  from a different account, could just upload files, and if you have a
  directory with 757, that user could write to it.
 
  Tijnema
 
  Tijnema ! wrote:
   On 5/18/07, Al [EMAIL PROTECTED] wrote:
   How can they write or edit files there without having ftp access or
   the site's file manager?
  
   SSH access? Telnet maybe? PHP script? CGI script? ASP script?
  
   There are a lot of possible ways someone can write there.
  
   Tijnema
  
   Tijnema ! wrote:
On 5/18/07, Al [EMAIL PROTECTED] wrote:
I'm on a shared Linux host and have been wondering about
  security and
directory other [world] permissions.
   
The defaults are 755. The 'others' [world] can read them only.
   
Is there a security hole if a dir on the doc root if a directory
  has
permissions 757?
   
If there is a security problem, what is it?
   
Thanks...
   
   
If you have a directory with 757 permissions, world can create 
new
files there.
   
And if you give files 757 (or 646) permissions, then world can
  edit
that file.
   
So if you have a doc dir, you probably don't want extra files 
there.
It's not really a security problem, but if somebody notices it, 
he
might write files there.
   
Tijnema
  
   --
   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



[PHP] Re: Tipos about which CMS use

2007-05-17 Thread itoctopus
I've said it before and I'll say it again: Wordpress.

Joomla/Mambo are also a good choice.

-- 
itoctopus - http://www.itoctopus.com
robert mena [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi there,

 I'd like to replace my 'intranet' site with a CMS system to speed up
 the edit process.  Some of my requirements are :

 - written in PHP  :)
 - mysql based
 - documented/'well structured' - to allow development of customizations
 - ability to define which pages or sections are public and which are
 private (and in this case which users can access)
 - use AJAX (not mandatory) but since some access to the page will come
 from dial-up to reduce the need to transfer entire html just to update
 a search or list contents..

 thanks 

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



[PHP] Re: reading Paradox (.db) files

2007-05-17 Thread itoctopus
Simple search on google:
http://www.phpfreaks.com/pear_manual/page/pecl.paradox.html

-- 
itoctopus - http://www.itoctopus.com
Bosky, Dave [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Has anyone had any experience opening and reading Paradox (.db) files
using PHP?

Are there any plug-ins/extensions available that someone can recommend?



Thanks,

Dave




**
HTC Disclaimer:  The information contained in this message may be privileged 
and confidential and protected from disclosure. If the reader of this 
message is not the intended recipient, or an employee or agent responsible 
for delivering this message to the intended recipient, you are hereby 
notified that any dissemination, distribution or copying of this 
communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by replying to the 
message and deleting it from your computer.  Thank you.
**

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



[PHP] Re: Confused about how exactly to output image using imagepng function

2007-05-17 Thread itoctopus
Why are you creating your own captcha?
I used the first one I found on google and it worked fine for me.

-- 
itoctopus - http://www.itoctopus.com
Dave M G [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 PHP list,

 I've looked at the manual entries for imagepng() and 
 imagecreatetruecolor() functions for helping me to create a temporary 
 image for a CAPTCHA system.

 However, I'm clearly messing up, as what I'm outputting is a bunch of 
 ASCII gibberish to the screen.

 What I think I need to do in principle is first create the image with 
 imagecreatetruecolor(), then define it as a PNG (?), then display it.

 So I've got something like this:

 $image = ImageCreate($width, $height);
 ImageFill($image, 0, 0, $black);
 echo 'img  src=' . Imagepng($image) . ' height=' . $height . ' 
 width=' . $width .' alt=captcha /' . \n;
 ImageDestroy($image);

 As mentioned, this isn't working, so there's a fundamental concept about 
 how PHP creates and displays images that I'm not getting.

 I'm trying to output an image that, ideally, won't be stored as a file. 
 Or, if it has to be a temporary file, to delete it immediately after 
 displaying it.

 What part am I not understanding?

 Thank you for any advice or information.

 -- 
 Dave M G
 Ubuntu Feisty 7.04
 Kernel 2.6.20-15-386 

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



Re: [PHP] Setting Up A Simple Shopping Cart

2007-05-17 Thread itoctopus
I'd go with OSCommerce.

-- 
itoctopus - http://www.itoctopus.com
revDAVE [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On 5/17/2007 7:05 AM, revDAVE [EMAIL PROTECTED] wrote:

 Hello folks,

 I am a PHP NEWBIE.

 - I have the following three choices for shopping carts on my server:

 CubeCart
 OS Commerce
 Zen Cart

 Q: Does anybody have any preferences for creating a simple store?

 Both OS Commerce  Zen Cart look pretty cool so far   Does anyone have
 any preferences?




 --
 Thanks - RevDave
 [EMAIL PROTECTED]
 [db-lists] 

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



[PHP] Re: Passing an array as a hidden variable

2007-05-12 Thread itoctopus
hmmm,
anyways, to do that you can just join the array using
$str_attend_save = implode('|', $attend_ary_save);
? echo 'input type=hidden name=str_attend_save value=' . 
$str_attend_save .''; ?

On your action page, you do this:
$attend_ary_save = explode('|', $_POST['str_attend_save']);

-- 
itoctopus - http://www.itoctopus.com
Todd Cary [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 When I use the following syntax, the 2 dimensional array loses it's 
 contents.  Can an array be passed this way?

   ? echo 'input type=hidden name=attend_ary_save value=' . 
 $attend_ary_save .''; ?

 Todd 

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



[PHP] Re: cloning $this php5

2007-05-12 Thread itoctopus
I don't think the clone function works on $this.

-- 
itoctopus - http://www.itoctopus.com
blackwater dev [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I have a method within an class that should make a copy of itself, do some
 stuff on the copy and return it.  The object contains data members that 
 are
 references to other objects.  I basically want a brand new copy of the
 object.  The problem is, certain methods I call on the object throw this
 error:

 Call to undefined method stdClass::methodname

 I've tried to copy it with just =, = and clone but they all through
 errors.  What am I doing wrong?

 Thanks!

 function morph(){

 $cloned_ob= clone $this;

 $cloned_ob-run();
 $cloned_ob-data_member=john;

 return $cloned_ob;

 }
 

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



[PHP] Re: self:: vs this

2007-05-12 Thread itoctopus
self:: static functions
$this- non static functions

-- 
itoctopus - http://www.itoctopus.com
Mariano Guadagnini [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hy people,
 I have an existential doubt regarding php classes. I have been a php
 programmer for quite a long time, but never could figure out the clear
 difference between using this- or self:: when calling member functions,
 wether they are private or public. I used them indistinctly and seemed
 to sort the same effects, although, when working with statics classes,
 self:: was the only way to access members.

 Well, that's all, any can put me some light on the matter?

 Thanks,

 -- 

 Mariano Guadagnini
 UVCMS S.R.L
 www.uvcms.com



 

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



[PHP] Re: Do you use any framework in your applications?

2007-05-12 Thread itoctopus
I'm currently using Ruby on Rails.
As for PHP, all the frameworks I ever worked with were developed in-house. 
I've tinkered a bit with CakePHP and it looked very good.

-- 
itoctopus - http://www.itoctopus.com
cajbecu [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hello,

 I was wondering if some of you use any framework in your application.
 If you do that, can you post the name of the framework and
 advantages/disadvantages of it?
 2 weeks ago I started to learn symfony framework
 (www.symfony-project.com) wich apears to be a good and reliable
 framework.

 cajb. 

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



Re: [PHP] PhP and Java login trouble

2007-05-09 Thread itoctopus
I agree with Chris, if you can do it this way, then it's much better. 
Working with FCKEditor's code was not one of the easiest things I did in my 
life.

-- 
itoctopus - http://www.itoctopus.com
Chris [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Brad Sumrall wrote:
 I am trying to create a commonlogin.php which would perform a duel login 
 for
 phpbb and a java based FCKEditor combined

 I have working code for each as an individual but not a clue how to 
 combine
 them.

  Does anyone have any suggestion on where I can go for information about
 this?

 Firstly that's javaSCRIPT not java. Java is an entirely different beast.


 Why not just copy the validateLogin javascript functionality and put it 
 in a new function and then:

 form action=/phpbb/login.php method=post target=_top 
 onsubmit=return BBValidateLogin();

 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/ 

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



[PHP] Re: Disable Soap Client and Soap Server in php5

2007-05-09 Thread itoctopus
I think the only way, and I really hope I'm mistaken, is to recompile php 
with --disable-soap.
I don't think you can do it from php.ini.

-- 
itoctopus - http://www.itoctopus.com
Don Don [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 How can i disable soap client and server for php5, reason is that i've got 
 NuSOAP (which i must use) and its classes clash with that of PHP5.  My php 
 configuration (when using phpinfo() displays soap client and server 
 enabled for php5.  I need to disable if ..amd looking into the configs..to 
 see how

 cheers


 -
 Ahhh...imagining that irresistible new car smell?
 Check outnew cars at Yahoo! Autos. 

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



[PHP] Re: How to know a requets from web page or client.

2007-05-08 Thread itoctopus
http://ca.php.net/function.get-browser

-- 
itoctopus - http://www.itoctopus.com
Le Phuoc Canh [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Dear all,
 How can we know a request from web page( ex : firefox, IE..) or from 
 client(
 ex : window media, winamp, ...). Please help me !

 Thanks  Best Regard.

 Le Phuoc Canh

 Arrive Techologies
 Cell Phone : 0902147449
 Home Phone  : (08)9915349
 Email: [EMAIL PROTECTED]

 

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



[PHP] Re: CMS

2007-05-08 Thread itoctopus
CMS is Customer Management System. It allows anyone with no programming 
skills to create and update a content-driven website.

There are lots of free CMSs available for download (just search for CMS on 
google).

As for the requirements, nothing fancy is required, any modern day hosting 
will allow you to install  your CMS (some hosting companies have even 
created their own wizards to create your CMS site, which will make your job 
even easier)
-- 
itoctopus - http://www.itoctopus.com
Jyoti [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi

 Can anyone can tell me what CMS is?

 How can we make it?

 What are the requirements for it?



 Thanks for every response.



 Regards

 Jyoti



 

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



[PHP] Re: defining a folder on localhost

2007-05-08 Thread itoctopus
define('IMAGE_FOLDER',$_SERVER['DOCUMENT_ROOT'].//mysite//property_images);

-- 
itoctopus - http://www.itoctopus.com
blueboy [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I want to define a folder like this

 define('IMAGE_FOLDER',$_SERVER['DOCUMENT_ROOT']./mysite/property_images);

 I am working on a windows machine running apache and this does not work. 
 It
 doesn't seem to like the forward slashes.
 the document_root gives C:/Apache/htdocs/

 Does anyone know a way to define the root folder on localhost so then when 
 I
 upload to the web server I either have to make no changes or just change
 this one definition. 

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



[PHP] Re: Upload problem - final size is different

2007-05-08 Thread itoctopus
Have you tried your code on another server?

-- 
itoctopus - http://www.itoctopus.com
Eric Trahan [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi,

 I have a form to upload file on my web server, so user can upload  their 
 images.

 The upload work.  The user file is uploaded to my destination folder 
 (page5/) but the file is unreadable and the file size is smaller than  the 
 original file size.

 I run Apache with PHP 4.1.2.

 Thank you,

 Eric.


 Here is the form code:

 form enctype=multipart/form-data action=fileupload_bd.php 
 method=post
 input type=hidden name=MAX_FILE_SIZE value=10 /
 Une imagebr/input type=file name=uneimage /
 br/br/Du texte: input type=text name=untexte /
 br/br/input type=submit /
 /form


 Here is my PHP upload code:

 ?php

 echo $_POST['untexte'] . br/br/;

 $tmp_name = $_FILES['uneimage']['tmp_name'];
 $type = $_FILES['uneimage']['type'];
 $name = $_FILES['uneimage']['name'];
 $size = $_FILES['uneimage']['size'];

 echo $tmp_name . br/ . $type . br/ . $name . br/;

 $target_path = page5/;

 $target_path = $target_path . basename( $_FILES['uneimage']['name']);

 echo $target_path;

 if(move_uploaded_file($_FILES['uneimage']['tmp_name'], $target_path)) {
 echo The file .  basename( $_FILES['uneimage']['name']).
  has been uploaded;
 } else{
 echo There was an error uploading the file, please try again!;
 }
 ? 

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



[PHP] Re: Articles system

2007-05-08 Thread itoctopus
Wordpress,
check http://www.pmhut.com for an idea on what you can do with it.

-- 
itoctopus - http://www.itoctopus.com
WeberSites LTD [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Wasn't sure if to use the CMS thread or not so I opened a new one.
 I'm guess I'm looking for a CMS system but I only need it for articles.

 Preferably one that knows how to break the article into several pages
 so that you don't need to see one big scroll.

 Any recommendations?

 thanks
 berber
 

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



[PHP] Re: session cookies enabled?

2007-05-08 Thread itoctopus
setcookie(cookie_name, value);
//redirect to another page using header
header(location:.$your_url);

//check in $your_url for the presence for the cookie
if ($_COOKIE[cookie_name] == value){
//cookies are enabled - add your code
}
else{
//cookies are disabled - add your code
}

Hope that helps!


-- 
itoctopus - http://www.itoctopus.com
[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Richard Lynch writes:
 How does one check to see if the user's browser accepts
 session cookies?

 Apparently I should have said cookie and left off the 's' as
 that is what I had in mind.
 Send one cookie, see if it comes back, and if it does, tie everything to 
 that cookie.

 OK.  So how do I see if it comes back?
 I send the user a page that tries to set a session cookie.  That
 page would then have to forward him to a second page which would
 check for the cookie being sent.  Right?
 So I there is nothing I can check so I can do it with a single page?
 You can also set up php.ini and use the built-in sessions with
 http://php.net/session_start so that PHP will take care of this for you.

 That is what I was intending to do.  How do I find out if whether
 or not the session cookie was accepted using the built-in sessions?
 I found no function for such a test.
 Best,
 Craig


 --
 - Virtual Phonecards - Instant Pin by Email  -
 -   Large Selection - Great Rates-
 - http://speedypin.com/?aff=743co_branded=1 -
 -- 


 **
 **
 *  Craig Spencer *
 *  [EMAIL PROTECTED]*
 **
 ** 

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



[PHP] Re: CMS Systems

2007-05-07 Thread itoctopus
I use wordpress, easy, clean, and lots of plugins.
Joomla is also good.

-- 
itoctopus - http://www.itoctopus.com
Joey [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Does anyone know of any good open source CMS system? ( content management
 system )



 Thanks!


 Joey



 

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



[PHP] Re: Best way to format double as money?

2007-05-06 Thread itoctopus
I'd use number_format, money_format is OS dependent.

-- 
itoctopus - http://www.itoctopus.com
Todd Cary [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I have a MySQL DB that stores currency values as doubles.  I want to 
display the values in the #,##0.00 format.  What is the best way to do 
that?

 Todd

 -- 
 Ariste Software
 2200 D Street Ext
 Petaluma, CA 94952
 (707) 773-4523 

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



[PHP] Re: losing session variable

2007-05-06 Thread itoctopus
session_write_close();

-- 
itoctopus - http://www.itoctopus.com
Alain Roger [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi,

 I have the following code :

session_start();
 $_SESSION['username']=$myusername;
 $_SESSION['Localization'] = $lang;
 header(Location:
 https://.$_SERVER['SERVER_NAME'].$path_adm_files./modules/welcome/welcome.php);


 if i check before header command what is the value of 
 $_SESSION['username'],
 i get the right value.
 however, if i place on the first line of welcome.php file the following 
 code
 :

 echo br1. Before session;
 session_start();
 echobrUsername : .$_SESSION['username'];
 echo br2. After session;


 i get empty value for this session variable.
 How is it possible ?

 in my first code piece, if i use localhost instead of
 $_SERVER['SERVER_NAME'], it creates a session file in my temporary folder 
 as
 it should be
 I'm confused now :-(

 thanks a lot for your help.
 -- 
 Alain
 
 Windows XP SP2
 PostgreSQL 8.1.4
 Apache 2.2.4
 PHP 5.2.1
 

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



[PHP] Re: Newbie Question - Form To Email Needed

2007-05-05 Thread itoctopus
1st page:

form
textarea name='thebody'/texarea
/form

2nd page:

$str_body = $_POST['thebody'];
mail('[EMAIL PROTECTED]', 'This is the 
subject', $str_body);

Of course you can have the email and the subject fields come also from the 
1st page.

Hope that helps!

-- 
itoctopus - http://www.itoctopus.com
revDAVE [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi folks,

 I have a form on page one - and would like to submit to a second page in 
 PHP
 that could grab the fields and send it out as an e-mail.

 Are there any links that show how do this?


 Thanks in advance - Dave


 --
 Thanks - RevDave
 [EMAIL PROTECTED]
 [db-lists] 

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



Re: [PHP] Getting multitple select values on PHP side

2007-05-05 Thread itoctopus
Totally agree, generates a lot of support.

-- 
itoctopus - http://www.itoctopus.com
Richard Lynch [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Fri, May 4, 2007 3:56 pm, Skip Evans wrote:
 I have a requirement for a select on a form that
 has to be able to get multiple values in the form
 processing PHP side.

 You just multiple to the select... tag to be
 able to select multiple values, but on the PHP
 side the $_POST value for the form only has the
 last one selected.

 PS
 WARNING:
 Most surfers have NO IDEA how to work a MULTIPLE select...

 You need instructions right next to it, if it's important that they
 pick more than one.

 If it's only a nifty feature to choose more than one, let the smart
 ones revel in their edumacation and the not-so-swift will never
 realize what they are missing.


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

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



[PHP] Re: Custom session save handler. What's happens really?

2007-05-04 Thread itoctopus
You have to explicitly serialize and unserialize the objects.
I think the confusion here is with the automatic __wakeup and __sleep 
functions:
http://www.devshed.com/c/a/PHP/Using-the-Sleep-and-Wakeup-Functions-to-Serialize-Objects-in-PHP/


-- 
itoctopus - http://www.itoctopus.com
[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi,

 i'm using in each script:

 ?
 session_set_save_handler(...); //register my custom function to store 
 session
 //into a mysql database

 session_start(); //session.auto_start is set to 0 in php.ini
 register_shutdown(session_write_close);

 $object = unserialize($_SESSION['objectname']);
 //modify the object
 //
 $_SESSION['objectname'] = serialize($object);
 ?

 When are exactly called the write and read function of my custom handler?
 Is it at the session_start that read function is called?
 or is it at $object = unserialize($_SESSION['objectname'])?

 Is write function called at session_write_close only?
 or any time $_SESSION[] is writted?

 Thanks a lot, I have no clue from PHP tutorial about this... 

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



[PHP] Re: File uploading and saving info on mysql

2007-05-03 Thread itoctopus
Here's the file upload class making your life easier:

?php
 /*
  @class FileManager
  @description This class handles interaction with Files
  @copyright itoctopus 2007 - The Genoc Library
 */
 class FileManager{
  /*
   [EMAIL PROTECTED] save
   [EMAIL PROTECTED] this function saves the file in the database
   [EMAIL PROTECTED] array $file_handle A handle on the file (ex. 
$_FILES['the_file'])
   [EMAIL PROTECTED] string $field_name The name of the field
   [EMAIL PROTECTED] string $action Update or save the file in the table. 
Defaults to 
save.
   [EMAIL PROTECTED] string $file_source The name of the source table saving 
the file 
(such as realestate)
   [EMAIL PROTECTED] string $file_source_id The id of the row in the source 
table
   [EMAIL PROTECTED] object $db The database handle
  */
  static function save($file_handle, $file_source, $file_source_id, 
$action='save', $allowed_types = array(), $db){
   if (empty($file_handle['tmp_name']))
return;
   $data = addslashes(fread(fopen($file_handle['tmp_name'], r), 
$file_handle['size']));
   if ($action == 'save'){
$creationdate = $lastupdatedate = Date(Y-m-d H:i:s);
$sql = 'INSERT INTO file (file_name, file_type, file_size, file_source, 
file_source_id, file_binary, file_creationdate, file_lastupdatedate) VALUES 
(\''.$file_handle['name'].'\', \''.$file_handle['type'].'\', 
\''.$file_handle['size'].'\', \''.$file_source.'\', \''.$file_source_id.'\', 
\''.$data.'\', \''.$creationdate.'\', \''.$lastupdatedate.'\')';

//now if the type is an image, then create a thumbnail (resize should be 
relative)

   }
   else{
$lastupdatedate = Date(Y-m-d H:i:s);
$sql = 'UPDATE file SET file_name=\''.$file_handle['name'].'\', 
file_type=\''.$file_handle['type'].'\', file_source=\''.$file_source.'\', 
file_source_id=\''.$file_source_id.'\', file_binary=\''.$data.'\', 
file_lastupdatedate=\''.$lastupdatedate.'\'';

//now if the type is an image, then update a thumbnail

   }
   $result= $db-query($sql);
  }

  /*
   [EMAIL PROTECTED] get
   [EMAIL PROTECTED] This function returns a link to the file based on the id
   [EMAIL PROTECTED] string $file_id The id of the file in the database
   [EMAIL PROTECTED] object $db The database handle
   [EMAIL PROTECTED] void
  */
  static function get($file_id, $db){
   $sql = 'SELECT file_id, file_name, file_type, file_size, file_binary FROM 
file where file_id=\''.$file_id.'\'';
   $result= $db-query($sql);
   header('Content-length:'.$result[0]['file_size']);
   header('Content-type:'.$result[0]['file_type']);
   //if it's not an image then download it, otherwise display it
   if (strpos($result[0]['file_type'], 'image') !== FALSE)
header(Content-type: .$result[0]['file_type'].; 
filename=.$result[0]['file_name']);
   else
header(Content-Disposition: attachment; 
filename=.$result[0]['file_name']);
   echo($result[0]['file_binary']);
  }

  /*
   [EMAIL PROTECTED] delete
   [EMAIL PROTECTED] This function delete a file from the database
   [EMAIL PROTECTED] integer $file_id The id of the file to be deleted
   [EMAIL PROTECTED] object $db The database handle
   [EMAIL PROTECTED]
  */
  static function delete($file_id, $db){
   $sql = 'DELETE FROM file WHERE file_id=\'$file_id\'';
   $result= $db-query($sql);
  }

 }
?

-- 
itoctopus - http://www.itoctopus.com
Marcelo Wolfgang [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi all,

 I'm developing for my first time an upload file form which will populate a 
 sql insert query, I think I got everything working fine, but the data 
 isn't been saved on the database. Can someone help me with what I'm doing 
 wrong here ?

 the code follow:

 ?php
 if (($_FILES[file][type] == application/msword)
 || ($_FILES[file][type] == application/pdf)
  ($_FILES[file][size]  200))
   {
   if ($_FILES[file][error]  0)
 {
 echo Return Code:  . $_FILES[file][error] . br /;
 }
   else
 {
 if (file_exists(../downloads/ . $_FILES[file][name]))
   {
   echo $_FILES[file][name] .  already exists. ;
   }
 else
   {
   move_uploaded_file($_FILES[file][tmp_name],
   ../downloads/ . $_FILES[file][name]);
   }
 }
   }
 else
   {
   echo Invalid file;
   }
 $title = $_POST[title];
 $filePath =   ../downloads/ . $_FILES[file][name];
 if($_FILES[file][type] == application/pdf){
 $fileType = pdf;
 } else if ($_FILES[file][type] == application/msword){
 $fileType = doc;
 }
 echo($title) . br /; //outputs 'yada' ( correctly as I've typed on the 
 form;
 echo($filePath) . br /; //outputs '../downloads/66321-Estrutura.doc' 
 and I can check that the file is there;
 echo($fileType) . br /; //outputs 'doc' this is correct;

 mysql_connect(localhost,$db_user,$db_pass) or die (mysql_error());;
 mysql_select_db ($db_table);
 $user_Query = mysql_query(INSERT INTO tb_downloads (var_title, 
 var_filepath, var_filetype, dt_data, bol_active) VALUES ('$title', 
 '$filePath','$fileType','NOW(),1));
 mysql_close();

 echo

[PHP] Re: Redirect via GET is loosing characters

2007-05-03 Thread itoctopus
You just have to store your form inputs in the session.

-- 
itoctopus - http://www.itoctopus.com
Merlin [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi there,

 I am checking plausability inside a php script that receives a POST 
 submit. If an error occures the user should be redirected back, along with 
 his original data filled into the forms.

 There is a problem with this. As the GET method, which the redirect is 
 using, only allows a certain amount of characters, the text is always cut 
 down.

 I use this:
 HEADER(Location:.$data[rurl].?error=.$error.$parameter);

 Is there a way to redirect the user to the form and fill in large text?

 Thank you for your help,

 Best regards, Merlin 

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



[PHP] Re: Split string

2007-05-03 Thread itoctopus

if ($your_string !== ''){
$arr_string = explode(',', $your_string);
$first_part = $arr_string[0];
array_shift($arr_string);
$second_part = implode(',', $arr_string);
}


-- 
itoctopus - http://www.itoctopus.com
Lester Caine [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Can someone with a few more working grey cells prompt me with the correct 
 command to split a string.

 The entered data is names, but I need to split the text up to the first 
 space or comma into one string, and the rest of the string into a second. 
 It's the 'first either space or comma' that eludes me at the moment :(

 In know it's probably obvious, but it always is when you know the answer.

 -- 
 Lester Caine - G8HFL
 -
 Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
 L.S.Caine Electronic Services - http://home.lsces.co.uk
 MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
 Firebird Foundation Inc. - http://www.firebirdsql.org/index.php 

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



Re: [PHP] What does mean?

2007-05-03 Thread itoctopus
never ever used it...
I also voted!

-- 
itoctopus - http://www.itoctopus.com
Philip Thompson [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Apr 30, 2007, at 2:17 PM, Greg Donald wrote:

 On 4/30/07, Nick Gorbikoff [EMAIL PROTECTED] wrote:
 Hello, folks.
 I rember I've since this somewhere in perl and it has somethign to  do 
 with
 blocks of code. I came across the same thing in some PHP code.

  END
  some code
 END

 What exactly does it mean.

 BTW:
 PHP .net search breaks if you search for 


 It's heredoc syntax.

 http://us2.php.net/manual/en/ 
 language.types.string.php#language.types.string.syntax.heredoc


 Ok, let's gather some stats to see how many people actually use the 
 heredoc syntax. I created this quick little form to gather the data.  It's 
 takes 2 seconds (literally) - vote here:

 http://thril.uark.edu/heredoc/

 I'm interested in knowing if this is used a lot. If it is, then I may 
 consider tying it into my code (if it calls for it).

 ~Philip 

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



[PHP] Re: Evaluating strings...

2007-04-11 Thread itoctopus
= is for assigment
== is for typeless comparison (meaning 1 will be equal to '1', '' will be
equal to 0)
=== is for type comparision (meaning 1 will only be equal to 1, '' will only
be equal to '', and TRUE will only be equal to true)

--
itoctopus - http://www.itoctopus.com
Anthony J. Maske [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hey,  Thanks for the quick response on Retrieving parameters...

 This is another that has me stumped...

   if (trim($Line) = 'body') {

 $InBody = true;

   } elseif (trim($Line) = '/body') {

 $InBody = false;

   }

 $Line is a line from a html file, I'm trying to parse through it to ignore
 everything but the body section.  When I run the above I get the
 following...

 Fatal error: Can't use function return value in write context in
 C:\wwwRoot\anthony.maske\cfr.php on line 43

 If I do this...

 $Tag = trim($Line);

   if ($Tag = 'body') {

 $InBody = true;

   } elseif ($Tag = '/body') {

 $InBody = false;

   }

 Why won't the later work?  What am I missing in the first snip...

 Thanks again...!


 Anthony

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



Re: [PHP] Retrieving parameters passed from .html...?

2007-04-11 Thread itoctopus
yup,
$_GET to get stuff from the URL
$_POST to get stuff from the form
$_SESSION to get stuff from the session
$_FILES in case you have files in your form, they will be stored here

--
itoctopus - http://www.itoctopus.com
Anthony J. Maske [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 See... the second I sent this I took a sip of red-bull and my brain
cleared
 up...

 $topicID = $_GET['showtopic'];

 Right?




 Anthony J. Maske
 [EMAIL PROTECTED]
 http://home.comcast.net/~ajmaske



 -Original Message-
 From: Anthony J. Maske [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 10, 2007 8:33 PM
 To: PHP General
 Subject: [PHP] Retrieving parameters passed from .html...?

 Hey all,

 My first post here..., new to php and so far doing great picking it up...
 but, tonight I'm having a brain fart...

 How do you pick up (read) the parameters passed into a php script from an
 html file?

 Given...  http://somewhere/dosomething.php?showtopic=9

 How do you read or get the value showtopic and the value of 9?

 I know this is simple but I'm pulling my hair out here...


 Thanks!



 Anthony

 --
 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: keeping credit card info in session

2007-04-10 Thread itoctopus
Encryption is a mandatory part of PCI compliance...

--
itoctopus - http://www.itoctopus.com
Jim King [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]


 Does encrypting credit card information really do any good?  You have
 to store the keys somewhere to decrypt the data to use it.  As we
 have seen with blu-ray and HD DVD movies, the keys are the weak point
 that are easily compromised.  Besides, even encrypted data can be
 decrypted by brute force.  The strength of the encryption only
 dictates how long it will take.  Once you have the decryption key,
 the strength of the encryption means nothing.  Does anyone believe
 that all these botnets are just for sending spam?  You could use them
 to create a huge supercomputer for code busting.

 I think it is better to protect you network and passwords.  Use the
 Visa/MC/Amex standards that the companies themselves publish.  None
 of them require encryption, by the way.



 On Apr 8, 2007, at 4:56 PM, itoctopus wrote:

  Usually paying should be the last step, so you might probably want
  to review
  your workflow.
  Anyways, if you're storing the credit card in the database, then
  why are you
  also storing it in the session, you can just query the database for
  the
  credit card based on the session id (so you should also store the
  session id
  in that table).
  Since you're storing the credit card in the database, then you should
  encrypt the credit card (there are plenty of encryption/decrypting
  algorithms on the internet for PHP).
  Other than that, I think everything is fine, and your system should
  work
  smoothly.
  --
  itoctopus - http://www.itoctopus.com
  [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
 
  Hi All,
 
  I've got quite a bit or php experience, but I've never had to deal
  with
  credit
  card info before. Now for a property rental site, I'm adding a way
  for
  users to
  be able to fill out a form which also has some credit card info in
  it.
 
  After they submit the form, there are a couple of more steps and
  to pass
  credit
  card info to the last page, I'm storing all the info in my
  session. Now, I
  did
  go and bought an SSL certificate, so the booking section of the
  site is on
  SSL
  (https). I'm just wondering if this is secure enough. as far as I
  know,
  SSL
  means connection to server is secured, so session variables should be
  secured
  too. no?
 
  Also after I get credit card info, I'm storing them in a mysql
  table until
  an
  admin would log in to the site, see new reservations, charge them
  manually
  and
  contact the customer, and then that entry will be removed from my
  database
  for
  ever. Is this ok? or is it a really bad idea? originally the plan
  was to
  send
  an email to the admin with credit card info, but then I realized that
  emails
  are very unsecure. so I decided to keep the info on the SSL
  section of the
  site.
 
  just because I'm dealing with credit cards, I'm so afraid of doing
  anything
  now. Any suggestions? or perhaps any links to how to make it all more
  secure?
 
  Thanks a lot in advance,
  Siavash
 
  --
  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] Re: MySQL exceptions

2007-04-09 Thread itoctopus
Use the @ in front of the statement and then check the result if it's valid.

--
itoctopus - http://www.itoctopus.com
Davi [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 Hi all!

 I'm developing an OOP app using PHP 5.
 I want to use try-catch with mysql functions.

 So, the question is: what are the exceptions classes of MySQL?
 Where can I found it?

 TIA


 --
 Davi Vidal
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 --

 Agora com fortune:
 BOFH Excuse #426:

 internet is needed to catch the etherbunny

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



[PHP] Re: Curious Problem with $_POST

2007-04-09 Thread itoctopus
You should check $_FILES, and your form tag should be like this

form action='yoursubmitfile' method='post' enctype='multipart/form-data'

--
itoctopus - http://www.itoctopus.com
Stephen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have a form for uploading files. It is intended to upload photos. I
 have it listed at the end.

 When I upload a jpg everything is fine. The $_POST variable is populated
 as expected.

 If I upload a zip file, it is empty!

 print_r ($_POST); gives

 Array ( )

 If I upload a jpg Print_r gives:

 Array ( [form] = uploadimagesform [MAX_FILE_SIZE] = 10 [category]
 = 1 [photo_caption] = Array ( [0] = [1] = [2] = [3] = ) [submit]
 = Add Photos )

 I am at a total loss to understand this, and don't know where to begin.

 Help!

 Thanks in advance
 Stephen

 form enctype=multipart/form-data action=up.php method=post
 name=upload_formbr /
 input name=form type=hidden value=uploadimagesform /
 label for=categorySelect Category/label
 select id=category name=category
 option value=1Name/option
 option value=2Purple/option
 /selectbr /br /
 label for=Photo1Photo 1:/label
 input id=photo_filename[] name=photo_filename[] type=file
 /br /
 label for=Caption1Caption: /label
 textarea id=photo_caption[] name=photo_caption[]/textareabr
 /br /
 label for=Photo2Photo 2:/label
 input id=photo_filename[] name=photo_filename[] type=file
 /br /
 label for=Caption2Caption: /label
 textarea id=photo_caption[] name=photo_caption[]/textareabr
 /br /
 label for=Photo3Photo 3:/label
 input id=photo_filename[] name=photo_filename[] type=file
 /br /
 label for=Caption3Caption: /label
 textarea id=photo_caption[] name=photo_caption[]/textareabr
 /br /
 label for=Photo4Photo 4:/label
 input id=photo_filename[] name=photo_filename[] type=file
 /br /
 label for=Caption4Caption: /label
 textarea id=photo_caption[] name=photo_caption[]/textareabr
 /br /
 input type=submit name=submit value=Add Photos /
 /form

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



[PHP] Re: which CMS are you using and why?

2007-04-08 Thread itoctopus
Mambo/Joomla, they're both great. Wordpress is also excellent, though I'm
not sure it would fit your needs.

--
itoctopus - http://www.itoctopus.com
Fernando Cosso [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Well that's the question.
 I have to start a new project and I have to decide the CMS.
 I have thought mambo will do, but looking at the documentation, it
 disappointed me a little.
 I need a documentation with examples of the objects, functions and all
that
 stuff. The project has to be mature (That why I like mambo). The cms has
to
 be flexible, with a very large community.
 Thanks in advance for your comments
 Best regards

 --
 [EMAIL PROTECTED]
 http://www.fernandocosso.com.ar


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



[PHP] Re: keeping credit card info in session

2007-04-08 Thread itoctopus
Usually paying should be the last step, so you might probably want to review
your workflow.
Anyways, if you're storing the credit card in the database, then why are you
also storing it in the session, you can just query the database for the
credit card based on the session id (so you should also store the session id
in that table).
Since you're storing the credit card in the database, then you should
encrypt the credit card (there are plenty of encryption/decrypting
algorithms on the internet for PHP).
Other than that, I think everything is fine, and your system should work
smoothly.
--
itoctopus - http://www.itoctopus.com
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 Hi All,

 I've got quite a bit or php experience, but I've never had to deal with
credit
 card info before. Now for a property rental site, I'm adding a way for
users to
 be able to fill out a form which also has some credit card info in it.

 After they submit the form, there are a couple of more steps and to pass
credit
 card info to the last page, I'm storing all the info in my session. Now, I
did
 go and bought an SSL certificate, so the booking section of the site is on
SSL
 (https). I'm just wondering if this is secure enough. as far as I know,
SSL
 means connection to server is secured, so session variables should be
secured
 too. no?

 Also after I get credit card info, I'm storing them in a mysql table until
an
 admin would log in to the site, see new reservations, charge them manually
and
 contact the customer, and then that entry will be removed from my database
for
 ever. Is this ok? or is it a really bad idea? originally the plan was to
send
 an email to the admin with credit card info, but then I realized that
emails
 are very unsecure. so I decided to keep the info on the SSL section of the
site.

 just because I'm dealing with credit cards, I'm so afraid of doing
anything
 now. Any suggestions? or perhaps any links to how to make it all more
secure?

 Thanks a lot in advance,
 Siavash

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



[PHP] Re: session in forum

2007-04-08 Thread itoctopus
http://www.sitepoint.com/article/users-php-sessions-mysql

--
itoctopus - http://www.itoctopus.com
uni uni [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 im trying to make a forum for my school assignment, its done and work
well, but i want to make session where it is readonly for un-registered
user, and the registered user can automaticly post new  topics or comment
the other topics without filling up name and email form cuz their name and
email will be taken from the database as they have logged in.

 anyone can help me please?


 -
 Don't pick lemons.
 See all the new 2007 cars at Yahoo! Autos.

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



[PHP] Re: PHP4 vs PHP5

2007-04-07 Thread itoctopus
In my opinion, it is very safe to go for PHP5 (it's been out for a long time
now). Also, PHP5 has a lot of built-in functionality that you will
definitely feel you're lacking in case you go for PHP4. And don't forget,
PHP4 will be deprecated sooner or later (I'm sure the developers will not
really like the idea of maintaining 3 PHP versions once PHP6 is released).
All in all, PHP5 is a very wise choice at the moment.

--
itoctopus - http://www.itoctopus.com
Fernando Cosso [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi
 I know this topic has to be discussed several times but I have a situation
I
 need some advices.

 I am working in a small company. The company does everything you need.
 Computer service, sell computers, install servers, web page, etc. I am in
 the web department. The guys from the server installation and that stuff
are
 using a modified debian, which for default in his stable release has php4
 and apache 1.33.
 I am new at the company and I have to decide what I need and what I am
going
 to do. My choice is to use the CMS Mambo and make the modification that
each
 client would ask.
 So I've seen that php5 has a lot of cool staff, like mysqli and the new
(and
 faster) object oriented thing. I would like to know if it is safe to use
 this version. I know that mambo use objects so I think that php5 will do a
 better job running it. I also think php5 (or php6) is the future we can
use
 php4 for ever.
 So whats your opinion?
 Thanks

 A last comment: I apologize for my English, please let me know you didn't
 understand something

 --
 [EMAIL PROTECTED]
 http://www.fernandocosso.com.ar


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



[PHP] Re: link counting

2007-04-07 Thread itoctopus
Use the function is_url (note that I haven't written it) instead to check if
the link is a URL.
Not only your method may count some links twice, but it will count wrong
URLs also.
a href='www.externaldomainnamehere.com'External/a is not a URL that will
take someone externally.

Below is the function is_url
function is_url($url) { return
preg_match('#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $url);}

taken from this link:
http://plurged.com/code.php?id=26



--
itoctopus - http://www.itoctopus.com
Sebe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 i thought of an idea of counting the number of links to reduce comment
spam.

 unfortunately my methods is not reliable, i haven't tested it yet
 though.. anyone have maybe a better solution using some regexp?

 $links = array('http://', 'https://', 'www.');

 $total_links = 0;
 foreach($links as $link)
 {
  $total_links = substr_count($string, $link);
 }

 if($total_links  X)
 {
 .
 }

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



[PHP] Re: Submitting as POST. Why?

2007-04-07 Thread itoctopus
POST is mainly used to modify data, GET is mainly used to show data.

--
itoctopus - http://www.itoctopus.com
barophobia [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 My Peeps,

 I only know of one reason to submit a form as POST and that is because
 you can submit more data in one shot.


 What other reasons are there?



 Chris.

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



[PHP] Re: spl DirectoryIterator

2007-04-07 Thread itoctopus
After some testing and reading, I think this function is still experimental.
Anyone else has some thoughts on this?

--
itoctopus - http://www.itoctopus.com
Matthew Dellar [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have a problem,

 I need to turn an iterator into an array, but when I do, some methods I
 need to use stop working.

 Take a look at the following example:

 $dir = 'c:/';
 $files = new DirectoryIterator($dir);
 //$files = iterator_to_array($files);
 foreach ($files as $file) {
  echo {$file-getFileName()}br;//works
  echo {$file-getPath()}br;//works
 }

 It works as expected. However, when the iterator is turned into an array:

 $dir = 'c:/';
 $files = new DirectoryIterator($dir);
 $files = iterator_to_array($files);
 foreach ($files as $file) {
  echo {$file-getFileName()}br; //does not work
  echo {$file-getPath()}br;//works
 }

 It stops working. Can someone please help me, as a have tried and failed
 to find the cause of the problem.

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



Re: [PHP] PHP textbook suggestions?

2007-04-05 Thread itoctopus
I beg to differ with everyone who said there's no difference between the
single quote and double quote.
Although the double quote is much more flexible, the single quote is better,
as there will be no evaluation of the string for potential variables inside
the string.

And Chris, about the book, go for PHP5 Power Programming by Prentice Hall,
it's the best in the market in my opinion, it teaches the language itself,
as well as best practices, all in an OOP twist.

--
itoctopus - http://www.itoctopus.com
Tijnema ! [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 4/5/07, Zoltán Németh [EMAIL PROTECTED] wrote:
 2007. 04. 5, csütörtök keltezéssel 12.52-kor Chris Lott ezt írta:
  Looking for suggestions for a PHP textbook for an Intro to Web
  Programming class that will be using PHP5 and MySQL. This is a
  first-semester course, so no programming experience required.
 
  It would be nice to have a text that adhered to (what I see as) good
  practice using quotation marks... i.e.
 
  print 'The cost is ' . $cost;
  NOT
  print The cost is $cost;
  AND CERTAINLY NOT
  print (The cost is $cost);
 
  echo substr('abcdef', 1);
  NOT
  echo substr(abcdef, 1);

 there is no difference between the above two echo statements. I'm almost
 sure that there is absolutely zero difference between the two kind of
 quotes when there are no variables involved

 greets
 Zoltán Németh

I prefer using double quotes ( ) around strings, because i don't
have to escape single quotes (' ') in words like I'm, don't, etc.

Tijnema

 
 
  I will be teaching, so a book that a student can-- before the class--
  work through and understand is good-- doesn't have to be a traditional
  textbook! But it shouldn't be a reference manual either.
 
  c
  --
  Chris Lott
 

 --
 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] mixture of GET and POST

2007-04-03 Thread itoctopus
Mainly you have to add  a javascript to submit on click (plenty of them by
searching on google). You don't need the href links (I think they're wrong
anyway), you can just have # instead, and you should pass the params to the
submit function.

Simple search on google for your case:
http://www.quirksmode.org/js/forms.html

--
itoctopus - http://www.itoctopus.com
clive [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 This has nothing to do with php, I suggest you read up on how html forms
 work and you may need to learn some javascript.

 clive.



  I have 3 'action' buttons and I am trying to send the $id from the radio
  button and the action to the same page so I can either, Add Edit or
Remove
  the property from the database.
 
  Any ideas how I can get this to work? I can either POST the id's or GET
the
  action but I can't seem to return both to the browser.
 
  Ta,
 
 
  R.
 
  --
 
  form id=form1 name=form1 method=post action=
 
  div id=button_holder
 
  a href=?action=addid=?=$id;?Add Property/a
 
  a href=?action=removeRemove Property/a
 
  a href=?action=editEdit Property/a
 
  /div
 
  div id=table_header
 
  /div
 
 
 
  table id=properties_table
 
  ?php
 
  $query = SELECT * FROM properties;
 
  $result= mysql_query($query);
 
  while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)){
 
 
  ?
 
  trtd class=col_one input type=radio name=id value=? echo
  $row['property_id'];?/td
 
  td class=col_two?php echo $row['property_id'];?/td
 
  td class=col_one?php echo $row['address'];?/td
 
  td class=col_two?php echo $row['postcode'];?/td
 
  td class=col_one£500/td
 
  td class=col_twoLive/td
 
  /tr
 
 
  ?
 
 
  } ?
 
  /table
 
  /form
 


 --
 Regards,

 Clive.

 Real Time Travel Connections


 {No electrons were harmed in the creation, transmission or reading of
 this email. However, many were excited and some may well have enjoyed
 the experience.}

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



[PHP] Re: php-mysql problem

2007-04-03 Thread itoctopus
$sql = SELECT count(Email) as numEmails, Email FROM mena_guests WHERE
Voted='yes' GROUP BY Email ORDER BY numEmails DESC LIMIT $startingID,
$items_numbers_list;

--
itoctopus - http://www.itoctopus.com
Me2resh Lists [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hi
 i need help regarding a sql query in my php app.

 the query is :
 $SQL = SELECT DISTINCT(EMail) FROM mena_guests WHERE Voted = 'yes'
 LIMIT $startingID,$items_numbers_list;

 i want to sort this query by the number of the repeated EMail counts.
 can anyone help me with that please ?


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



[PHP] Re: php-mysql problem

2007-04-03 Thread itoctopus
$sql = SELECT count(Email) as numEmails, Email FROM mena_guests WHERE
Voted='yes' GROUP BY Email ORDER BY numEmails DESC LIMIT $startingID,
$items_numbers_list;

I answered this morning, I don't know why it got deleted

--
itoctopus - http://www.itoctopus.com
Me2resh Lists [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hi
 i need help regarding a sql query in my php app.

 the query is :
 $SQL = SELECT DISTINCT(EMail) FROM mena_guests WHERE Voted = 'yes'
 LIMIT $startingID,$items_numbers_list;

 i want to sort this query by the number of the repeated EMail counts.
 can anyone help me with that please ?


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



[PHP] Re: Problems with mail

2007-04-02 Thread itoctopus
Weird, this code should work. Are you sure there is no hidden space
somewhere in the email. Try just to hardcode the email (eg.
mail('[EMAIL PROTECTED]', $subject_users_subscription_confirmation,
$message_users_subscription_confirmation); and see what'll happen.

--
itoctopus - http://www.itoctopus.com
Mário Gamito [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I have this very straight forward code to send an e-mail:

 $subject_users_subscription_confirmation = Subscription confirmation;
 $message_users_subscription_confirmation = 'Please, click this link to
 confirm your subscritpion:
 http://www.telbit.pt/subscribe-confirm.php?email=' . $email . 'conf=' .
 $barfles;

 mail($email, $subject_users_subscription_confirmation,
 $message_users_subscription_confirmation);

 The three variables are ok, as i debuged them with prints, but no mail
 is sent.

 If i do a test with

 mail('[EMAIL PROTECTED]', 'Hello', 'Hello');

 then the mail is sent ok!

 I'm driving nuts here.

 Can someone give me a hand on this, please ?

 Warm Regards
 --
 :wq! Mário Gamito

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



[PHP] Re: Downloads for subsrcibers only

2007-04-01 Thread itoctopus
Depends where you store the file, if you store the file in the database,
then it's much easier to do it.
Your idea (as it is right now) won't work, because anyone will be able to
copy and paste the link to your PDF document and download it (thus easily
overriding the logic you have in the page).
I've attached a class, called the FileManager class, which handles saving
and displaying data (virtually all types) from the database. It's extremely
easy to use. The usage is demonstrated in download.php (also attached). You
have to add some logic in order to restrict access to your files.

--
itoctopus - http://www.itoctopus.com
Mário Gamito [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I made this site in PHP that has a page with some PDFs to download.
 My costumer wants that only subscribed people are allowed to download
 the PDFs.

 I've already made the subscrbe and login mechanism.

 Now, my question for you is about letting only subscribers download the
 PDFs.
 What is the best approach ?
 Register a session when they login and then in the PDFs page apply a

 if email is registered
   you can download the PDFs
 else
   you can't

 Something like this ?
 Or is it there a better way ?

 Any help would be appreciated.

 Warm Regards
 --
 :wq! Mário Gamito


begin 666 download.php
M/#]P:' -@ES97-S:6]N7V-A8VAE7VQI;6ET97(H)VYO;F4G*3L-@ER97%U
M:7)E*)I;F-L=61ER]C;VYF:6NAP(BD[#0H)+R]-:7-C96QL86YE;W5S
M.CIS86YI=[EMAIL PROTECTED]D[#0H))9I;5?:60@/2!H=UL96YT:71I97,H
M)%]'151;)V9I;5?:[EMAIL PROTECTED])1FEL94UA;F%G97(Z
8.F=E=@D9FEL95]I9P@)1B*3L-C\^
`
end

begin 666 FileManager.class.php
M/#]P:' -@[EMAIL PROTECTED]0E 8VQAW,@1FEL94UA;F%G97(-@D)01EV-R:7!T
M:6]N(%1H:7,@8VQAW,@:%N9QER!I;G1EF%C=EO;B!W:71H($9I;5S
M#0H)4!C;W!YFEG:'0@:71O8W1O'5S(#(P,#@+2!4:[EMAIL PROTECTED];V,@3EB
MF%R0T*2HO#0H)8VQAW,@1FEL94UA;F%G97)[#0H)2\J#0H)0DJ09U
M;F-T:6]N('-A=F4-@D)2I 95S8R!T:ES(9U;F-T:6]N('-A=F5S('1H
M92!F:6QE(EN('1H92!D871A8F%S90T*0D)*D!P87)A;2!AG)A2 D9FEL
M95]H86YD;[EMAIL PROTECTED];4@;[EMAIL PROTECTED]AE(9I;[EMAIL 
PROTECTED]5X+B D7T9)3$536R=T
M:5?9FEL92==*0T*0D)*D!P87)A;2!S=')I;F@)9I96QD7VYA;[EMAIL PROTECTED]AE
M(YA;64@;[EMAIL PROTECTED]AE(9I96QD#0H)0DJ0'!AF%M('-TFEN9R D86-T:6]N
M(%5P9%T92!OB!S879E('1H92!F:6QE(EN('1H92!T86)[EMAIL PROTECTED]5F875L
M=',@=\@V%V92X-@D)2I %R86T@W1R:6YG(1F:6QE7W-O=7)C92!4
M:4@;F%M92!O9B!T:4@V]UF-E('1A8FQE('-A=FEN9R!T:[EMAIL PROTECTED] H
MW5C:!AR!R96%L97-T871E*0T*0D)*D!P87)A;2!S=')I;F@)9I;5?
MV]UF-E7VED(%1H92!I9!O9B!T:4@F]W(EN('1H92!S;[EMAIL PROTECTED]%B
M;4-@D)2I %R86T@;V)J96-T(1D8B!4:[EMAIL PROTECTED]%T86)AV4@:%N9QE
M#0H)2HO#0H)7-T871I8R!F=6YC=EO;B!S879E*1F:6QE7VAA;F1L92P@
M)9I;5?V]UF-E+ D9FEL95]S;W5R8V5?:60L(1A8W1I;VX])W-A=F4G
M+ D86QL;W=E9%]T7!ER ](%RF%Y*DL(1D8BE[#0H)0EI9B H96UP
M='DH)9I;5?:%N9QE6R=T;7!?;F%M92==*2D-@D)0ER971UFX[#0H)
M0DD9%T82 ](%D9'-L87-H97,H9G)E860H9F]P96XH)9I;5?:%N9QE
M6R=T;7!?;F%M92==+ BB(I+ D9FEL95]H86YD;5;)W-IF4G72DI.PT*
M0D):[EMAIL PROTECTED]1A8W1I;VX@/3T@)W-A=F4G*7L-@D)0DD8W)E871I;VYD871E
M(#T@)QAW1U1A=5D871E([EMAIL PROTECTED][EMAIL PROTECTED]@2#II.G,B*3L-@D)
M0DDW%L(#T@)TE.4T525!)3E1/(9I;[EMAIL PROTECTED]9I;5?;[EMAIL PROTECTED]
M7!E+!F:6QE7W-IF4L(9I;5?V]UF-E+!F:6QE7W-O=7)C95]I9P@
M9FEL95]B:6YAGDL(9I;5?8W)E871I;VYD871E+!F:6QE7VQAW1U1A
M=5D871E*2!604Q515,@*%PG)RXD9FEL95]H86YD;5;)VYA;64G72XG7L
M(%PG)RXD9FEL95]H86YD;5;)W1Y4G72XG7L(%PG)RXD9FEL95]H86YD
M;5;)W-IF4G72XG7L(%PG)RXD9FEL95]S;W5R8V4N)UPG+!)RN)9I
M;5?V]UF-E7VED+B=)[EMAIL PROTECTED]G+B1D871A+B=)[EMAIL 
PROTECTED]G+B1CF5A=EO
M;F1A=4N)UPG+!)RN)QAW1U1A=5D871E+B=)RDG.PT*0D)0T*
M0D)2\O;F]W(EF('1H92!T7!E(ES(%N(EM86=E+!T:5N(-R96%T
M92!A('1H=6UB;F%I; HF5S:7IE('-H;W5L9!B92!R96QA=EV92D-@D)
M0D-@D)7T-@D)65LV5[#0H)0D))QAW1U1A=5D871E([EMAIL PROTECTED]%T
[EMAIL PROTECTED]@2#II.G,B*3L-@D)0DDW%L(#T@)U501$%412!F:6QE(%-%
M5!F:6QE7VYA;64]7G+B1F:6QE7VAA;F1L95LG;F%M92==+B=)[EMAIL PROTECTED]
M95]T7!E/5PG)RXD9FEL95]H86YD;5;)W1Y4G72XG7L(9I;5?V]U
MF-E/5PG)RXD9FEL95]S;W5R8V4N)UPG+!F:6QE7W-O=7)C95]I9#U)RN
M)9I;5?V]UF-E7VED+B=)[EMAIL PROTECTED]:6YAGD]7G+B1D871A+B=
M)[EMAIL PROTECTED]%T93U)RN)QAW1U1A=5D871E+B=
M)R[#0H)0D)#0H)0D)+R]N;W@:[EMAIL PROTECTED]AE('1Y4@:7,@86X@:6UA9V4L
M('[EMAIL PROTECTED]([EMAIL PROTECTED]AU;6)N86EL#0H)0D)#0H)0E]#0H)0DDF5S
M=6QT/2 D9(M/G%U97)Y*1S6PI.PT*0E]#0H)0T*[EMAIL PROTECTED]0D)*D!F
M=6YC=EO;B!G970-@D)2I 95S8R!4:ES(9U;F-T:6]N(')E='5R;G,@
M82!L:6YK('1O('1H92!F:6QE()AV5D(]N('1H92!I9 T*0D)*D!P87)A
M;2!S=')I;F@)9I;5?:[EMAIL PROTECTED]AE(ED(]F('1H92!F:6QE(EN('1H92!D
M871A8F%S90T*0D)*D!P87)A;2!O8FIE8W0@)1B(%1H92!D871A8F%S92!H
M86YD;4-@D)2I F5T=7)N('9O:60-@D)*B\-@D)W1A=EC(9U;F-T
M:6]N(=E=@D9FEL95]I9P@)1B*7L-@D)21S6P@/2 G4T5,14-4(9I
M;5?:60L(9I;5?;[EMAIL PROTECTED]7!E+!F:6QE7W-IF4L(9I;5?
M8FEN87)Y([EMAIL PROTECTED]:5R92!F:6QE7VED/5PG)RXD9FEL95]I9XG
M7G.PT*0D))')EW5L=#T@)1B+3YQ=65R[EMAIL PROTECTED]W%L*3L-@D)6AE861E
M[EMAIL PROTECTED]5N=UL96YG=@Z)RXDF5S=6QT6S!=6R=F:6QE7W-IF4G72D[
M#0H)0EH96%D97(H)T-O;G1E;G0M='EP93HG+B1R97-U;'1;,%U;)V9I;5?
M='EP92==*3L-@D)2\O:68@:70GR!N;[EMAIL PROTECTED]@:[EMAIL 
PROTECTED]AE;B!D;W=N
M

[PHP] Re: finding the index name of an associative array

2007-04-01 Thread itoctopus
Note, however, that array_keys is not recursive.

--
itoctopus - http://www.itoctopus.com
Man-wai Chang [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Jake McHenry wrote:
  foreach ($myarray as $key = $value)
  {
echo $key = $value;
  }

 Thanks. I just found that there is an array_key() function.

 --
   .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
  / v \  Simplicity is Beauty! May the Force and Farce be with you!
 /( _ )\ (Ubuntu 6.10)  Linux 2.6.20.4
   ^ ^   17:09:01 up 8 days 4:21 1 user load average: 1.10 1.03 1.01
 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

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



[PHP] Re: Get free broadband internet from google!

2007-04-01 Thread itoctopus
That's funny, looks like the good people at google have lots of time on
their hands.

--
itoctopus - http://www.itoctopus.com
Tijnema ! [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 It's true, free broadband internet from google :)

 Have a look at this page:
 http://www.google.com/tisp

 Start now with installing:
 http://www.google.com/tisp/install.html


 Tijnema




































































 ps. 1 April is cool huh?

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



[PHP] Re: finding the index name of an associative array

2007-04-01 Thread itoctopus
foreach is also not recursive, writing a recursive function to recursively
return the keys in an array should be trivial.

--
itoctopus - http://www.itoctopus.com
Man-wai Chang [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 itoctopus wrote:
  Note, however, that array_keys is not recursive.

 foreach is recursive??? thanks.

 --
   .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
  / v \  Simplicity is Beauty! May the Force and Farce be with you!
 /( _ )\ (Ubuntu 6.10)  Linux 2.6.20.4
   ^ ^   20:44:01 up 8 days 7:56 0 users load average: 1.00 1.00 1.00
 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

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



[PHP] Re: Speed of apache/php4 on windows

2007-03-31 Thread itoctopus
Few seconds more? Even a second is a lot, typically, you measure the speed
of a php script in microseconds. I have PHP5+Apache running on my windows XP
laptop (which is not state of the art) and it's quite fast. I believe you
have an installed software on your machine that is causing this. Try to run
a PHP script with nothing running in the background and see what'll happen.

--
itoctopus - http://www.itoctopus.com
Don Don [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all, i've got apache/php4 running on windows xp with good hardware
configuration etc. However, the speed of execution of php pages is really
slow.   When testing on my local development machine it takes a few more
seconds executing php files than it should normally take.

   How can I up the speed of execution ?  is this possible ?  On my hosting
server its really really fast !  and I will like the same settings for my
local machine as it has a very good hardware configuration and memory.

   cheers


 -
 Expecting? Get great news right away with email Auto-Check.
 Try the Yahoo! Mail Beta.

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



[PHP] Re: Speed of apache/php4 on windows

2007-03-31 Thread itoctopus
Few seconds more? Even a second is a lot, typically, you measure the speed
of a php script in microseconds. I have PHP5+Apache running on my windows XP
laptop (which is not state of the art) and it's quite fast. I believe you
have an installed software on your machine that is causing this. Try to run
a PHP script with nothing running in the background and see what'll happen.

--
itoctopus - http://www.itoctopus.com
Don Don [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all, i've got apache/php4 running on windows xp with good hardware
configuration etc. However, the speed of execution of php pages is really
slow.   When testing on my local development machine it takes a few more
seconds executing php files than it should normally take.

   How can I up the speed of execution ?  is this possible ?  On my hosting
server its really really fast !  and I will like the same settings for my
local machine as it has a very good hardware configuration and memory.

   cheers


 -
 Expecting? Get great news right away with email Auto-Check.
 Try the Yahoo! Mail Beta.

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



[PHP] Re: PHP Upgrade: 5 or 6

2007-03-28 Thread itoctopus
I'm migrating my company to PHP 5 (from PHP4) now. I've played with PHP6 a
while ago and the only thing I can remember about it is that it obsoletes a
not so few functions and has a stricter coding rules.

--
itoctopus - http://www.itoctopus.com
Davi [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 Hi all.

 I've reading on some sites [1,2] that PHP 6 is comming soon...

 What should I do?
 Migrate my server and apps to PHP 5 now and, later to PHP 6, or wait some
more
 time and migrate all to PHP 6?

 TIA

 --
 Davi Vidal
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 --

 Agora com fortune:
 The main thing is the play itself.  I swear that greed for money has
nothing
 to do with it, although heaven knows I am sorely in need of money.
 - Feodor Dostoyevsky

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



Re: [PHP] using for loop in function

2007-03-28 Thread itoctopus
I don't quite understand why you're naming the checbox, you can easily go
for name={$name}[];

--
itoctopus - http://www.itoctopus.com
Jim Lucas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Richard Kurth wrote:
 The function below will create a group of checkboxes it will also
check
  the checkbox that is stored in the table field that is in $select_value
this
  works fine if there is only one value in the variable but if there is
more
  stored like 1,2,3,4 it will not work. I am trying to figure out how to
use
  the following for loop to add the number to each checkbox and if they
match
  mark the checkbox checked
 
 
   $ExplodeIt = explode(,,$select_value,,);
  $Count = count($ExplodeIt);
  for ($i=0; $i  $Count; $i++) {
}
 
 
 
  function checkbox($sqlu,$name,$value1,$value2,$select_value){
$name_result = safe_query($sqlu);
 while($rowu=mysql_fetch_array($name_result)){
echo trtd colspan=\2\ align=\left\input type='checkbox'
name='
  . $name . [ . $rowu[$value1] . ]' value=\$rowu[$value1]\;
 
   if($select_value==$rowu[$value1]) {
 
 echo  checked$rowu[$value2]\n/td/trBR;
 
 }else{
echo $rowu[$value2]\n/td/trBR;
}
 }
  }
 
 
 
 
 
 I have used in_array as a way of doing what you are looking for.

 function checkbox($sqlu,$name,$value1,$value2,$select_value){
  $name_result = safe_query($sqlu);
  while ( $rowu = mysql_fetch_array($name_result) ) {
  $checked = '';
  if ( in_array($rowu[$value1], $select_value) ) {
  $checked = ' checked=checked';
  }
  echo HTML

 tr
  td colspan=2 align=left
  input
  type=checkbox
  name={$name}[{$rowu[$value1]}]
  value={$rowu[$value1]}
  {$checked} /{$rowu[$value2]}
  /td
 /tr

 HTML;

  }
 }


 Personally, I would change your SQL query to return only the two columns
 that you are wanting to display.  And also use the mysql_fetch_assoc()

 SELECT id AS colA, name AS colB FROM myTable;

 and not this

 SELECT * FROM myTable;


 This would then allow me to write your function this way.

 function checkbox($sqlu,$name,$selected=array()){
  if ( ( $name_result = safe_query($sqlu) ) === false ) {
  die('something went wrong');
  }
  while ( $rowu = mysql_fetch_assoc($name_result) ) {
  $checked = '';
  if ( in_array($rowu['colA'], $selected) ) {
  $checked = ' checked=checked';
  }
  echo HTML

 tr
  td colspan=2 align=left
  inputtype=checkbox
  name={$name}[{$rowu['colA']}]
  value={$rowu['colA']}
  {$checked} /{$rowu['colB']}
  /td
 /tr

 HTML;

  }
 }

 Hope this helps

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



Re: [PHP] changing array to a string

2007-03-28 Thread itoctopus
join is also an alias for implode in case you're having trouble remembering
the name, so you can go for
$ids = join(',', $_POST['subscriptions']);

--
itoctopus - http://www.itoctopus.com
Chris [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Richard Kurth wrote:
  When I submit the for below it gives me an array that looks like this
  array(5) { [0]= string(1) 3 [1]= string(1) 4 [2]= string(1) 5
  [3]= string(1) 6 [4]= string(1) 7 } 
  I would like to convert it to a string like this  3,4,5,6,7

 $ids = implode(',', $_POST['subscriptions']);

 --
 Postgresql  php tutorials
 http://www.designmagick.com/

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



[PHP] Re: Smarty Website down?

2007-03-27 Thread itoctopus
looks ok now

--
itoctopus - http://www.itoctopus.com
Mario Guenterberg [EMAIL PROTECTED] wrote in message
news:20070327092337.GA24779@/bin/dnsdomainname...
Hi...

I try to connect in the last hours and the results are timeouts.

Greetings
Mario

--
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -

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



[PHP] Re: gethostbyname () uses old DNS server

2007-03-27 Thread itoctopus
gethostbyname uses the local DNS cache, could that be the problem?

--
itoctopus - http://www.itoctopus.com
Kent Tong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 We have moved our DNS server from one IP to another. But on a Linux
 server, the PHP programs keep using the old DNS server IP. For
 example, for a simple php file:

 ? echo gethostbyname (smtp.cpttm); ?

 When it is run, it tries to lookup smtp.cpttm using the old DNS
 server (I know it using tcpdump). The new DNS server is specified in
 /etc/resolv.conf. If I issue ping smtp.cpttm in a command prompt,
 then tcpdump shows that it is accessing the new DNS server.

 Any idea? Thanks.

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



Re: [PHP] Optimization of all mysql databases on a server

2007-03-27 Thread itoctopus
Agreed that mysqlcheck is much more efficient...
As for the timeout thing, I rememeber we were once using wget to run php
scripts (which was not the correct way). Anyway, we had a script that was
repeating every 15 minutes, and eventually we discovered that by default
wget has a timeout of 15 minutes, and if it reaches that timeout, it will
restart the script (thinking something went wrong), very bad implementation
(of wget) in my opinion. As of then, we started running CRON php scripts
without using wget.

--
itoctopus - http://www.itoctopus.com
Jochem Maas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Tijnema ! wrote:
  On 3/26/07, Chris [EMAIL PROTECTED] wrote:
  itoctopus wrote:
   The purpose of this script is to optimize all associated tables in
all
   databases on a mysql server. This script is working great, you can
  put in a
   CRON and run it every day. Feel free to throw in your 2 cents!
 
  It's going to time out if you have any large databases or tables.

 php will not timeout on the commandline unless you actually specify
 a timeout - unlike php as used as a webserver SAPI.

 
  What about set_time_limit(99)??

 RTFM: set_time_limit(0);

 although it's not needed.

 
 
  Also a much easier option is to run
 
  mysqlcheck -o ...

 indeed - use the right tool for the job.

 
  That's true :)
 
  Tijnema
 
  --
  Postgresql  php tutorials
  http://www.designmagick.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] Optimization of all mysql databases on a server

2007-03-27 Thread itoctopus
You're right, it was running from a browser, you need to use set_time_limit.

--
itoctopus - http://www.itoctopus.com
Chris [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Jochem Maas wrote:
  Tijnema ! wrote:
  On 3/26/07, Chris [EMAIL PROTECTED] wrote:
  itoctopus wrote:
  The purpose of this script is to optimize all associated tables in
all
  databases on a mysql server. This script is working great, you can
  put in a
  CRON and run it every day. Feel free to throw in your 2 cents!
  It's going to time out if you have any large databases or tables.
 
  php will not timeout on the commandline unless you actually specify
  a timeout - unlike php as used as a webserver SAPI.

 Considering the amount of html in the script I guessed (maybe
 incorrectly) it was for running from a browser - which is why I
 mentioned about the timeout issue.

 A command line script isn't going to have br/'s or tables or anything
 (well, none that I've written recently do).

 --
 Postgresql  php tutorials
 http://www.designmagick.com/

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



Re: [PHP] syntax question

2007-03-26 Thread itoctopus
Escape it, use either htmlentities (with ENT_QUOTES) or addslashes.

--
itoctopus - http://www.itoctopus.com
Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Mon, March 26, 2007 9:59 am, Ross wrote:
  Can I put post values directly into insert statements?
 
  $query = INSERT INTO categories (category_name) VALUES
  ('$_POST['cat_name']);

 Sure!

 If you want your webserver to get hacked by the Bad Guys, just go
 right ahead and do that.

 [that was tounge-in-cheek]

 Start reading here:
 http://phpsec.org

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

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



Re: [PHP] Computing and calculating dates

2007-03-24 Thread itoctopus
In case you're doing so only for database update/check, then you can use
mysql's built-in date_add function.
In case you really want it in PHP, then here's a link simultating:
http://news.hping.org/comp.lang.php.archive/10638.html



--
itoctopus - http://www.itoctopus.com
Travis Doherty [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Otto Wyss wrote:

  This probably has been asked several times yet I can't find a
  satisfying solution. What's the simplest way to compute dates like
 
local_formated_date + 7; // days
local_formated_date  local_formated_first_day_next_month;
local_formated_date  (current_date + 14)
 
  etc. Which functions are best suited for such calculations?
 
  O. Wyss
 
 www.php.net/strtotime is probably a good start.

 Travis Doherty

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



[PHP] Luhn algorithm

2007-03-24 Thread itoctopus
Here's the Luhn algorithm in PHP. The Luhn algorithm is mainly used to check
if a credit/debit card number is valid or not.
Please tell me if there's a bug somewhere, I've tested the thing heavily and
it's working like a charm.

/*
 [EMAIL PROTECTED] check_luhn
 [EMAIL PROTECTED] This function checks if a card number follows the Luhn 
algorithm
 [EMAIL PROTECTED] string $strCreditCardNumber The card number (maybe AMEX, 
Diner's
Club, Discover, JCB, Maestro, MasterCard, Solo, Switch, Visa, and Visa
Electron)
 [EMAIL PROTECTED] boolean TRUE if the card follows the Luhn algorith, false if 
not
 [EMAIL PROTECTED] check_lun('4123456789012345')
*/
function check_luhn($strCardNumber){
 //first convert the credit card number to an array of digits
 $arrCardDigits = array();
 for ($i = 0; $i  strlen($strCardNumber); $i++)
  $arrCardDigits[$i] = (int)$strCardNumber[$i];
 //now start the algorithm
 $sum = 0;
 $alt = false;
 for($i = count($arrCardDigits) - 1; $i = 0; $i--){
  if($alt){
   $arrCardDigits[$i] *= 2;
   if($arrCardDigits[$i]  9)
$arrCardDigits[$i] -= 9;
  }
  $sum += $arrCardDigits[$i];
  $alt = !$alt;
 }
 return $sum % 10 == 0;
}

--
itoctopus - http://www.itoctopus.com


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



[PHP] Re: Book Suggestion for ZCE

2007-03-24 Thread itoctopus
Sams - Zend Php Certification Study Guide for the certification.
An excellent book on PHP is PHP5 Power Programming (by Prentice Hall).

--
itoctopus - http://www.itoctopus.com
Danial Rahmanzadeh [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hey dudes,
 i want to know that which books are good to read  before ZCE exam.
  I have read php 5 and php 4 study guides and php 4 practice tests. I have
 also read php|architect's guide to php security and bought a 10 slot
sample
 exam. What else do you suggest?
 cheers,
 Danial


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



[PHP] Re: My own captcha from 2 years ago......

2007-03-24 Thread itoctopus
Hey Jake,
I checked the thing, and I tell you I did lots and lots of captchas in my
life and they mainly rely on the session.
Is it possible for you to post the script so that me (or anyone else for
that matter) fix it for you?

Take care,

--
itoctopus - http://www.itoctopus.com
Jake McHenry [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Well, I've been creating my own... Since like two years ago... Lol.. But
 this is the KNOWN name now. Anyways... How can I get the info from the
 image creation script back to my main script? Sessions DO NOT WORK! They
 give me the previous entry instead of the current.. Which obviously won't
 work... This was on the back burner for a long time, but my boss said
.
 Oh wow.. That looks cool... And I told him I had started it a long time
 ago.. But never finished it cause he told me to work on something else...
 Anyways... U can see what I mean http://nittanytravel.com:8080/

 The numbers surrounding the images displayed are session values created in
 the image scripts...which as you will see are the previous value It
may
 be a simple fix.. But once again... I'm tired... And had one too many long
 island iced teas tonight to think about this. And yes... My boss works
 me even on saturdays after happy hour :(


 Thanks,
 Jake


 --
 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007
 3:27 PM


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



Re: [PHP] Passing variables

2007-03-22 Thread itoctopus
Since you're new to this, always be sure to clean up the output you get from
$_GET or $_POST to avoid sql injection.

Fore example: $search_value = htmlentities($_GET['search_value'],
ENT_QUOTES);
If you're casting to something other than a string (such as int) than you're
safe and you don't have to use htmlentities.

--
itoctopus - http://www.itoctopus.com
Jeff [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thank you Chris!

 Chris [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Jeff wrote:
  I want to thank you all for clearing me up on setting the
  register_globals to ON issue!! I have refrained from doing so and my
code
  is running great with the $_GET.
 
  I am having NO trouble passing my single variable to the next page
  using..
 
  echo A href=\char_edit_form.php?charid=$charid\Edit/A;
 
  as when the next page that load actually shows the character info, so
  basically you can see you are dealing with the correct record.
 
  NOW.
 
  I want to pass two variables to a delete page. The charid and the char
  name. Here is what I have but it will only pass the 1st variable
?charid
 
  echo A href=\delete_char.php?charid=$charid
  ?char=.$myrow[char_name].\Delete/A;
 
  The first one is preceded by a ?
 
  Subsequent ones are with an ''.
 
  See http://en.wikipedia.org/wiki/Query_string
 
  --
  Postgresql  php tutorials
  http://www.designmagick.com/

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



[PHP] Re: newbie question

2007-03-21 Thread itoctopus
Means you're passing the variable as reference.
This means that any change in the variable inside your function will affect
the variable outside your function, in other terms:

if you have

function myfunc($var){
$var = 5;
}

$a = 6;
myfunc($a);

will result in having $a=5 after the function all.

--
itoctopus - http://www.itoctopus.com
bob pilly [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all

 Can anyone tell me what '' means before a var?

 e.g function($var)

 Thanks for any help in advance





 ___
 What kind of emailer are you? Find out today - get a free analysis of your
email personality. Take the quiz at the Yahoo! Mail Championship.
 http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk

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



[PHP] Re: _Construct question

2007-03-21 Thread itoctopus
They're basically the same thing, however, you can only use __construct in
PHP5.

--
itoctopus - http://www.itoctopus.com
John Comerford [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi Folks,

 I am still pretty new to PHP and I have a question regarding classes and
 using _construct.  Up until now I have been creating my classes as
follows:

 class test1 {
  var $name;
  function test1($pName) {
$this-name = $pName;
  }
 }

 So I when I create a new class I can assign 'name' by doing '$t1 = new
 test1(test1);'

 As part of another thread I noticed the _construct function which (if I
 am correct) does more or less the same thing:

 class test2 {
  var $name;
  function _construct($pName) {
$this-name = $pName;
  }
 }

 I have fished around a bit and cannot find why one might be better than
 the other.  The only thing I can think is that maybe you need to use
 _construct to be able to use extends ?

 Is this the case ?   What is the advantage/disadvantage of using
 _construct as opposed to using a function with the classname ?

 Thanks,
   JC

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