Jump to content

flaab

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

flaab's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I have a really strange problem in a production server and I don't know what it is. I'm going nuts. I'm programming a HTML newsletter that is saved into he hard drive and sent by mail. So, the HTML code must be created dinamically. Take a look at the following (simplified) code. Basically, it grabs an array of strings and displays an image for each one of them. // Iteramos parrafos poniendo fotos si tenemos for($it = 0; $it < count($parrafos); $it++) { // El parrafo debe ser mas alrgo que 3 caracteres if(strlen($parrafos[$it]) > 2) { // Si tenemos foto para este parrafo if(isset($imagenes[$image_it])) { $cuerpo_final .= '<img width="80" src="http://www.ecoturismorural.com'; $cuerpo_final .= $imagenes[$image_it]; $cuerpo_final .= '" />'; $image_it++; } // Ponemos parrafo $cuerpo_final .= "\n<p>". $parrafos[$it] ."</p>\n"; } } The created string is not modified at any time before being printed on the screen. And the local output is the following: <img width="80" src="http://www.ecoturismorural.com/img/Parrafos/File/IMG_0161.JPG" /> <p>Durante la semana del 26 al 30 de Mayo un grupo ... (more text)</p> <img width="80" src="http://www.ecoturismorural.com/img/Parrafos/File/IMG_0166.JPG" /> <p>El programa "Galicia Natural" tiene como objetivo ... (more text)</p> That will be the correct output. The problem is...the same script executed on the production machine outputs other thing completely! - Domain names are removed from all URLS - Characters < > and " are trasnslated into html entities - Image outputs are surrounded by <p> and </p> All these all by its own! :s <p><img src="img/Establecimientos_Mini/4385La%20Monta%F1eta%201.JPG"></p> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed lorem ... (more text)</p> <p><img src="img/Establecimientos_Mini/64266.jpg"></p> <p>Class aptent taciti sociosqu ad litora torquent per ... (more text)</p> And it's just he same echo(). I would really appreciate any help! Thanks!
  2. Hi :-) I've been struggling arround for a while and don't know how to make this. I would like to know if a certain class variable is declared (even if no value has been assigned to it). For example... class foo { var $something; // Declared with no value //var $else; // Commented, not declared } $obj = new foo(); // Note function is_declared does not exists...I need a function to do this... if(is_declared($foo->something)) echo "Something variable is declared"; if(!is_declared($foo->else)) echo "Else is not declared"; When using isset, false is always retrieved because no value is assigned to those vars. Thanks a lot!
  3. Yeah :-) Php version is... arturo@firecracker ~ $ php --version PHP 5.2.4-2 with Suhosin-Patch 0.9.6.2 (cli) (built: Oct 24 2007 20:08:19) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies And PHP error triggered is... Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /var/www/static.php on line 10 And the code is still... <?php class Foo { const constant = 'Cadena de mierda'; } $classname = 'Foo'; print $classname::constant; ?> thx
  4. Hi :-) I've been trying to do this for a long time...how can I make this work? I always get an error :-) <?php class Foo { public static $my_static = 'foo'; } $classname = 'Foo'; print $classname::$my_static ; ?> It's an officla php example from the official website...but it does not work :-S
  5. Hi :-) I'll go straight to the point; MySql has a "native" ENUM|SET datatype that allows you to insert only certain values, and those values can be retrieved from the Php code to create a combobox. Postgres does not have such datatype, so it has to be "emulated" like this... create table foo ( enumField varchar (check enumField in ('value1', 'value2')) ); So far so good but...How can I retrieve those values from my Php code to create a combobox? :-) Thx!
  6. Hi =) I have a class that may have a lot of relationships and I would like to do something like this... public function getRelated<classname>(){ // Whatever logic } But I want <classname> to be variable...for example getRelatedBooks getRelatedArticles, each class has his own relationships. Can that be done? Thx!
  7. I again! That works but I need to make that class function, also available for the subclasses. Is that possible?
  8. Hi I've a little problem. We can iterate an array or a hash doing something right? Well...what I need is something similar but with all the defined variables within my Scope. A little pseudocode example.. class foo extends whatever { public function doSome() { /* lots of variable declaration and assignation */ foreach(Declared_variable_in_my_scope as $name => $value) do something with it } } } Is there any way to do this? Thx!
  9. Hi =) I've set up a rewrite rule like this <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^([^.]+)/?$ index.php?$1 [L] </IfModule> So this this redireccion is applied. http://www.foo.com/client/view/3 -> http://www.foo.com/index.php?client/view/3 http://www.foo.com/video/delete/56 -> http://www.foo.com/index.php?video/delete/56 The redirection works fine but all my Css, images and files links are broken when inside any controller. How can this be fixed? Is there any mod_rewrite rule for that? Cheers.
  10. I got it! Like this <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^([^.]+)/?$ index.php?$1 [L] </IfModule> But now my Css links are broken and some images as well. How can I link them?
  11. Hi :-) The index.php is called with a large query string. Example: index.php?controller/action/param1/../param10 The last url is the same as www.domain.com/?controller/action/param1/../param10 Then in the php code $_SERVER['QUERY_STRING'] is "controller/action/param1/../param10". Then I explode the query string and call the requested controller executing the requested action and passing the given parameters. I just want to get rid of the ugly '?' char in the Url so it can be called like this www.domain.com/controller/action/param1/../param10 I will keep on trying :-) thanks
  12. I've tried and it does not work =) Here's my .htacess Options -Indexes Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ index.php?$1 [L] The problem is that www.foo.com/foo/foo1/foo2 should be pointing to www.foo.com/index.php?foo/foo1/foo2. I've tried with this one also Options -Indexes Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^(.*)$ index.php?$1 [L] But it does not work either :-) thanks anyway i'll keep trying
  13. Hi folks :-) My problem is dumb but it's driving me nuts. I have an index.php that receives urls like these - www.domainname.com/index.php?foo/fooaction/parameters - www.domainname.com/index.php?articles/view/5 - www.domainname.com/index.php?contact The part behind ? is called QUERY_STRING in Apache and Php and it's JUST ONE string ("foo/foo2/foo3/whatever") I would like to redirect www.domainname.com/controller/action/parameter to www.domainname.com/index.php?controller/action/parameter so the "index.php?" part does not have to appear in the url. I've played around for a long time but i haven't been able to get it. Which is the correct RewriteRule for that? Thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.