[PHP] Re: windows files and folders permission

2013-08-23 Thread Carlos Medina
Hola Emiliano,
i think you should to redefine your question because i can not
understand what you want. Please post parts of the code, examples,
errors, etc.

regards

Carlos Medina

Am 23.08.2013 06:28, schrieb Emiliano Boragina:
 Night everyone, I did a upload page and when upload a JPG file this is not
 available. Why this happens? Thanks a lot.
 
 
 Emiliano Boragina | gráfico + web
 desarrollos  comunicación
 
 + 15 33 92 60 02
 » emiliano.borag...@gmail.com
 
 © 2013
 
 
 


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



[PHP] Re: Fwd: Is it possible???

2013-06-24 Thread Carlos Medina
Hi Karl,
i dont know what you want to do. But i can say: The
$item_amount_in_store variable is not the same to $item_amount_in_Store
(case sensitive). It work for me...

Regards

Carlos Medina


Am 24.06.2013 14:02, schrieb Karl-Arne Gjersøyen:
 Error in my last post This is corrected:
 
 $item_amount_in_store = 223;
 $update_amount = 7;
 $item_amount_in_Store += $update_amount;
 
 It show the result = 227 and not 230. Why is this happen?
 
 Karl
 
 -- Forwarded message --
 From: Karl-Arne Gjersøyen karlar...@gmail.com
 Date: 2013/6/24
 Subject: Is it possible???
 To: PHP Mailinglist php-general@lists.php.net
 
 
 $item_amount_in_store = 223;
 $update_amount = 7;
 $update_item_amount_in_store += $update_amount;
 $update_amoint_in_store is now 227;
 
 Why? That should be 230!
 
 Karl
 
 
 


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



Re: [PHP] Fwd: Is it possible???

2013-06-24 Thread Carlos Medina

Amen!




Am 24.06.2013 18:17, schrieb Maciek Sokolewicz:
 On 24-6-2013 14:27, n...@nobswolf.info wrote:
 You should give a complete programm so we can run exactly
 the same you do, like this:

 ?php

 $item_amount_in_store = 223;

 print ($item_amount_in_store);
 Please please please please don't do this!
 
 First of all, I don't know why you would use the print *function* when
 you can also use the echo language construct (better and faster). But
 that's not that important; it's not bad to use it, just imo a bit ugly
 (pet peeve ;)).
 
 But more importantly:
 $variable is completely and utterly useless. You're basically creating
 a string, interpolating a variable in it, and adding no more content.
 This is effectively the same as saying:
 print(.$var.)
 Does that look right to you? To me it looks... wrong...
 
 Why not just a simple:
 echo $var;
 or
 print($var) if you really must.
 
 And if you really really must cast the variable to a string, you can
 always use the explicit:
 (string) $var
 

 $update_amount = 7;
 $item_amount_in_store += $update_amount;

 print ( + $update_amount = $item_amount_in_store  );
 ?

 which gives this result:

 223 + 7 = 230

 


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



[PHP] Re: scandir doesn't find all files

2013-06-23 Thread Carlos Medina
Hi,
check the permissions:

if the server can access to files or create files
if the FTP creates the files with the right permission
if a script is running, check if the script can creates the files with
the right permission


Regards

Carlos Medina


Am 22.06.2013 21:10, schrieb Daniel Pöllmann:
 Hi,
 I have some files in a directory - some are uploaded via ftp and some other
 are created by a php script.
 
 Scandir just finds the uploaded files, but none of the created files.
 I can't run chown() because the server is part of shared hosting.
 
 I can't find anything about this behavour in the documentation.
 
 Best wishes,
 Daniel
 


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



[PHP] Re: XML to Array

2013-03-10 Thread Carlos Medina
Hi,
use https://github.com/theseer/fDOMDocument. You can install it over
PEAR. You can use it like

$xml = 'xmlroottest id=my_id /';
$dom = new fDOMDocument();
$dom-loadXML($xml);

// get attribute
$elementNode = $dom-queryOne('//test[@id=my_id]');
echo $elementNode-nodeValue;


Greetings

Carlos Medina



Am 10.03.2013 11:47, schrieb Karl DeSaulniers:
 Hi Guys,
 I am hoping someone can guide me or help me fix this issue.
 I have been lost in the code for some time now.
 I am trying to get the attributes of an xml node.
 I have this code:
 
 function xml_parse_into_assoc($data)
 {
 $p = xml_parser_create();
   if(stripos($data, http, 0) !== false) {
 if (!($fp = @ fopen($data, 'rb')))
 {
 return array ();
 }
 while (!feof($fp))
 {
 $xml .= fread($fp, 8192);
 }
 fclose($fp);
 } else if(stripos($data, ?, 0) !== false) {
 $xml .= $data;
 }
   xml_parser_set_option($p, XML_OPTION_TARGET_ENCODING,
 ISO-8859-1);
   //xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);
   xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, 1);

   xml_parse_into_struct($p, $xml, $vals, $index);
   xml_parser_free($p);

   $levels = array(null);

   foreach ($vals as $val) {
 if ($val['type'] == 'open' || $val['type'] == 'complete') {
   if (!array_key_exists($val['level'], $levels)) {
 $levels[$val['level']] = array();
   }
 }

 $prevLevel = $levels[$val['level'] - 1];
 $parent = $prevLevel[sizeof($prevLevel)-1];

 if ($val['type'] == 'open') {
   $val['children'] = array();
   $val['attributes'] = array();
   array_push($levels[$val['level']], $val);
   continue;
 }

 else if ($val['type'] == 'complete') {
   $parent['children'][$val['tag']] = $val['value'];
 }

 else if ($val['type'] == 'close') {
   $pop = array_pop($levels[$val['level']]);
   $tag = $pop['tag'];

   if ($parent) {
 if (!array_key_exists($tag, $parent['children'])) {
   $parent['children'][$tag] = $pop['children'];
 }
 else if (is_array($parent['children'][$tag])) {
 if(!isset($parent['children'][$tag][0])) {
 $oldSingle = $parent['children'][$tag];
 $parent['children'][$tag] = null;
 $parent['children'][$tag][] = $oldSingle;

 }
   $parent['children'][$tag][] = $pop['children'];
 } else if (array_key_exists('attributes', $val)) {
 if (isset($val['value'])) {
 $parent['children'][$tag] = $val['value'];
 }
 foreach ($val['attributes'] as $key=$value) {
 $parent['children'][$tag][$key] = $value;
 }
   }
   } else {
 return(array($pop['tag'] = $pop['children']));
   }
 }

 $prevLevel[sizeof($prevLevel)-1] = $parent;
   }
 }
 
 This is the part I am adding to try and acheive this.
 
 ...
  else if (array_key_exists('attributes', $val)) {
 if (isset($val['value'])) {
 $parent['children'][$tag] = $val['value'];
 }
 foreach ($val['attributes'] as $key=$value) {
 $parent['children'][$tag][$key] = $value;
 }
   }
 ...
 
 I do admit I haven't the foggiest idea what I am doing here, so I am
 noobing out here on how this php function is really working.
 I got it off php.net and am trying to implement it in my code. Without
 my addition it works well except it doesn't grab any attributes
 which I need in order for my script to work properly.
 
 Any ideas on what I am doing wrong?
 
 TIA,
 
 Best,
 Karl
 
 PS: please be gentle.. (: ))
 
 
 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com
 
 


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



[PHP] Re: Using PEAR and PHP

2012-08-25 Thread Carlos Medina
Hi Suraj,
take my advice: read the Manual!

Greets

Carlos


Am 23.08.2012 19:42, schrieb Suraj Shah:
 Hi.
 
 I am currently working on a website which uses PHP as an integral programming 
 language as part of it.
 
 I am trying to replicate the website’s contents from one ftp server to 
 another but am encountering serious issues in doing so. I’ve spent two days 
 trying to find out the reasons and now think its down to the PEAR 
 installation.
 
 This is therefore a question on if I want to transfer a website from one 
 domain to another, then do I need to install PEAR and re-configure all the 
 files? At the moment, all I can see within the ftp client regarding PEAR are 
 the ‘Mail’ and ‘Mail_Mime’ components.
 
 I am new to this so any help on this would be great.
 
 Many thanks
 
 Suraj
 
 
 Suraj Shah
 Online Marketing Executive
 26 Throgmorton Street | London | EC2N 2AN
 t: 020 7826 9031
 e: su...@aifa.net
 w: www.aifa.net
 


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



[PHP] Re: set up mass virtual hosting with apache/nginx and PHP ... best practice2012?

2012-08-25 Thread Carlos Medina
Hi,

Read the Apache and PHP Documentation, if you have any questions after
this. write again...


Greets

Carlos



Am 22.08.2012 01:26, schrieb D. Dante Lorenso:
 All,
 
 I need to set up a server to enable 5,000 students to have web hosting
 provided by the school with PHP and MySQL support.  I'm trying to figure
 out what is the best way to do this.
 
 We have Active Directory and are using Centrify to authenticate
 usernames and passwords on our Linux servers.  I am imagining it would
 be great if we use something like ExecCGI to ensure that PHP runs as the
 user that owns the files.  We would then provide FTP access to the files
 and FTP would authenticate against Active Directory making sure to set
 the proper user/group on files when uploaded.
 
 I see that PHP-FPM exists: http://php-fpm.org  and it claims Ability to
 start workers with different uid/gid/chroot/environment and different
 php.ini (replaces safe_mode) which is exactly what I'm looking for.  It
 also claims PHP-FPM is now included in PHP core as of PHP 5.3.3. so
 that's good.
 
 I also read about the greatness that is NGinX: http://nginx.org though I
 don't know if I can use it because I think I also need to use .htaccess
 files.  I need a way for students to be able to password protect their
 directories and files.  If there's another way using NGinX or Apache,
 that's good too.  I know of no other way.
 
 Here is an interesting article from 2009:
 http://www.howtoforge.com/how-to-set-up-mass-virtualhosting-with-apache2-mod_rewrite-mod_userdir-mod_suexec-on-centos-5.3
 
 
 That uses mod_rewrite to attempt something like what I'm trying to do
 ... and then, Apache has mod_vhost_alias:
 http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html
 
 So, I see a lot of information out there.  Apache, NginX, ExecCGI,
 FastCGI, mod_vhost_alias, mod_rewrite, SuExec, mod_userdir.  I suspect
 some of these methods are old and out of date.
 
 In my ideal situation:
 
  - users would be created in AD and would exist on the OS
 
  - student domain names would look like:
 http://username.student.school.edu/ - OR -
 http://student.school.edu/username/
 
  - file directories would look like:
 /mnt/somedir/username/docroot
 
  - students would be able to create PHP applications executed with
 their own permissions
 
  - I would be able to configure all 5,000 accounts with a single
 configuration (1 virtual host rule?)
 
 Do you know what the best practices are for now ... here in 2012?
 
 -- Dante
 


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



Re: RES: [PHP] XML/PHP web service

2012-08-09 Thread Carlos Medina
Hi,
the two options offers here are ok. But please make it secure!

Regards

Carlos

Am 09.08.2012 14:38, schrieb Alejandro Michelin Salomon:
 Philip :
 
 Try this:
 
 Client:
 
 $client = new SoapClient( null, array( 'encoding' = 'utf-8', 'soap_version'
 = SOAP_1_2, 'trace' = 1, 
  'uri' = 'tns: Server', 'location' = 'php
 server URL here'));
 
 // Cut off ?xml version=1.0 encoding=utf-8?, to not have two xml start
 tag in the soap message.
 $xmlres = $client-__soapCall( 'ProXML', array( str_replace( '?xml
 version=1.0 encoding=utf-8?'.\n, '', $sXml )));
 
 echo 'pre', $xmlres, '/pre'; // print the xml output or
 var_export($xmlres, true) if $xmlres is an array.
 
 
 SERVER:
 
 
 class Receiver
 {
 public function ProXML ( $sXML )
 {
 
 libxml_use_internal_errors(true); // enabled use libxml errors
 
 // try..catch to cacth simplexmlelement errors
 try
 {
 $xml = new SimpleXMLElement( '?xml version=1.0
 encoding=utf-8?' . $sXML ); // Try to create a xml object with the string
 passed
 } catch (Exception $e) {
 
 $aErrors = libxml_get_errors(); // get errors
 
   foreach ( $aErros as $oErro )
 {
 switch ( $oErro-level )
 {
 case LIBXML_ERR_WARNING:
 $sCod .= 'returncode' . $oErro-code .
 '/codemenssage' . utf8_encode( 'warning: ' . $oErro-message ) .
 '/menssage/return';
 break;
 case LIBXML_ERR_ERROR:
 $sCod .= 'respostacodigo' . $oErro-code .
 '/codemenssage' . utf8_encode( 'Error: ' . $oErro-message ) .
  '/menssage/return';
 break;
  case LIBXML_ERR_FATAL:
 $sCod .= 'respostacodigo' . $oErro-code .
 '/codemenssage' . utf8_encode( ' Fatal Error: ' . $oErro-message ) .
  '/menssage/return';
  break;
 }
  }
 }
 
 work here ...
 
 }
 
 }
 
 
 $server = new SoapServer(null, array( 'uri' = 'tns: Server' ));
 
 $server-setClass('Receiver');
 
 $server-handle();
 
 
 
 
 Alejandro M.S
 
 -Mensagem original-
 De: Phillip Baker [mailto:phil...@freewolf.net] 
 Enviada em: quarta-feira, 8 de agosto de 2012 19:12
 Para: php-general@lists.php.net
 Assunto: [PHP] XML/PHP web service
 
 Greetings all,
 
 I am looking for some options here.
 
 I am in need of creating a service on our web server that will always be
 available and automated.
 It will accept an XML file.
 
 I will be checking to see if the XML file is valid and then passing it on to
 another server.
 But I need to accept this file without using a submit form.
 I have never done anything like this and looking for ideas.
 
 I am using a lamp environment and looking for suggestions.
 
 I am looking to set this up so that our vendors can set up scripts to
 automatically post XML files to our servers.
 
 Blessed Be
 
 Phillip
 
 In the Jim Crow South, for example, government failed and indeed refused to
 protect blacks from extra-legal violence. Given our history, it's stunning
 we fail to question those who would force upon us a total reliance on the
 state for defense.
 -- Robert J. Cottrol
 


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



[PHP] Re: SOAP

2012-01-18 Thread Carlos Medina
Am 17.01.2012 11:55, schrieb DPRJ Sistemas (OK Cosméticos):
 Hello!
 
  
 
 I am looking for some help on Web Services (SOAP) client.
 
  
 
 Is there anyone here who has already worked with such client?
 
  
 
 Thank you
 
  
 
 Deleo
 
 
Yes Me

Regards

Carlos Medina

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



[PHP] Re: String is not zero-terminated in zend_execute_API.c

2011-10-21 Thread Carlos Medina
Am 21.10.2011 08:49, schrieb Daniel Betz:
 Hello List,
 
 i am running PHP 5.3.8-FPM (with ondemand patch) in debug mode and got this 
 error every time I post an reply in vBulletin Board:
 
 Warnung: String is not zero-terminated 
 (Z.ý4 ý4 ú}µóU) (source: 
 /usr/src/php-5.3.8/Zend/zend_execute_API.c:447) in 
 [path]/includes/functions_newpost.php(668) : eval()'d code (Zeile 34)
 
 functions_newpost.php:
   29 if (!$allowicons)
   30 {
   31 return false;
   32 }
   33
   34 $membergroups = fetch_membergroupids_array($vbulletin-userinfo);
   35 $infractiongroups = explode(',', str_replace(' ', '', 
 $vbulletin-userinfo['infractiongroupids']));
   36
   37 ($hook = vBulletinHook::fetch_hook('posticons_start')) ? 
 eval($hook) : false;
   38
 
 
 function fetch_membergroupids_array($user, $getprimary = true)
 {
 if (!empty($user['membergroupids']))
 {
 $membergroups = explode(',', str_replace(' ', '', 
 $user['membergroupids']));
 }
 else
 {
 $membergroups = array();
 }
 
 if ($getprimary)
 {
 $membergroups[] = $user['usergroupid'];
 }
 
 return array_unique($membergroups);
 }
 
 I hope you can help, or may i open an bugreport to bugs.php.net ?
 
 Greetings,
 Daniel
 
Hi Daniel,
do you work with a self compiled or width a distributions one?. The
failure is in the function
 zend_str_tolower(function_name_copy.value.str.val,
function_name_copy.value.str.len);

I think, if you have a self compiled or experimental version and you are
sure, that this is a bug, please place it into PHP Bugtracker. If you
are not sure, if this is a bug, becouse you change the source code or
use experimental code, use a distribution.

Greets
Carlos

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



Re: [PHP] Warning: Cannot modify header information - headers alreadysent by - classic

2011-05-20 Thread Carlos Medina

Am 20.05.2011 10:38, schrieb shiplu:

On Fri, May 20, 2011 at 1:45 AM, Marc Guaymarc.g...@gmail.com  wrote:


Hi folks,

I'm running some code locally which should produce this fun error we
all know and love:  Warning: Cannot modify header information -
headers already sent by... but does not.  Switching from 5.3 to 5.2
reveals the error and running it on another server with 5.2 also shows
the error.  I don't believe the version has anything to do with it,
but who knows.  I set error_reporting = E_ALL | E_STRICT and verified
that display_errors = On, still nothing.  Any ideas what could be
allowing a header('Location:'); call to redirect without throwing an
error after output has been sent to the browser?

Marc




Marc, I think you should mimic this in command line using curl. You can
easily understand where the extra byte before headers are coming.



--


Shiplu Mokadd.im
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
Innovation distinguishes between follower and leader


Delete de ? from all php files, if there are not using HTML but only php.

Regards

Carlos

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



[PHP] Re: PHP Error logging

2011-01-18 Thread Carlos Medina

Am 18.01.2011 01:33, schrieb Jimmy Stewpot:

Hello,

I currently have a strange issue where we are seeing 'random errors' being 
displayed to end users. What I find most interesting is that in the php.ini 
file we have the following error settings.

error_reporting  =  E_ALL  ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
track_errors = Off

I thought that if we had dislay_errors = Off then end users should never see 
errors displayed on the web page. However at apparently random times we do 
still see errors being reported, its not consistent at all. To give a better 
idea of the problem we have 8 web servers, they all run an identical copy of 
the site which is stored on a common netapp nfs filer. At apparently random 
times we see that 1 out of 8 servers will reported strange errors like 'use of 
undefined constant' or 'Undefined variable'. What's most strange about these 
errors is that if the code was faulty wouldn't we expect to see the errors on 
all web servers? and secondly wouldn't we expect to see the errors constantly 
rather than at apparently random intervals?

The php.ini files have a modify time of mid 2010 and yet this problem has only 
started in the last few weeks. Has anyone else experienced similar problems in 
the past and if so what was the root cause?

Regards,

Jimmy

Hi,
i think some developer has setting the display_errors with 
ini_set('display_errors', true);

this is why your become the problems now. Maybe this is a idea?

regards

Carlos

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



[PHP] Re: Is there a simple way to enforce a private method in a subclass?

2010-12-21 Thread Carlos Medina

Am 21.12.2010 17:36, schrieb Richard Quadling:

Hi.

If I have an abstract class of Task and I want all subclasses of Task
to have a private method _runTask, is there a way to enforce this?

Currently an abstract private function in an abstract class isn't allowed.

Fatal error: Abstract function Task::_runTask() cannot be declared
private in D:\PHP\Includes\Task.php on line 91

Now I'm pretty sure there are valid reasons for this, but, for me, the
key part here is the abstract modifier.

This should be read first and foremost and simply say that somewhere
in the subclasses, this method must defined. And if it must be defined
as private, then so be it.

Richard.




Hi Richard,
okay you want to use an abstract class (not instantiable) with a private 
abstract method. I think this doesnt make sense. And i think, PHP does 
not allow this because the inheritance constraint will be failed (you 
can use only in the class itself).


Regards

Carlos

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



Re: [PHP] Copying an Object

2010-09-23 Thread Carlos Medina

Am 23.09.2010 08:24, schrieb Peter Lind:

On 23 September 2010 02:14, Daniel Kolbokolb0...@umn.edu  wrote:

*snip*


On 9/22/2010 9:11 AM, chris h wrote:
Say you have two classes: human and male.  Further, say male extends
human.  Let's say you have a human object.  Then later you want to make
that human object a male object.  This seems to be a pretty reasonable
thing to request of our objects.


Perhaps if you're a C# programmer, but the PHP way of thinking is
radically different.
C#: This object is whatever it was currently cast to (if possible)
PHP: This object is this object, whatever it was created as

If you have a need to make an object switch class in PHP, then there's
a 99% chance you're working against, not with the language.


  This type of thing would especially be
easy if objects of parent classes could be cast as an object of its
extended class.


I'll hazard a guess and say you didn't start programming in PHP but in
something else.

Regards
Peter


Hi,
i think the problem here is the casting posibility in PHP is not 
implemented yet. Like Java you can not cast objects to others. I found, 
dass Classes can be casted by using this code:


class ParentClass
{
public static function cast( ParentClass $object )
{
return $object;

}

public function tellMee( $value )
{
echo $value;
}
}

class childClass extends ParentClass
{

}

$parent = ParentClass::cast( new childClass());
$parent-tellMee( 'Hallo ');
var_dump($parent);

Well yes you can get the ChildClass by using the parent class and use 
the methods allowed to use in the parent class (as method of parentClass 
in childClass). But you can not use inheritance in this construct in 
PHP. I think the best way to work with PHP classes is by using the 
Design Patterns for PHP...


Regards

Carlos

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



[PHP] Re: Copying an Object

2010-09-22 Thread Carlos Medina

Am 22.09.2010 13:35, schrieb Daniel Kolbo:

Hello PHPers,

I have:

class A {
...code
}

class B extends A {
...code
}

$a = new A();

$b = new B();

I would like to get all of the properties of $a into $b by value.  Class
A extends 3 other classes.  I would like a way to not have to manage a
'copy' method in B if A or one of the subclasses of A change.

I was reading about clone, but this doesn't really seem to help me in
this situation.

How can I copy $a into $b?

Thanks,
dK
`


Hi dk,
 by using inheritance only you will bind your code to an specific 
implementation of code. Wherever you want to do with your classes, i 
think is the better way to use some design patterns to build classes by 
the functionality or by structure.
The use of composition allow to manage your classes flexible very well. 
But look for Factory or Decorator (maybe Command in this case) to solve 
the class inheritance.


Regards

Carlos Medina

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



Re: [PHP] ZipArchive, but without files

2010-09-22 Thread Carlos Medina

Am 22.09.2010 17:32, schrieb Jonathan Mills:

On 22/09/2010 12:11, Viacheslav Chumushuk wrote:

Hello.
As I understand you in a right way you need next function 
http://ua.php.net/manual/en/function.gzcompress.php


Thanks for the suggestion Viacheslav , but I'd trying to
the create the complete zipfile structure,  gzcompress() just
compresses the file's data (and in a slightly different manner
to what ZIP does - the first and last 4 bytes are different to
what zip produces) and, probably more importantly, doesn't
add the file name headers on either end

But the principle - ie something that returns a string -
is what I'm looking for.

Kind Regards
Jonathan


Hi Jonathan,
and what if you serialize your String? You can save Objects in it...

Regards

Carlos

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



[PHP] Re: Auto-generating HTML

2010-09-20 Thread Carlos Medina

Am 20.09.2010 20:56, schrieb Andy McKenzie:

Hey folks,

   I have the feeling this is a stupid question, but I can't even find
anything about it.  Maybe I'm just not searching for the right things.

   Here's the problem.  I'm writing a lot of pages, and I hate going in
and out of PHP.  At the same time, I want my HTML to be legible.  When
you look at it, that's kind of a problem, though... for instance
(assume this had some PHP in the middle, and there was actually a
reason not to just put this in HTML in the first place):

Simple PHP:
?php

echo 'html';
echo 'head';
echo 'titlePage Title/title';
echo '/head';
echo 'body';
echo 'pThis is the page body/p';
echo '/body';
echo '/html';

?


Output page source:
htmlhead   titlePage Title/title/headbodypThis is the
page body/p/body/html


Now, I can go through and add a newline to the end of each line (echo
'html' . \n; and so on), but it adds a lot of typing.  Is there a
way to make this happen automatically?  I thought about just building
a simple function, but I run into problem with quotes -- either I
can't use single quotes, or I can't use double quotes.  Historically,
I've dealt with the issue by just having ugly output code, but I'd
like to stop doing that.  How do other people deal with this?

Thanks,
   Alex

Hi Alex,
yes you can build a lot of classes to build the html you want and 
produce elegant and clean code. But, the job to do that is enorm, and 
sincerly i dont know what is better.


You can use some templating system like Zend Framwork and if not 
possible consider to use str_replace() to parse your Template and 
replace the variables in there. You can use a token like ###VAR_NAME### 
to address a variable like $var_name or something like this.


Regards

Carlos

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



[PHP] The session problems with a citrix terminal

2010-09-16 Thread Carlos Medina

Hi all,
i am looking for a solution (approaching) for the following problem:

My Application (PHP 5+, MySQL, Zend Framework) works fine. But unter the 
citrix terminal server allow to all user to see the informations 
(session data) of the last user. I think this is because all user of the 
terminal (thin clients) are connected with the terminal and use the same 
browser at all.


Please if you know a solution for this issue, i will be glad to read it :-)

Regards

Carlos

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



[PHP] Re: PHP / mySQL Project...

2010-02-22 Thread Carlos Medina

Hi Don,
i work for the company simplynetworks in germany. I have access to may 
programmers with the best quality to the best prices. We work quick and 
no dirty ;-)
I am programmer too and my company offer you the best object oriented 
software of the market. Some references of my clients in Germany:


DMC (Digital media center) - Neckermann (www.neckerman.de /nl/be) Shop 
development - 150 developer and many smoll teams. Development with PHP 4 
and 5, JQuery, Prototype, CSS, XML, HTML, MYSQL and Oracle and so on.
Astroshop.de (www.astroshop.de) Shop redesign and refactory. JQuery, 
PHP5 strong object oriented, SPL, MySQL, Zend Framework and EzComponents 
integration.
ssc - services - Daimler Chrysler (SWAN Projekt for OFTP data transfer). 
PHP5 and Java, MySQL, HTML, CSS, Javascript,etc
Speechconcept (linguistics) - Strong object oriented Software with DOJO, 
Zend Framework and many modules and very complex tasks.


If you are interessing contact please to this email address.

Regards

Carlos Medina
Don Wieland schrieb:

Hello,

I am needing assistance IMMEDIATELY in finishing up a project (the 
developer went in to have shoulder surgery and will be out of commission 
for 3 weeks) and I need this finished soon.


Candidate must have good english skills, a solid knowledge of HTML, CSS, 
PHP, mySQL, Javascript, AJAX, and JQuery. Developer may work remotely.


Please contact me via email, PRIVATELY, with your skills and sample of 
online project you have done. Also, this will be an hourly job - so what 
Hourly Rate you expect to get paid would be nice.


Thanks!

Don Wieland
D W   D a t a   C o n c e p t s
~
d...@dwdataconcepts.com
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our 
Developer Support Plan at:

http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 
or higher

http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html



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



Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread Carlos Medina

TerryA schrieb:

Hi Shawn
Thanks for answering my query. I have looked at the suggestions:

$xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA);

I am/was able to load the file OK and to access the data by iteration.
However, I can't find a way to extract data by attributes. I need something
like $string=element idtype=11 lang=fr label=Description - Etage.
Obviously, that won't work but that's the result I need. How do I get the
data out of one of these elements by specifying its idtype and lang? I've
google for hours on this and for another hour on SimpleXMLElement.

Terry

Hi Terry,
look at the PHP.NET documentation. There indicates the use of 
simpleXMLElement structures. If you want to extract elements from this 
object, please read there how this work. By the way, it would be 
interesting to see, how your XML is made. May be is usefull to use 
another class like DOM.


regards

carlos


http://de2.php.net/manual/fr/book.simplexml.php
http://de2.php.net/manual/fr/refs.xml.php

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



[PHP] Re: Happy New Year

2009-12-31 Thread Carlos Medina

tedd schrieb:

Hi gang:

Happy New Year!

May 2010  2009.

Cheers,

tedd


Happy new Year,
i wish you exited works, exited drinks, exited chicks and course exited 
code :-D


Carlos

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



[PHP] Re: uninstalling wamp

2009-12-26 Thread Carlos Medina

Sudhakar schrieb:

hi

after installing wamp when i accessed phpmyadmin i got an error about root
having no password, i have tried various steps but could not get to use
phpmyadmin, so i uninstalled and reinstalled wamp, i deleted the old wamp
folder when i access phpmyadmin i get the same error message


i read that there are some files of wamp that need to be deleted from the
registery of windows, i am not very sure about regsitry as it is a bit risky
thing

can anyone advice how i can remove any unwanted wamp files and install wamp
so that i can access phpmyadmin page


thanks


Hi,
yes you can read first the Uninstall How To from Apachefriens

http://www.apachefriends.org/en/xampp-windows.html

Regards

Carlos

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



[PHP] Re: PHP Equivalent to Java Jar or Python Eggs

2009-11-30 Thread Carlos Medina

c4...@comcast.net schrieb:
Has anyone done any work towards packaging of PHP in a manner similar to jar or eggs? I was working on a project the other day with a lot of class files and thought this would be a cool, simple way to deploy the app. 





Hi,
you can check the Phar solution from PHP

Regards

Carlos

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



[PHP] Re: Preview button to show PDF without submitting post data?

2009-11-08 Thread Carlos Medina

Dave M G schrieb:

PHP Users,

I have a page that generates a PDF document using PHP. It takes form
data filled in by the user to fill out the PDF

When the user clicks submit, it emails that PDF document to the
intended recipient.

However, I would like to add a preview function as well. But for a
variety of reasons, instead of submitting the form data through post and
re-filling all the fields with the selected data, I'd like to be able to
open a new window with an example PDF without actually submitting the form.

I think this might need JavaScript, but I'm not sure.

Is this possible?

Thank you for any advice.


Hallo Dave,
to get the PDF you use a create PDF Engine writing on PHP right?. The 
Only Way to generate the PDF is, to get the Information from user (with 
the POST or GET method) using the PDF Engine writing on PHP right?
I think you can generate the PDF and show it like a preview Page, but 
the User must be able to regenerate the PDF to send it as email (where 
the same Data will be used or not, please think about, if you want to do 
this) I think, you must to think more about the usability at this point


Regards

Carlos

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



[PHP] Re: How APC Work?

2009-10-30 Thread Carlos Medina

Erick Couto schrieb:

Hi,

How *APC* – Alternative *PHP* Cache store data on cache? memory? file
system?
i´m developing a PHP application with many requests for read/write on APC
stored variables,
im scared with future slow down with many IO on APC.

Thanks,

Erick Couto


No Documentation for APC?


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



Re: [PHP] How do YOU set default function/method params?

2009-10-17 Thread Carlos Medina

Jim Lucas schrieb:

Stephan Ebelt wrote:

On Mon, Oct 05, 2009 at 05:48:32PM -0700, Jim Lucas wrote:

Here is a problem that I have had for years now.  I have been trying to come up
with the perfect solution for this problem.  But, I have come down to two
different methods for solving it.

Here is the problem...

[...]


Now, we all have a function or method like this floating around somewhere.

My question is, how do YOU go about setting the required entries of the $headers
array() ?


[...]


END of examples...

Now, IMO, the last one is the simplest one and for me, I think it will be the
new way that I solve this type of problem.

But, my question that I put out to all of you is...

How would you solve this problem?

I have use this array_merge() approach mentioned in other posts for
quite some time but found that it introduced many bugs when fieldnames changed.
Ie. if the defaults come from a database table and I changed the schema it
caused undefined values during the merging and - worse - sometimes messed up the
inner workings of functions...

Then I heard of the value object approach somewhere and found that much more
solid. One would basically define a class where default values are represented
by its properties. Ie:

class vo_email extends vo {
public $to = '';
public $from = '';
public $subject = '(no subject)';
public $body = '';
...
}

the constructor can make sure that absolutly necessary values are required and
set properly - and could complain if something is not right. There could be
methods that add() or set() or change() things. These could also be inherited
from a very generic class vo so that this stuff is written once and applies
to all sorts of defaults in the program.
In my app the inherited constructor accepts arrays as parameter and assigns
their elements to the object properties and - by that - overwrites the default
settings. If elements do not match with the defined properties it will trigger
a very visible call trace.

A function like sendEmail() would then require a object of type vo_email as
parameter and would work with its properties internally and can rely on it as
the vo's constructor should have catched anything bad.

If additional logic for the input values is required, it can be added easily:

class dao_email extends vo_email {
...
public function encode_body() {
...
}

public function sanitize_mail_address() {

}
...
}



This is a very interesting approach.  How would you initialize the class?  Using
a Singleton Method, or a Globally available class variable?



sendEmail() would then require a dao_email object (dao=data access object) as
input.

stephan


TIA

Jim Lucas

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



Hi,
i would use here two Classes to do this. A Class like Configuration
where the Mail Configuration is implemented. Configuration class load
the Configuration. There you can use Arrays like

$mailConf = array( 'to' = array('type' = 'string', 'required' = true ) );

( You can use the parse_ini_file() method to load the Configuration from
a ini file too )

The Configuration Class can be accessed with get and set methods (your
own or magic)

$conf = $conf-getMailConfiguration(); (return the Array )

And you can use the set method like this:
$conf-setMailConfiguration( Array( values ... ) )

Here you can send a exception if the needed or required items are not set

And set it this into the mail class with

$mail-setConfiguration( mailConfiguration $mailConf )

At this point you can get the values from Object $mailConf

may be helps

Regards

Carlos

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



[PHP] Re: Making several variables into 1 variable

2009-07-28 Thread Carlos Medina

Miller, Terion schrieb:

I need to take this:

   $pastDays = strtotime(-30 days);



$past_day = date(d, $pastDays);

$past_month = date(m, $pastDays);

$past_year =date(y, $pastDays);


And make it into one var to compare to a db field that is formatted like
00/00/00 



$result = date(d/m/y, $pastDays);



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



[PHP] Re: php.net down?

2009-07-16 Thread Carlos Medina

Thijs Lensselink schrieb:

Anybody noticed php.net is down?

It's responding to pings. But no pages load.


no

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



[PHP] Re: I have an idea

2009-07-15 Thread Carlos Medina

Martin Scotta schrieb:

Hi

Do you noted that all the discussion here are about problems, bugs, or
just urgent pleaaase help me
I have an idea. It is not really THE idea... but it is.
What happen if tell this idea to the community? I don't know, so,
let's take a look.


PHP is a great language. You can do a lot of things with him, even
have fun with it.
My idea is to make a simple game where your have to write some AI to
beat the other players AI

The idea, as simple as it looks, is really difficult to implement
specially about security

so, do you like me idea?


Hi Martin,
i think is a good idea. How do you think to implement this?

Carlos Medina

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



Re: [PHP] Re: I have an idea

2009-07-15 Thread Carlos Medina

Michael A. Peters schrieb:

Carlos Medina wrote:

Martin Scotta schrieb:

Hi

Do you noted that all the discussion here are about problems, bugs, or
just urgent pleaaase help me
I have an idea. It is not really THE idea... but it is.
What happen if tell this idea to the community? I don't know, so,
let's take a look.


PHP is a great language. You can do a lot of things with him, even
have fun with it.
My idea is to make a simple game where your have to write some AI to
beat the other players AI

The idea, as simple as it looks, is really difficult to implement
specially about security

so, do you like me idea?


Hi Martin,
i think is a good idea. How do you think to implement this?



The LISP list is two doors down across the hall.

:-D but... why lisp? and why not PHP? explain please.

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



Re: [PHP] Need Help.

2009-07-14 Thread Carlos Medina

Hi Girish,
You can save the SEssion id in a Cookie to make it available over 
requests and over days too. If you use Sessions stored on DB, you can 
get more security, when the SEssion Cookie is stored Encrypted. Other 
Option is to send the Session id, most know as PHPSESSIONID, as GET 
Variable.


REgards

Carlos

Ashley Sheridan schrieb:

On Tue, 2009-07-14 at 11:59 +0530, Girish Padia wrote:

Dear Sir,

I am facing two problem while developing my site in php.
1) I want to delete browser history whenever i migrate from one page to
another. so that user can never press Back button.
2) I have 20 users who have access to my site. Right now I am checking this
using cookies. I want to know which is better to track user login : Cookies
or Session ?

Please do reply.

With regards,

Girish


You can't delete the users browser history, but what you can do is use
an entirely AJAX based website, so that there is no back/forward option.
However, this may be a little complex for you unless you have at least a
fair understanding of HTML Dom, and Javascript.

To understand which is betterm you need to understand how they work.
Cookies are persistent text files left on the users computer. They are
limited in the amount of data you can store in them, but they can store
information across physical browsing sessions. For example, you could
use them to remember a users preferred layout for your site, etc.

Sessions variables are all stored on your server, and generally last
only for the time that a visitor is on your site. They are referenced
automatically by PHP through a session ID, which is usually stored in a
cookie, but you can force it to be sent only in the URL if you wish.

The advantage that sessions have over cookies is the ability to store
more data, and as it is server-side, you can store things without
worrying too much about that data being accessed by someone other than
your user. Cookies have the advantage of persistence over time
(depending on how long you prefer to store them). You should not that
some users see cookies as invasive, and may have them turned off in the
browser. I'd say if you can do something server or client-side, you're
better off doing it where you have the greatest control, a la
server-side.

Thanks
Ash
www.ashleysheridan.co.uk



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



[PHP] PHP SOAP Using SAML

2009-06-22 Thread Carlos Medina

Hi Anybody,
I am evaluating to use Webservices to solve an knowed Issue. I need to 
know, if it is Possible to use SAML 1.0 with PHP 4 or PHP 5 and when 
yes, where can i get information about this Issue or open Source 
Software,etc.




Regards

Carlos

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



Re: [PHP] 500 Internal Error

2009-06-19 Thread Carlos Medina

Hi,
can you get a test echo with: echo test;exit when you call your
dbscript.php?
If not so. Your Problem is a install problem and need more info about
where, what and permissions (Permissions are allways a problem for this
strange cases)

If you get a test then you problem can be the MySQL Functions you are
doing. Here we need more Information/examples what you are doing.

Regards

Carlos

Thodoris schrieb:



Greetings Gurus!


I am attempting to use PHP+MYSQL+APACHE and I have downloaded all the 
latest verions and installed them on a fresh windows XP install.  Got 
the Apache server up and running, got MySQL up and running and 
installed PHP.  Tested PHP with a script containing phpinfo().  
Everything works great.


Wrote a small script to connect to the MySql database.  Tried to run 
the script (http://localhost/dbscript.php) and I get a 500 Internal 
Server error.  I have been up and down the web for two days looking 
for a solution and I am completely frustrated.  I HAVE to be missing 
something.  PLEASE PLEASE PLEASE help.  Thanks.


MySql is enabled in php.ini.  Paths are set to the php folder.  I have 
NOT moved or copied any files whatsoever.  Apache version is 2.2.


Thanks.



Since you are a windows user and you need to begin coding in PHP etc why 
don't you try WAMP for starters?


http://www.wampserver.com/en/

It gives you all you need in one package.




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



[PHP] Re: thread question

2009-03-31 Thread Carlos Medina

Toke Herkild schrieb:

Hi all,

Another question:

If a script starts to perform an operation and the user browses away 
will that terminate the thread perfoming the operation eg. the operation 
is aborted ?


Mvh
Toke

Hi Toke,
i think  that the Operations in the Server will not aborted because the 
Browser was closed. The Browser wait for Response and set a timeout 
Message when the Time is over.


Best Regards

Carlos Medina

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



Re: [PHP] PHP OOP

2009-02-10 Thread Carlos Medina

Marcus Gnaß schrieb:

Paul M Foster wrote:

On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
  As a side note, I think students should learn a language like C before
learning something like Perl, Python or PHP. Having to deal with
defining/declaring variables and their storage methods before use I
think makes for more conscientious programmers. And pointers are an
education all on their own. ;-}
  
For teaching programming or OOP I would choose a language which 
concentrates on the topic. The hard stuff, which you have to deal with 
in C for example, can be learned later. I'm glad that I started 
programming in Pascal, not in C. If today I had to learn programming as 
such I would definitively opt for Python! My choice for learning OOP 
would be Python or even better Java cause you don't have the choice to 
do it in a procedural way.


Marcus

Hi @ all,
but this is a php list...

Regards

Carlos

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



Re: [PHP] Re: move_uploaded_file() problem

2009-02-07 Thread Carlos Medina

Chris schrieb:



if($_FILES['file']['name']  $_FILES['file']['size']55){
   
$file_name = news_.$_FILES['file']['name'];
$image=../_img/news/.$file_name;   
//Upload file

move_uploaded_file($_FILES['file']['tmp_name'], $image);


error_reporting(E_ALL);
ini_set('display_errors', true);

what does it show?

does it get this far in the code? Add an error_log or echo line is  . 
__LINE__ or something so you know for certain this is the problem.



Hallo,
please show in the php.net site the Method is

bool move_uploaded_file  ( string $filename  , string $destination  )

String filename and destination are not right...

Carlos Medina

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



Re: [PHP] Read a XML (not a file)

2009-02-06 Thread Carlos Medina

Phpster schrieb:



On Feb 6, 2009, at 9:12, Jônatas Zechim zechim@gmail.com wrote:


Hi there, i want do read a XML like this:

Server.php
?php

 header (content-type: text/xml);

echo ?xml version=\1.0\ encoding=\iso-5718\ ? images  image
 ID1/ID
  albumtestealbum
  path/images/teste.jpg/path
/image
/images;
?

How can do this?

zechim


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



Remove the php tags and code, and just save the file as XML. Then you 
can have another file read in and or echo the HTML



Bastien

Hi,
call the site to generate the XML data with simplexml function

$xml = simplexml_load_string( fopen(http://www.example.com/;, r) );

But if we want to be serious: Use classes to do this is better.

Regards

Carlos


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



[PHP] Re: Mutiple SQL request

2009-02-04 Thread Carlos Medina

Jônatas Zechim schrieb:

Hi there, i've a system that do a query each 3s, does it impact on mysql Server?
I mean, can this slow my Server?

zechim


No. and yes. I think if you are doing a Join Query over 32 Tables 
without indexes then it will be very slow


Carlos

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



[PHP] Re: PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread Carlos Medina

Nitsan Bin-Nun schrieb:

I was just wondering whether people enclosing their PHP tags declarations,
I don't close these ?php tags just because the interpreter doesn't really
needs them,
and for the second reason - if a space/tab/new line/etc will beneath them it
will cause
problems with output buffering and session handling.

Do you close your PHP ?php tags?

(at least I closed them here :P look down)

No,
is not needed

Regards

Carlos

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



Re: [PHP] New PHP User with a simple question OT

2009-01-26 Thread Carlos Medina

tedd schrieb:

At 11:56 AM +0100 1/25/09, Carlos Medina wrote:

Hi Ashley,
yes this is the right answer. The Problem is not a PHP Question but 
a programming question. To be clear: i think, the Problem can you 
solve, if you get two or tree books or tutorials about the programming 
language. You should *try* to solve the problem self and then to post 
a question in a list or forum. I think this is the normal way.


To the code i think this is very bad php code. You will get more XXS 
and other exploits with this code. Please tell me what is your site 
and i show you



Regards

Carlos Medina


Carlos:

Whoa dude -- this list IS for people to ask questions and from what the 
OP asked it WAS a php question.


I totally agree with Ashley and your response is not common for this list.

As to the OP's code being bad or whatever, he is asking for help. If 
you want to show him where his code is bad, then be my guest -- but to 
tell him to go buy a book and come back to this list after he has reads 
it is not something you can dictate -- you have no control over this list.


I suggest -- if you want to help, then do so. If not, then you go read a 
book.


Cheers,

tedd



Tedd:
Ok boss. Thank you. I will do.

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



Re: [PHP] New PHP User with a simple question

2009-01-25 Thread Carlos Medina
 be fairly simple but being completely new to php I 
just cannot seem to get it right.


Any help would be greatly appreciate.

Thank you in advance.
  


I think this is the best way to open hackers a door to your system. Read 
more about PHP please.


Regards

Carlos Medina

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



Re: [PHP] New PHP User with a simple question

2009-01-25 Thread Carlos Medina

Christopher W schrieb:

Mr. Kubler,

Thank you for the help.  I have to admit, I am still in over my head, I 
think.  Perhaps I should just stick to static pages...


Anyway what I was attempting to do, in the full picture, was be able to just 
switch the text in the text area without actually changing pages.  For 
example, if the user clicks About Us (from the home page)the page doesn't 
change, just the text (in the area I designated for text).


Since I have never used php before (but have read some online and in books)
what I was trying was:

if ($page == home) {echo $home_text;}
elseif ($page == about) {echo $about_text;}
...
else {echo $error_text;}

My problem is that I can't figure out how to get the link-click to assign 
the value to the variable.  I didn't try any php for that end because I 
really didn't know where to begin.  Perhaps I am just going about this the 
wrong way but from the extremely little I have learned about php, I thought 
that I could do it this way easily.


Thanks for the replies and the help.  I truly appreciate it.



Hi Christopher,
please buy a PHP Book. Read it and if you have any questions come back.

Regards

Carlos Medina

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



Re: [PHP] New PHP User with a simple question OT

2009-01-25 Thread Carlos Medina

Hi Ashley,
yes this is the right answer. The Problem is not a PHP Question but a 
programming question. To be clear: i think, the Problem can you solve, 
if you get two or tree books or tutorials about the programming 
language. You should *try* to solve the problem self and then to post a 
question in a list or forum. I think this is the normal way.


To the code i think this is very bad php code. You will get more XXS and 
other exploits with this code. Please tell me what is your site and i 
show you



Regards

Carlos Medina

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



[PHP] Re: Php error

2009-01-24 Thread Carlos Medina

mattias schrieb:

ERR_DB_NO_DB_PASS
What will this meen?



The Database is a foreign DB without passport

Carlos

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



[PHP] Re: importing from XML-files

2009-01-22 Thread Carlos Medina

Merlin Morgenstern schrieb:

Hi everybody,

I am creating an import script which is getting data out of an xml file.
Now I do have a problem with a file where 2 images are included. I need 
to access the second image name, but can not find out how.


I do:
$xml = simplexml_load_file($files[$i]);
$data[pic1_base64] = $xml-anbieter-anhang-anhanginhalt;

This get's me the first image in line. But how could I get the second one?

Thank you for any help,

Merlin

Hi Merlin,
well please tell us how shows the XML DOC?. I can see that the XML read 
a node like anbieter. Is the Anhang an Object or Array? Is this Empty?



viele Gruesse

Carlos Medina

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



[PHP] Re: importing from XML-files

2009-01-22 Thread Carlos Medina

Merlin Morgenstern schrieb:



Carlos Medina wrote:

Merlin Morgenstern schrieb:

Hi everybody,

I am creating an import script which is getting data out of an xml file.
Now I do have a problem with a file where 2 images are included. I 
need to access the second image name, but can not find out how.


I do:
$xml = simplexml_load_file($files[$i]);
$data[pic1_base64] = $xml-anbieter-anhang-anhanginhalt;

This get's me the first image in line. But how could I get the second 
one?


Thank you for any help,

Merlin

Hi Merlin,
well please tell us how shows the XML DOC?. I can see that the XML 
read a node like anbieter. Is the Anhang an Object or Array? Is this 
Empty?



viele Gruesse

Carlos Medina


Hello Carlos,

the xml structure looks like this:

-
anhaenge

anhang location=EXTERN gruppe=TITELBILD
anhangtitelAnsicht_Strassenseite/anhangtitel
formatjpg/format
daten
pfad_1006-kurz_ansicht_strassenseite.jpg/pfad
/daten
/anhang

anhang location=EXTERN gruppe=GRUNDRISS
anhangtitelGrundriss_Modern-kuehl/anhangtitel
formatjpg/format
daten
pfad_1006-lang2_grundriss_modern-kuehl.jpg/pfad
/daten
/anhang

/anhaenge
--

Thank you for your help,

Merlin

Hi Merlin,
what about?

foreach( $xml-anbieter-anhang as $data ){
 echo $data-anhangtitel . 'br';
 }
regards

Carlos Medina

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



[PHP] Re: killing a child process from pcntl_exec

2009-01-22 Thread Carlos Medina

bruce schrieb:

Hi..

I fork a child process, using pcntl_exec. I see the process from the cmdline
(using pgrep 123), but I can't seem to kill the pid from the cmdline, using
kill -9 123..

Is there something that I need to implement within the php test in order for
the kill signal to be effective?

If I wait, the child eventually dies.. but I'd like to be able to kill it
from the cmdline.

thoughts/pointers/comments...

thanks


Hi Bruce,
my ask: it is the pnum really 123? Check it out with ps -aux or ps -aix

Regards

Carlos Medina

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



Re: [PHP] distinguish between null variable and unset variable

2009-01-22 Thread Carlos Medina

Shawn McKenzie schrieb:

Daniel Brown wrote:

On Thu, Jan 22, 2009 at 15:12, Daniel Brown danbr...@php.net wrote:

   Unfortunately, neither solution would work.  isset() will return
FALSE even for an instantiated and explicitly-defined NULL variable.

Forgot to mention that, in addition, is_null() will return TRUE
for both explicitly-set NULL variables and undefined variables alike.



That's why I was testing isset() fist, however as you pointed out, that
is crap also.  :-(



  $testvariable1;
  $testvariable2 = null;
  $testvariable3 = '';

  var_dump($testvariable1);
  var_dump($testvariable2);
  var_dump($testvariable3);

  var_dump( isset( $testvariable1));
  var_dump( isset( $testvariable2));
  var_dump( isset( $testvariable3));

  var_dump( is_null( $testvariable1));
  var_dump( is_null( $testvariable2));
  var_dump( is_null( $testvariable3));

NULL NULL string(0) 
bool(false) bool(false) bool(true)
bool(true) bool(true) bool(false)

Regards

Carlos

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



Re: [PHP] Please explain: index.php/index/index

2009-01-21 Thread Carlos Medina

leledumbo schrieb:

I don't understand it. index.php should be a file and indeed it's a file, so
what does /index/index after it mean? There's no index directory under
directory where index.php resides.

Hi Leledumbo,
what are you talking about? I think you are confused on this:

http://www.domain.com/index

or this

http://www.domain.com/index.php

Yes this is a Front Controller situation (Pattern). Please show the Zend 
Framework or other Frameworks that implements this Pattern (maybe the 
Command Pattern too ).


Regards

Carlos

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



[PHP] Re: Zend Framework...where to start? -- do

2009-01-15 Thread Carlos Medina

Colin Guthrie schrieb:

'Twas brillig, and Daevid Vincent at 14/01/09 21:39 did gyre and gimble:
The pages are significantly slower than straight PHP by orders of 
magnitude: http://paul-m-jones.com/?p=315


Shock News: Frameworks that allow you to write an application in less 
code do stuff in the background for you.


I don't mean to state the very obvious but of course frameworks will be 
slower than a simpler and less flexible/powerful/maintainable solution.


That's like buying an F1 car for your daily commute to work then 
complaining about the MPGs you get!


Frameworks are not about running faster, they are about implementing 
faster and more efficiently, using a standard technique that allows 
other developers to take over from you later with minimal hand over, 
it's about being able to take on new staff without having to train them 
in all your specific code etc.


One of the things these speed tests totally fail to take into 
consideration is that any sensibly written application will have a 
caching structure at it's core and will utilise it *heavily*. When an 
application is written with a good caching policy/infrastructure, the 
performance as a whole goes up by orders of magnitude.


Some performance shootouts don't even employ opcode caches which is just 
insane in any kind of sensible hosting environment.


In short, don't believe the hype and use a little bit of logic and 
common sense to make comparisons as to which approach is better 
(remember better != raw performance) for you.


Col


PS FWIW, I have adopted Zend_Framework and while some of the paradigms 
don't fully suit me I have extended and adapted them to make it work 
very well for me.



Hi Colin,
i agree that.

Carlos Medina

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



[PHP] Re: ArrayObject - Posibillity to add key = value pair per default?

2009-01-14 Thread Carlos Medina

Edmund Hertle schrieb:

Hey,
I've just discovered the ArrayObject class, but it seems to not be well
documented, so here is my problem:

You can use ArrayObject::append() to add a new value to the array, but is
there also a method to add a new key and value?

And I know that I could extend the class and write my own method but isn't
this quite a base method for arrays in php? So maybe I just missed a obvious
point?

Quick example:

Without ArrayObject:
1. $array[] = $value
2. $array[$key] = $value

With ArrayObject:
1. $arrayObject-append($value)
2. ???

-eddy


Hi Eddy,
use offsetSet( key, data) to do this. You can implements the Interface 
or extend from the Class to extend the functionality (think interceptors 
__SET and __GET)


Regards

Carlos Medina

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



Re: [PHP] Re: hello

2009-01-08 Thread Carlos Medina

Allan Arguelles schrieb:

Yeah, I was reluctant to open the attachment, but then again I'm on
gentoo :)

I've forgotten about these threats eversince I switched over, didn't
even notice the bounced email(to the sender) as an indication.


-Allan

Robert Cummings wrote:

On Thu, 2009-01-08 at 17:27 +0800, Allan Arguelles wrote:
  

I only see this in the attachment:

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


That's because the list software strips attachments to prevent idiots
using windows from opening them and unleashing a virus onto their
system.

In fact, since the only text in the message other than the stripped
attachment is Please read the document. I am led to strongly suspect
that it was a virus. Additionally, the addition of a supposed anti-virus
check is usually added to such virus attachment emails to help the
unwashed fool think it's not a virus *lol*.

Cheers,
Rob.

  

bigredli...@yahoo.com wrote:


Please read the document.

 Attachment: No Virus found
 F-Secure AntiVirus - www.f-secure.com


  
  

I known viruses for Linux/Unix Systems too...

Carlos

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



[PHP] Re: redoing website after 7 years

2009-01-07 Thread Carlos Medina

Lamp Lists schrieb:

hi guys,
I did php/mysql based website for one my client 7 years ago, in time when 
register_globals was on by default.
hosting company upgraded server to php5/mysql5 and turned globals off. the site 
is doesn't work any more.
I can define globals on again in .htaccess but rather not because it could be a 
big risk.
to work again I have to spend a lot of hours to modify the code. boring job. but, I'm 
more concern does client has to pay the changes/upgrade or it's still my 
obligation?
anybody had similar experience?

thanks for any help.

ll




  

Hi,
i think this is a contract Problem. I think this ist not your 
obligation, because you have doing this Work for seven Years. The 
decision to change/Upgrade the Product was from the hosting Company and 
the client shiould be prepared to change the software, if Changes are 
known and new Versions will be set. If the Client offers you a Job to 
change the Software is a new Job and must pay. PLease contact a 	lawyer 
to get more Information about the legal practice on your Country.


Salut

Carlos Medina

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



[PHP] Re: Webhotel structure

2008-12-30 Thread Carlos Medina

Peter Sorensen schrieb:

Hi Carlos Thanks for trying to help.

As a newbie on web design I was looking for help on about everythink, as 
a newbie you don't know which questions to ask.


With help from other sources I found out how to wipe my webhotel and 
start over.

After a fresh install of coppermin I still had problems adding pictures.

I finally solved that problem which turned out to be an error in 
Surftowns build in filemanager chmod command. In recursive mode it only 
changed permissions on files not on folders. So the coppermine users did 
not have the needed file permissions.

I used FileZilla to correct the permissions.

I anyone want to know more abot this see coppermine forum search for 
batch-add


best regards

Peter Sørensen


Carlos Medina i...@simply-networks.de wrote in message 
news:c5.73.47432.da8b6...@pb1.pair.com...

Nordstjernealle 10 schrieb:

Hi PHP experts

What is the overall structure on webhotels, how do I remove/clean 
everythink including everythinnk liek databases etc?


Sorry if this is not the proper news group for this question, please 
redirect me.

I am a newbie trying to make my osn webside with a minimum effort.

First I had a student to make some think for me, but he never 
finished it, so the useless remains are on my web.


My first plan was to use php gallery, but my web host surftown do not 
support safemode off.

So I found coppermine, surftown even support the install as one click.
First trial looked good, but then I ran into trouble, I get different 
error messages.


So I would prefer to remove everythink and start all over .



best regards

Peter Sørensen




Hallo Peter,
i think i understand what you mean (again: i think) but i am not 
really sure to understand what you need.

You need some Support on PHP? and when yes, by what?
When you dont need support for PHP please tell us, what you are 
looking for? Do you need Suport for coppermine? then look here 
http://documentation.coppermine-gallery.net/en/languages.htm
You want remove all the Application on your server and you dont know 
how? What is your System, where ist Your Server System?
Do you need some Support from PHP programmer? Please contact me then 
:-) (reply only to me then)



Regards

Carlos Medina





Hi Peter,
well done, as a news you are learning, that the best way to find out is 
to search, look at and try. I can give you only this advice: try, 
Search, Try again and again, and when you can not find the solution, ask 
more detailed.


Regards

Carlos

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



[PHP] Re: Architecture patterns in PHP

2008-12-28 Thread Carlos Medina

Manuel Lemos schrieb:

Hello,

on 12/27/2008 09:40 PM Michael C. Yates said the following:

How do you structure your web applications? I am thinking in terms of
separating presentation  and logic. How is that done in PHP? And how
many architecture patterns are there?


I use the Use Case Mapping as methodology to implement Web applications
in PHP since 1999 .

It does not mean that this is necessarily the best Web development
methodology, nor that you could not use another methodology that you may
prefer.

It is a methodology that I have been using for developing PHP Web
applications with very satisfactory productivity results. I have been
using it since 1999, when Object Oriented Programming support was added
to PHP 3. Over time, it has been refined to address better the real
world needs of sites of growing complexity.

This methodology has been used extensively to develop busy sites like
the PHPClasses repository. Therefore, it has proven to be suitable to
develop enterprise grade Web applications. It does not impose
excessively complex development procedures. So, it is also suitable for
developing small Web applications.

You may want to read this document that explains what are use cases in
the scope of a well structured project and the methodology that
describes how map use cases to PHP code for Web applications.

http://www.meta-language.net/metastorage-example.html




Hi all,
I can not understand what is the Target of this question like 
Architecture Patterns in PHP. This is for me like the question, what 
is your favorite IDE. If i need to know about design Patterns in PHP, 
then i can buy a book about it or i search the Internet for my information.


Regards

Carlos

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



[PHP] Re: Webhotel structure

2008-12-27 Thread Carlos Medina

Nordstjernealle 10 schrieb:

Hi PHP experts

What is the overall structure on webhotels, how do I remove/clean everythink 
including everythinnk liek databases etc?

Sorry if this is not the proper news group for this question, please redirect 
me.
I am a newbie trying to make my osn webside with a minimum effort.

First I had a student to make some think for me, but he never finished it, so 
the useless remains are on my web.

My first plan was to use php gallery, but my web host surftown do not support 
safemode off.
So I found coppermine, surftown even support the install as one click.
First trial looked good, but then I ran into trouble, I get different error 
messages.

So I would prefer to remove everythink and start all over .



best regards

Peter Sørensen




Hallo Peter,
i think i understand what you mean (again: i think) but i am not really 
sure to understand what you need.

You need some Support on PHP? and when yes, by what?
When you dont need support for PHP please tell us, what you are looking 
for? Do you need Suport for coppermine? then look here 
http://documentation.coppermine-gallery.net/en/languages.htm
You want remove all the Application on your server and you dont know 
how? What is your System, where ist Your Server System?
Do you need some Support from PHP programmer? Please contact me then :-) 
(reply only to me then)



Regards

Carlos Medina



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



[PHP] Re: PHP Form email w/attachment

2008-12-18 Thread Carlos Medina

jeffery harris schrieb:
I need to create a php form and mail it to a recipient (that I can do). My 
question is how do I create an area for a file (.doc, or .pdf) to be 
attached emailed along with other form data as well?


-Jeff 




Hi Jeffery,
you need to upload the File with the Form inputfield
form action=input_file.htm method=post enctype=multipart/form-data
input name=Datei type=file size=50 maxlength=10 
accept=text/*
When the upload is ready, use is_uploaded_file() function to check and 
others to validate the File (important) then move the file with move_ 
uploaded_ file() to the Directory where you want or attach to the mail 
you want.


Kind Regards

Carlos Medina

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



Re: [PHP] Re: apache and PHP / Eclipse

2008-12-15 Thread Carlos Medina

TEric Butera schrieb:

On Sun, Dec 14, 2008 at 10:33 AM, Nathan Rixham nrix...@gmail.com wrote:

Eduardo Vizcarra wrote:

I am having a hard time trying to get some pages work. I have PHP 5.2.8,
Apache 2.2 and MySQL 5.1 running in a Windows Vista home edition. All
packages were installed, and configured, the strange thing is that pages
commonly work but when I add a new line (e.g. an echo line) with a dummy
text, Apache crashes and it is restarted

I am using Eclipese europa to create the code

e.g. I have this code and the page works:
include 'upper_pagina.php';
include 'forma.php';
 $link = mysql_connect(127.0.0.1,root,root);
 if (!$link)
 {
 echo table width='100%' border='0' cellspacing='0' cellpadding='5'
bordercolor='FF'\n;
 echo tr\n;
 echo td bgcolor='FF9327'\n;
 echo bLa Base de datos no esta disponible en este momento.BR;
 echo Disculpe las molestias, intente mas tarde/b;
 echo /td\n;
 echo /tr\n;
 echo /table\n;
 }
 mysql_select_db(estoydevacacionesdb) or die(No pudo seleccionarse la
BD.);
 $busquedasql1 = select * from servicios;
include 'bottom_pagina.php';

but if I add a new line   ($servicios1 = mysql_query($busquedasql1);)
before the last include line, apache crashes, it has been very hard for me
to identify what it is causing this problem

any clue ?

Regards
Eduardo

also.. you may find it worth while to upgrade to the PDT 2.0 version of
eclipse which uses ganymede and comes with the zend debugger, allowing you
to test and debug you're code in eclipse.

http://www.zend.com/en/community/pdt

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




I was playing with that last week at work.  It's quite buggy.


Try to use Xampp apachefriends.org

Regards

Carlos

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



[PHP] Re: restrict fsockopen spam etc.

2008-12-10 Thread Carlos Medina

Andre Hübner schrieb:

Hello List,

in last times i recognize that some scripts/formmailer of customers get abused 
by spammers.
Some scripts avoid to use smtp-server and do smtp-dialog by its own using 
fsockopen etc.
Problem ist that if mails are sent by fsockopen directy to other servers they 
not occur in server-maillog.
Only way to find them is viewing accesslog, bit it is really hard to make 
relations between entries in accesslog
and spamreports from other servers.
My question is if there is a way to restrict fsockopen to use not port 25 or a 
kind of logging which makes entries if fsockopen is used.
This gets more and more to a problem for us but we do not want to disable 
fsockopen completely at the moment.
Is there a way to realize this?

Thanks,
Andre

Hallo Andre,
i dont know why you use sockets to send a mail but it is save to solve 
your problems with a algorithm and architecture. I think you can use a 
capcha to get the control again over your script.


Regards

Carlos

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



[PHP] Re: foreach and destroying variables for memory saving

2008-12-10 Thread Carlos Medina

Tim | iHostNZ schrieb:

Hi All,

Just to annoy the hell out of you, another thing that has been on my mind
for a while:

I love the foreach ($ar as $k = $v) { ... } construct and use it all the
time. However, I read somewhere that foreach actually uses a copy of $ar
instead of the array itself by reference. Wouldn't it be much more
usefull/efficient, if foreach would use the array by reference? Then one
could change arrays while iterating over them (without having to use the old
fashioned for ($i=0; $icount($ar); $i++), also this doesnt work for
associative arrays). I know you can do it with while and list somehow, but i
personally find that language construct rather ugly and can never remember
it. Is there another way that any of you use? Please enlighten me.
I just use foreach because its easy, but it might not be the best. However,
it seems to perform good enough for what i've done so far.

Somewhere i also read that one can save a lot of memory by destroying
variables. Is that done with unset, setting it to null or something similar?
So, i take there is no garbage collection in php? I've never actually looked
at the c source code of php. Maybe its time to actually do that. But it
might be easier if someone can answer this from the top of their head.

Thanks for your patience.


Hi Tim,
i can remember me to hear/read that the variables on PHP will be destroy 
 automatically?.


Regards

Carlos

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



[PHP] Re: Need help on MySQL query

2008-12-10 Thread Carlos Medina

Rahat Bashir schrieb:

Hi Experts,

EID Mubarak to all.

I need your help on writing a MySQL query.

Scenario:

CREATE TABLE transaction
(
`id` int NOT NULL ATUTO INCREMENT,
`date` datetime  NOT NULL,
`withdrawn` double (12,2) NULL,
`deposit` double (12,2) NULL
);

SELECT * FROM transaction;

id  date
withdrawn  deposit
--
--- --
1   2008-12-01 00:00:00
NULL1.00
2   2008-12-02 00:00:00 4000.00
NULL
3   2008-12-04 00:00:00 2000.00
NULL
4   2008-12-05 00:00:00
NULL4500.00
5   2008-12-06 00:00:00 500.00
 1500.00

The above is all I have. I want to make query which should output an extra
calculated column named balance, something like following:

Expected output from query:
id  date
withdrawn  depositbalance
--
--- -- -
1   2008-12-01 00:00:00
NULL1.00 1.00
2   2008-12-02 00:00:00 4000.00
NULL  6000.00
3   2008-12-04 00:00:00 2000.00
NULL  4000.00
4   2008-12-05 00:00:00
NULL4500.00   8500.00
5   2008-12-06 00:00:00 500.00
 1500.00   9500.00

Thanks in advance



Hi Rahat,
you can see more information about MySQL on www.mysql.com and show how 
to build/make Queries well.


Regards

Carlos Medina

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



[PHP] Re: How to Insert ?xml-stylesheet .....? into DOMDocument

2008-12-06 Thread Carlos Medina

Shanon Swafford schrieb:

I have the following code:

#!/usr/bin/php -q
?PHP
error_reporting(E_ALL);
ini_set('display_errors', '1');
$doc = new DOMDocument();
$doc-formatOutput = true;

$foo = $doc-createElement(foo);
$doc-appendChild($foo);

$bar = $doc-createElement(bar);
$foo-appendChild($bar);

$bazz = $doc-createElement(bazz);
$foo-appendChild($bazz);

echo $doc-saveXML();

?

Which generates:

?xml version=1.0?
foo
  bar/
  bazz/
/foo

Is there a way to make it create the following XML?

?xml version=1.0?
?xml-stylesheet href=xsl_table.xsl type=text/xsl?
foo
  bar/
  bazz/
/foo

I can't seem to find any dom functions to do this.

Thanks in advance,
Shanon



Hi Shanon,
please look at the Class itself, if you can modify the Header of the XML 
data over a method/Constant.


Greetings

Carlos Medina

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



[PHP] Re: reading XML

2008-11-21 Thread Carlos Medina

Hi Angelo,
try this:
http://pear.php.net/manual/en/package.structures.structures-datagrid.structures-datagrid-datasource.xml.php

regards

Carlos

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



[PHP] Re: PHP/mySQL question using ORDER BY with logic

2008-10-26 Thread Carlos Medina

Rob Gould schrieb:

Question about mySQL and PHP, when using the mySQL ORDER BY method...


Basically I've got data coming from the database where a wine 
producer-name is a word like:


Château Bahans Haut-Brion

or

La Chapelle de La Mission Haut-Brion

or

Le Clarence de Haut-Brion

but I need to ORDER BY using a varient of the string:

1)  If it begins with Château, don't include Chateau in the 
string to order by.
2)  If it begins with La, don't order by La, unless the first 
word is Chateau, and then go ahead and order by La.



Example sort:  Notice how the producer as-in comes before the 
parenthesis, but the ORDER BY actually occurs after a re-ordering of the 
producer-string, using the above rules.


Red: Château Bahans Haut-Brion (Bahans Haut-Brion, Château )
Red: La Chapelle de La Mission Haut-Brion (Chapelle de La Mission 
Haut-Brion, La )

Red: Le Clarence de Haut-Brion (Clarence de Haut-Brion, Le )
Red: Château Haut-Brion (Haut-Brion, Château )
Red: Château La Mission Haut-Brion (La Mission Haut-Brion, Château )
Red: Domaine de La Passion Haut Brion (La Passion Haut Brion, 
Domaine de )

Red: Château La Tour Haut-Brion (La Tour Haut-Brion, Château )
Red: Château Larrivet-Haut-Brion (Larrivet-Haut-Brion, Château )
Red: Château Les Carmes Haut-Brion (Les Carmes Haut-Brion, Château )


That logic between mySQL and PHP, I'm just not sure how to 
accomplish?  I think it might involve a mySQL alias-technique but I 
could be wrong.


Right now, my PHP call to generate the search is this:

$query = 'SELECT * FROM wine WHERE MATCH(producer, varietal, 
appellation, designation, region, vineyard, subregion, country, vintage) 
AGAINST ( ' . $searchstring . ')  ORDER BY producer LIMIT 0,100';




Hi,
Try to solve your Logic on your programming language and to select Data 
with your Database... Try to normalize more your Information on the 
Database.


Regars

Carlos

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



[PHP] Re: Singletons

2008-10-22 Thread Carlos Medina

Hi,
here is in my opinion, what you can do:

class Base
{
  private $foo;
  private function __construct()
  {}

  public function getFoo()
  {
return $this-foo;
  }

  public function setFoo( $foo )
  {
  $this-foo = $foo;
  }
}

class Singleton extends Base
{
  public function __construct()
  {}

  private function __clone()
  {}

  public static function getInstance()
  {
static $instance = null;
if (!isset($instance))
  $instance = new self();
  $instance-setFoo( 'singleton' );
return $instance;
  }
}


$bar = Singleton::getInstance();
echo $bar-getFoo(); // Singleton

Regards

Carlos

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



[PHP] Re: Singletons

2008-10-22 Thread Carlos Medina

Colin Guthrie schrieb:

Stut wrote:

On 20 Oct 2008, at 20:24, Christoph Boget wrote:

 public function __construct()

A singleton would usually have a private constructor to prevent
non-singleton instances.


The problem being if the class in question derives from another class
that has a public constructor...  If you are in that particular
situation (which I am), you're basically SOL and the statement above
has no bearing.


Correct, but you're then breaking one of the rules of the singleton 
pattern. If you're stuck with that then you'll need to enforce the 
singleton aspect in non-technical ways (policy, regular beatings, etc).



I disagree (not with the regular beatings... that's very important for 
moral!), but with the statement that says you are SOL if you want to 
create a singleton that derives from another class with a public 
constructor, you just have to make the derived class' constructor 
private and call the parent's constructor:



class Base
{
  private $foo;
  public function __construct($foo)
  {
$this-foo = $foo;
  }

  public function getFoo()
  {
return $this-foo;
  }
}

class Singleton extends Base
{
  private function __construct()
  {
parent::__construct(Singleton);
  }

  public static function getInstance()
  {
static $instance = null;
if (!isset($instance))
  $instance = new self();
return $instance;
  }
}


$bar = Singleton::getInstance();
$bar-getFoo(); // Singleton


(entirely untested)

Col


Hallo,
this is the Result of my test with your Code:

Fatal error: Access level to Singleton::__construct() must be public (as 
in class Base) in C:\Users\cmedina\Documents\test1.php on line 30


Regards

Carlos

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



[PHP] Re: what's the difference in the following code?

2008-10-18 Thread Carlos Medina

Hi,
why say Chris Shiflett that this is not good: because security problems 
or because you cannot see very good what the code do?.



Regards

Carlos

Lamp Lists schrieb:

I'm reading Essential PHP Security by Chris Shiflett.

on the very beginning, page 5  6, if I got it correct, he said this is not 
good:

$search = isset($_GET['search']) ? $_GET['search'] : '';

and this is good:

$search = '';
if (isset($_GET['search']))
{
$search = $_GET['search'];
}

what's the difference? I really can't see?
to me is more the way you like to write your code (and I like the top one :-) )?

thanks.

-ll


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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



[PHP] Re: PHP Dev Facts

2008-10-17 Thread Carlos Medina

[snip]
*Procedural or OOP?*
depends on the job to be done
*Dev OS*
unix or derivate
*Dev PHP Version*
= 5
*Live Server OS*
unix or derivate
*Live Server PHP Version*
= 5
*Which HTTP Server Software (+version)?*
Apache = 2
*IDE / Dev Environment*
PHPEd/Net Beans
*Preferred Framework(s)?*
Zend Framework, EzComponents
*Do you Unit Test?*
yes
*Most Used Internal PHP Class*
echo! No.. i dont know
*Preferred OS CMS*
SimplyContent()
*Anything else you use frequently in you're PHP'ing that's worth
mentioning:*
none
[/snip]

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



[PHP] Check Variable with true or not

2008-09-29 Thread Carlos Medina

Hi @ all:

Question: what is quickly?

if( true == isset( $var ) ){}
or
if( isset( $var ) ){}

Can somebody explain ( not think or believe ), what happend on the Zend 
Engine when the first or the second code will be use?



Regards

Carlos

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



[PHP] Re: class const versus define

2008-09-24 Thread Carlos Medina

Richard Lynch schrieb:

Is there any reason why the logic behind define() couldn't be pushed down to 
class const?

Code like this is kinda fugly:

//It's okay here, but not in a class?
define('CACHE_DIR_LONG',  CONFIG_ROOT_PATH . '/cache/');
class Cache {
  const CACHE_DIR = '/dev/shm/cache/';
  const CACHE_TTL = 300; //5 minutes
  const CACHE_DIR_LONG = CACHE_DIR_LONG;

I'd really prefer to write:
class Cache {
  const CACHE_DIR = '/dev/shm/cache/';
  const CACHE_TTL = 300; //5 minutes
  const CACHE_DIR_LONG = CONFIG_ROOT_PATH . '/cache/';

I'm happy to add it as a feature request, but not if somebody reliable says Don't 
Bother...

--
Richard Lynch



___

The  information in this email or in any file attached
hereto is intended only for the personal and confiden-
tial  use  of  the individual or entity to which it is
addressed and may contain information that is  propri-
etary  and  confidential.  If you are not the intended
recipient of this message you are hereby notified that
any  review, dissemination, distribution or copying of
this message is strictly prohibited.  This  communica-
tion  is  for information purposes only and should not
be regarded as an offer to sell or as  a  solicitation
of an offer to buy any financial product. Email trans-
mission cannot be guaranteed to be  secure  or  error-
free. P6070214


Hi Richard,
the define function is to be used on the global scope of your 
application. This is helpful to assign Configurations Options and other 
data that you do not will move. For the Class Constants you define the 
Constant only fo the Class where you are working.

Please read the documentation about this on PHP.NET
http://de.php.net/manual/en/language.oop5.constants.php

Regards

Carlos

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



[PHP] Re: Static method variable

2008-09-18 Thread Carlos Medina

Christoph Boget schrieb:

Perhaps I'm misunderstanding what a static method variable is supposed
to do.  I thought the value would be static for an class' instance but
it appears it is static across all instances of the class.  Consider:

class StaticTest
{
  public function __construct()
  {
  }

  public function test( $newVal )
  {
static $retval = '';

if( $retval == '' )
{
  $retval = $newVal;
}
echo $retval . 'br';
  }
}

$one = new StaticTest();
$one-test( 'joe' );
$two = new StaticTest();
$two-test( 'bob' );

Should it be working that way?

thnx,
Chris

Hi Chris,
please read here. If you have questions after that. Write again please:

http://de3.php.net/manual/en/language.oop5.static.php

Regards

Carlos

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



Re: [PHP] Passing an array from PHP to Javascript

2008-09-16 Thread Carlos Medina

Yeti schrieb:

I would use an unserializer.

http://code.activestate.com/recipes/414334/


Hi,
why not JSON?

Regards

Carlos

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



[PHP] Re: Readdir() question

2008-09-11 Thread Carlos Medina

Ben Stones schrieb:

Hi,

I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to loop
all the files on the same directory and to tell PHP read the same directory,
I think I'd need to use the magic constant I think its called, __DIR__ such
as:

?php
$dir=opendir(__DIR__);
while($files=readdir($dir)) {
echo $files;
}
?

But I get a few errors:

*Warning*: opendir(__DIR__) [function.opendir]: failed to open dir: No error
in *C:\wamp\www\Project1\index.php* on line *2*

*Warning*: readdir(): supplied argument is not a valid Directory resource in
*C:\wamp\www\Project1\index.php* on line *3

*Any help in the right direction will be appreciated!

Cheers.


Hi Ben,
if you are searching help, then here: www.php.net - this is the right 
direction



regards

Carlos

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



Re: [PHP] Thank you...

2008-09-11 Thread Carlos Medina

Dan Joseph schrieb:

On Thu, Sep 11, 2008 at 9:23 AM, Jason Pruim [EMAIL PROTECTED] wrote:


Okay... I am sorry that I even sent the message. 7 years ago today, My
Uncle died because he worked in the south tower on the 93rd floor All I
wanted to do was say thank you to the WORLDS armed forces for feeling the
call to protect their country from what ever enemy was at their gates
Even to the point of thanking the iraqi army for defending their country
against America

LET THIS END HERE PLEASE!



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]





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



Jason, you have nothing to be sorry for.  The post was good.  There's always
1-2 guys in every crowd that are going to say something inappropriate.  Just
ignore 'em.

Have you all seen the picture of the new battle cruiser built out of the
scrap metal from the towers?


Hi @all,
what about a generally to shut up. More Respect please.

Regards

Carlos

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



[PHP] Re: Installation doesn't complete, Windows Vista: error - script required to complete

2008-09-10 Thread Carlos Medina

Ben Stones schrieb:

Hi,

Others are facing the same problem and theres an official bug report here
about it: http://bugs.php.net/bug.php?id=43639thanks=3

PHP hasn't fixed it since December 2007, wondering if anyone has a
workaround as I cannot even uninstall it now as the same problem arises. Is
there any workaround as I have Apache and MySQL all ready and setup.

Cheers.


Hi,
use Xampp -http://www.apachefriends.org/en/xampp-windows.html and relax

simply!

Carlos Medina

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



[PHP] Re: Anything like XAMPP?

2008-09-10 Thread Carlos Medina

Ben Stones schrieb:

There's a bug, I believe with XAMPP where from XAMPP CP you click 'admin'
under MySQL, when WinMySQLadmin comes up, the icon in the right (traffic
light) is always red, and there's no option to start the service anymore...
at the moment there's a Stop the Service option but it's unselectable. Are
there other ready-setup environment just like XAMPP that has phpMyAdmin
included, too? I know this has nothing to do with PHP individually but any
help will be appreciated!

Cheers!


Hi Ben,
it is possible you find ALL the Bugs?.

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



[PHP] Re: SimpleXML strange behaviour.

2008-09-09 Thread Carlos Medina

Mirco Soderi schrieb:

Do you know any reason why the following code does work


$xmlOperazioni = simplexml_load_file($xmlFilename);
foreach($xmlOperazioni-operazione as $operazione) {
   if($operazione['nome'] == $operazioneRichiesta) {
  require($operazione['php']);
  break;
   }
}

but the following does not

$xmlOperazioni = 
simplexml_load_file($impostazioni['root']['configurazione']['generale']['xml_operazioni']);
foreach($xmlOperazioni-operazione as $operazione) {
   if($operazione-nome == $operazioneRichiesta) {
  require($operazione-php);
  break;
   }
}

that is I MUST access childrens of the element operazione as if it was an 
array, while (in the same page) the following code does work

$xmlViste = 
simplexml_load_file($impostazioni['root']['configurazione']['generale']['xml_composizione_viste']);
foreach($xmlViste-vista as $vista) {
if($vista-nome == $nomeVistaDaMostrare) {
   $smarty-assign(intestazione,componenti/.$vista-intestazione);
   $smarty-assign(menu,componenti/.$vista-menu);
   $smarty-assign(contenuto, componenti/.$vista-contenuto);
   $smarty-assign(pie_di_pagina, componenti/.$vista-pie_di_pagina);
   break;
}
}

but the following does not

$xmlViste = 
simplexml_load_file($impostazioni['root']['configurazione']['generale']['xml_composizione_viste']);
foreach($xmlViste-vista as $vista) {
if($vista['nome'] == $nomeVistaDaMostrare) {
   $smarty-assign(intestazione,componenti/.$vista['intestazione']);
   $smarty-assign(menu,componenti/.$vista['menu']);
   $smarty-assign(contenuto, componenti/.$vista['contenuto']);
   $smarty-assign(pie_di_pagina, componenti/.$vista['pie_di_pagina']);
   break;
}
}

that is this time I MUST access the childrens of the element operazione as if 
it was an object?

Hi,
it is too dificult to say without the XML file youre try to load.


Regards

Carlos

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



[PHP] Re: translations for PHP app

2008-09-08 Thread Carlos Medina

Shawn McKenzie schrieb:

Hi All,

I'm looking for professional translations from English of the following:
- admin.php lang file just under 150 PHP defines
- user.php lang file just under 30 PHP defines
- a javascript file with about 25 single word defines
- about 19 PHP files with 2 defines in each

Most defines are 1 or 2 words with a few being sentences.

I need translations from English into the most common languages of my 
users: Spanish, French, Italian, Chinese, Indian, Russian.  Also, anyone 
having expertise in other languages, I would love to have them, please 
contact me.


I also have a 30+ page user guide for using my software.  Many pages 
contain large graphics, but the English text I woul love to have 
translated.


Of course I will pay.  PayPal only.

Thanks!
-Shawn

Hi Shawn,
i can help you with the Translation in Spanish and German. I am native 
Speaker, with more than 5 Years experience on PHP Programming and 
Translations of Back- Frontend.


Regards

Carlos Medina

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



[PHP] Re: newbie - how to receive/iterate posted arrays

2008-09-01 Thread Carlos Medina

Govinda schrieb:

Hello early birds,

I am going round and round the docs and list posts I saved on this 
topic... but I am still stumped.
Kindly show me what I am missing.  I want to simply send an array of 
vars via a post form to my receiving script.


I've got simple inputs like this:

input name=tmbsToiterate[muir_beach_tmb] type=hidden 
value=muir_beach_tmb /
input name=tmbsToiterate[ruby_mountain_tmb] type=hidden 
value=ruby_mountain_tmb /


they post to the script with this: (and this is the line giving the error)-

foreach($_POST['$tmbsToiterate'] as $value) {

The error is Warning: Invalid argument supplied for foreach()

Seems so simple, but I can't get it... What am I doing wrong?
-Govinda


Hi Govinda,
delte the $ from the foreach '$tmbsToiterate'!

Regards

Carlos


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



[PHP] Re: uploading file outside WEB Root

2008-09-01 Thread Carlos Medina

Angelo Zanetti schrieb:
Hi All, 


For security purposes I would like to upload a file outside the webroot.

I have got this to work on my local dev machine but it doesn't seem to work
on the live server.

I have tried both the relative path and also the full path (from the
$_SERVER[DOCUMENT_ROOT] variable).

Now I can't get the upload to work and have no idea what the problem could
be. I have also set the permissions of the folder, so that can't be a
problem.

Could it be a problem with server hosting restrictions? Or maybe the server
is setup for virtual hosting?

Thanks
Angelo





Hi Angelo,
dev and live are the same Server/Machine type?
Restrictions on the Folder? ( Group restrictions, User Restrictions, etc)
Exists the Folder on the Live System?


Regards

Carlos

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



[PHP] Re: Is this a bug?

2008-08-29 Thread Carlos Medina

Catalin Zamfir Alexandru, DATAGRAM SRL schrieb:

Hello guys,

I've been stalking on the list for some time. Didn't have
anything to report/talk, until now. I have a code like this, maybe you guys
can reproduce it, with output buffering started:

Echo 'something';

Echo 'another thing';

Echo 'something br /'\;

 


What happens is that ANYTHING that was echo'ed until that \,
will not reach the buffer. Although, this should actually be a Parse Error,
it isn't, it just echoes what was echoed after the god damned \. It took me
two hours to find this typo in the code .

 


Can you guys reproduce the error? I can actually give you a
link to the server where this code runs.



Hi,
yes this is a Bug in your code ;-)

-- Unexpected character in input: '\' (ASCII=92) state=1 in ...
This is the Error Output you will see.

Regards

Carlos

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



[PHP] Re: ! function_exists(curl_init) BUT curl_init exists and works.

2008-08-28 Thread Carlos Medina

daniel danon schrieb:

! function_exists(curl_init) BUT curl_init exists and works.

After my host blocked the file_get_contents and other functions, I am
using CURL - but when I do function_exists(curl_init) it returns
false but I can still use it anyone knows why?


Hi Daniel,
read here: http://de3.php.net/manual/en/function.function-exists.php

Where is defined the curl_init function? this ist maybe why 
function_exists doesnt Work as you expected. Check the curl_init() with 
*  method_exists()

* is_callable()
* get_defined_functions()

Regards

Carlos

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



[PHP] Re: Manual Coding vs. CMS Systems

2008-08-28 Thread Carlos Medina

Auto-Deppe, C. Haensel schrieb:

Hi all!

And again, a slightly off topic subject for you all from yours truly :o)

I have a customer (helicopter company) who is willing to give me some free
flights for a small website.

Now, I have been talking to my sister in law who is a designer (note:
designer, not coder). She said I should be using Joomla or something of that
sort and change it to fit my needs.

I, on the other hand, am more into using my own code, starting with the
first Hello World and ending up being a full fledged CMS with just the
functions the customer needs. I have a lot of code in my code database
already, so it would be a lot of copy and paste and a bit of coding. I think
the whole thing will take about 60 work hours.

I am into hand coding, to be honest. Using Joomla or other CMS systems is
fine, but I want this to be a nice point on my CV if I ever need to get a
new job. And, most important to me, it _feels_ much better to have it done
from scratch all by yourself, doesn't it?

So, I would love to hear your opinion on this. Sorry for being a bit off
topic here as this is not 100% coding related, but I _had_ to get some
feedback to backup my position ;o)

Cheers!


Chris



Hi Chris,
in my Opinion in this case the CMS the best way to build a small website 
without too much unnecesary develop work. I think, if you use a CMS to 
build the (basic) Website, like sites, Forms and others, you will be 
able to offer more Add ons for your Client.


I think is not really important, what kind of CMS you will use, because 
a small site do not need high level programming, or special caching for 
better performance or something like this.


Hand Coding will eat more time to get the same result as the CMS 
itself, and your Client will pay more (if pay by hour ;-). With CMS you 
can offer other works like Data Integration, Tree Navigation, News, 
Feeds, Ajax and so one.


I hope this was helpfully

Regards

Carlos

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



Re: [PHP] Manual Coding vs. CMS Systems

2008-08-28 Thread Carlos Medina

Auto-Deppe, C. Haensel schrieb:

-:-  -Original Message-
-:-  From: Jochem Maas [mailto:[EMAIL PROTECTED]
-:-  Sent: Thursday, August 28, 2008 1:46 PM
-:-  To: [EMAIL PROTECTED]
-:-  Cc: php-general@lists.php.net
-:-  Subject: Re: [PHP] Manual Coding vs. CMS Systems
-:-
-:-  Auto-Deppe, C. Haensel schreef:
-:-   Hi all!
-:-  
-:-   And again, a slightly off topic subject for you all from
-:-  yours truly :o)
-:-  
-:-   I have a customer (helicopter company) who is willing
-:-  to give me some free
-:-   flights for a small website.
-:-  
-:-   Now, I have been talking to my sister in law who is a
-:-  designer (note:
-:-   designer, not coder). She said I should be using Joomla
-:-  or something of that
-:-   sort and change it to fit my needs.
-:-
-:-  designers should keep their mouths shut when it comes to
-:-  code/coding ...
-:-  I don't care if she's your sister or the queen of england.
-:-
-:-  do we tell them what to draw? not if your smart, if your
-:-  smart you'll only
-:-  ever tell them when something is impossible to implement
-:-  (this-is-the-web-not-a-sheet-of-A4),
-:-  or when something is not cost effective to implement (i.e.
-:-  the client will never
-:-  agree to pay for X)
-:-
-:-  make your own mind up as to what is the most effective solution.
-:-
-:-   I, on the other hand, am more into using my own code,
-:-  starting with the
-:-   first Hello World and ending up being a full fledged
-:-  CMS with just the
-:-   functions the customer needs. I have a lot of code in my
-:-  code database
-:-   already, so it would be a lot of copy and paste and a
-:-  bit of coding. I think
-:-   the whole thing will take about 60 work hours.
-:-
-:-  Im guessing you'd spend that much time just implementing a
-:-  decent design into
-:-  a Joomla or whatever. I mean a design that doesn't look
-:-  like it was generated
-:-  by Frontpage.
-:-
-:-   I am into hand coding, to be honest. Using Joomla or
-:-  other CMS systems is
-:-   fine, but I want this to be a nice point on my CV if I
-:-  ever need to get a
-:-   new job. And, most important to me, it _feels_ much
-:-  better to have it done
-:-   from scratch all by yourself, doesn't it?
-:-  
-:-   So, I would love to hear your opinion on this. Sorry for
-:-  being a bit off
-:-   topic here as this is not 100% coding related, but I
-:-  _had_ to get some
-:-   feedback to backup my position ;o)
-:-  
-:-   Cheers!
-:-  
-:-  
-:-   Chris
-:-  
-:-  
-:-  
-:-
-:-

Hahaha.. THAT one told exactly what I feel! Thanks :o)))

Also a big thanks to the others who already replied. Waiting for more on
that Great one Jochem!!



Kids

Carlos

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



Re: [PHP] Manual Coding vs. CMS Systems OT

2008-08-28 Thread Carlos Medina

Watch him go... there is Carloos, the man infront of all the others. He
is WAY ahead, and he is gaining more and more speed. He is an adult, and he
is sooo adult that he can't even take a laugh... see him run from the
humor! Faster and faster he runs... and there it is: the goal: an open
casket for the people going through life without having a good laugh every
now and then :o

Aaanyhow... *grabs his coffee and keeps working while shaking his head
because of the stupid comment posted by Carlos*

Cheers :o



:-) Kids

Carlos

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



[PHP] Re: PHP IDE needed

2008-08-27 Thread Carlos Medina

Sascha Braun schrieb:

Hi people,

I have a webproject which is round about 3 GB in size. I was usually
using eclipse to work with the software but over time eclipse became
very instable regarding that project.

As soon as I open classes with 2000 or more lines of code in it, an out
of memory error occours.

So I need a new IDE for linux.

Please tell me which IDE might be a true alternative for projects at
that size.

Thank you friends,

kind regards,

Sascha

Hi Sascha,
Try PHPed

Regards

Carlos

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



Re: [PHP] PHP editor for linux

2008-08-26 Thread Carlos Medina

Thodoris schrieb:


O/H It flance ??:

Hi,

What do you think is the best php editor for linux.

I'm using the Debian distribution.

Thanks


 

  
I surprisingly use PSPad editor which is quite neat solution and support 
some basic regexps.


http://www.pspad.com/

I think I'll probably move to vim since nothing seems more powerful but 
yet so nerdish.


It was nice talking for this all boring, again-and-again issue because I 
got some very good ideas and I will totally try eclipse.



Hi,
PHPed is nice

Regards

Carlos

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



Re: [PHP] file_exists() not working correctly?

2008-08-25 Thread Carlos Medina

Chris schrieb:

Chris Haensel wrote:

Good morning list,

I have a _very_ simple function... it is as follows

/**/

function getgalimage($fzg) {
$folder=bilder;
$imgname=$fzg._1.JPG;
$checkimg=$folder./.$imgname;
if(file_exists($checkimg)) {
//echo 'img
src=mod_search_thumbs.php?bild='.$imgname.'fzg_nr='.$fzg.'';
echo 'img src='.$checkimg.'';
} else {
echo 'div style=display:block; padding:2px; border:1px
solid red;a href='.$checkimg.''.$checkimg.'/a/div';
}
}

/**/

Now, the folder bilder exists, and I pass the number 0002822 to the
function. Now it should check whether the image file 
bilder/0002822_1.JPG
exists. It never finds the image, even though it exists (I checked it 
many

times now)


Try a full path:

$folder = '/full/path/to/bilder';


Hi,
please show at your JPG or jpg lower or Uppercase at first. Check if the 
file really exists and your server can read of the directory


Regards

Carlos

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



[PHP] Re: index.php not autoloading in apache

2008-08-25 Thread Carlos Medina

Vince Sabio schrieb:
I am running PHP v5.2.6 on an Apache v2.2 server. For some reason, 
Apache is not automatically loading index.php files, even when there is 
no other index.* file in the directory; it will throw a you do not have 
permission to access [directory] instead.


I have the following in my httpd.conf file:

LoadModule php5_modulelibexec/apache22/libphp5.so
php_value session.save_path /tmp/
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

In case it matters, the server OS is FreeBSD-7.0-RELEASE.

Any idea what the problem is? I mean, other than the wetware?

Muchas gracias

__
Vince Sabio  [EMAIL PROTECTED]

Hi Vince,
search (grep/find ) for DirectoryIndex: Statement

Regards

Carlos

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



Re: [PHP] Licensing

2008-08-22 Thread Carlos Medina

Richard Heyes schrieb:

Hi Per,


License costs in EUR, CHF and DKK?  Seriously, I would quote the price
in one currency only, and leave it for people to convert.


Yes I've quoted it in UK pounds, but since the almighty dollah is more
well known, I've got an approximate conversion there too.


There's one 'm' too many in commmercial.


Thanks. My eyesight strikes again. :-)


Hi,
do not forget the OT on the Subject.

Regards

Carlos

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



[PHP] Re: PHP editor for linux

2008-08-18 Thread Carlos Medina

It flance schrieb:

Hi,

What do you think is the best php editor for linux.

I'm using the Debian distribution.

Thanks


  


Hi it´s allways the same: What for Editor are you using? and blah.
Please this dicussion is old and not funny anymore (i think ). The
Developer which vi or nano  on debian to can be a good programmer too.

Regards

Carlos Medina

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



Re: [PHP] On one of my computers, php can't see an external javascriptI included

2008-08-14 Thread Carlos Medina

googling1000 schrieb:

I have apache and php on Windows.
I have 3 computers. A php file is calling an external .js file.
Two of my computers have no problem calling a .js file, there's only one
machine that doesn't execute functions inside of the .js file.

My .php file has the following line in the beginning of the file:
script src=myfunctions.js/script


My .js file consists of a number of functions written in javascript

I don't know why functions inside .js file doesn't get executed.

I tried copy/paste all the functions inside the .js file to my .php file and
it works.
I don't understand how my machine can't read an external .js file

I'm frustrated. Help will be appreciated!

Hi,
to check where your log are look at the Apache directory. If you are 
using a bundle or apache with installer you will find your directory 
apache/logs there where apache was installed ( The Windows way is easy - 
for all then doesnt know about windows );-)



Best regards

Carlos

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



[PHP] Re: newsletter code

2008-08-11 Thread Carlos Medina

Angelo Zanetti schrieb:
Hi All, 


I have a question related to newsletter subscriptions to websites as well as
sending out of the newsletters.

Here is the scenario: 


Client wants a subscribe to newsletter dialog on website, typically just
an email address.

Then in his admin section he wants to send out HTML newsletters/plain text
depending on the user's email client.

Now how would I go about creating the newsletter in the backend? Using a
WSIWIG editor? Or is there some code that you guys use as there are also
things to consider such as: 


-bulk mailing, instead of sending many mails at once. Rather send out some
scheduled emails

-Plain text vs HTML email

Etc...

What do you guys use if you are building a custom web app?

I have seen Webinsta before it works well but it's a separate system.

Let me know, 


Thanks

Kind regards
Angelo

Web: http://www.elemental.co.za 




Hi Angelo,
look little bit around. This Issue is not Easy as Richard says. But 
maybe with http://www.jtr.de/scripting/php/newsletter/index.html JAX 
Mailing list manager ( Only Germay as i can see ) or PHPlist, or LetterIt.


Regards

Carlos

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



[PHP] Re: Send a cookie with a file_get_contents( ) request?

2008-08-10 Thread Carlos Medina

Anders Norrbring schrieb:

I have a web site where I use cookies to store logins, and also session
cookies for users logged in.
Is there a way for me to use file_get_contents() to pull content which are
behind the login?
In other words, I want to use my own log-in cookie and somehow send it with
the file_get_contents request to get the content.
Can I somehow do this? Or are there other ways?

Anders.

I dont know what you mean with behind the Login, but if you want to 
request extern content with authentication, use CURL extension to do 
this. Other way is, use Frames on your site, to load extern content.


Regards

Carlos

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