Re: [PHP] convert byte to MB

2006-07-25 Thread cajbecu
weetat wrote:
 Hi all ,
 
  I have data which have value in bytes for example ,
 
$bytes = 33554432;
 
   How to convert this to MB ?
 
 THanks
 
  - weetat (PHP Novice)
 

1GB = 1024 * 1MB = 1024 * (1024 * 1KB) = 1024 * (1024 * (1024 * 1byte))

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



[PHP] PDF: Join more pdf files into one

2006-09-04 Thread cajbecu
Hello,

I have to join more pdf files into single one (that will be available
for download) and i must to that from PHP. I have read the documentation
from php.net/pdf adn php.net/clibpdf but no ring.
How can I do that?

Thanks in advance, cheers.

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



[PHP] PHP 5.1.6 - virtual_root_level

2006-09-05 Thread cajbecu
Hello,

It seems that virtual_root_level is not working with PHP version 5.1.6!
I tried to aply the patch designed for 4.3.4 but there was no changes..
Is there any patch for that designed for PHP version 5.1.x? How can I
make virtual_root_level working on my server?

Thanks in advance,
cajbecu

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



Re: [PHP] php cli and mysql

2006-11-14 Thread cajbecu

touch /var/mysql/mysql.sock
chmod 777 /var/mysql/mysql.sock

On 11/14/06, James Tu [EMAIL PROTECTED] wrote:

I'm running a php script from the command line (I'm on OS X) and I'm
getting ...

Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/mysql/mysql.sock' (2)

Here's the script (this just tests a connection and a query...the
actual script imports data from text files):


#!/usr/bin/php
?php

echo HELLO WORLD\n;
$connection = mysql_connect(HOST, ID, PW);
mysql_select_db(DB, $connection);
$result = mysql_query(SELECT COUNT(*) as num_of_countries from
geo_entities);
$row = mysql_fetch_array($result);
print_r($row);

?


I tested the script from a browser and the connection and query worked.
Do I have to do something special in order for PHP CLI to connect to
MySQL?

-James

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




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



Re: [PHP] cURL uses

2006-11-15 Thread cajbecu

well, there are more reasons you should use cURL ..
- control and flexibility of the output,
- post variables,
- can interact with secure servers (ssl - supports certificates)
- can use with proxys (http/socks)
- set timeouts
- easily modify headers :)
- use different ip`s of the server when it`s used (if it is configured to do so)

please read documentation at php.net/curl before changing your mind to
not use it. it helps you a lot in your applications. an old frend told
me.. you`ll love this class - what to see.. it happend  :)


On 11/15/06, Philip Thompson [EMAIL PROTECTED] wrote:

Hi.

I've been doing some reading trying to figure out why I would want to
use cURL. I have not found a solid reason yet. Does anyone have a
useful example on why you would want to use cURL?

Thanks,
~Philip

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




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



Re: [PHP] Remote MySQL connection via PHP file

2006-12-01 Thread cajbecu

i suggest you:

database.conf (the file on another server)

host=localhost
user=test
pass=test
anothervar=anothervalue


on your script:

$temp = file(http://../database.conf);
foreach($temp as $val) {
$temp2 = explode(=,$val);
$$temp2[0] = $temp[1];
}

after that, you`ll have:

$host = 'localhost'
$user = 'test'
$pass = 'test'
$anothervar ='anothervalue';

mysql_connect($host,$user,$pass);

(bla bla)

hope this help;

On 12/1/06, Scott [EMAIL PROTECTED] wrote:

Hi all,

I've been searching around for a while, but cannot find a solution. For
a project of mine, I need to keep the connection information to a MySQL
server database on another server.

Example remote file:

?php
$user = joe;
$pass = 1234;
?

Example local file:

?php
include http://www.remoteserver.com/remote_file.php;;
// Use variables $user and $pass somehow...
?

I've tried including the file which has the username/pass, etc
information via HTTP, but this doesn't seem to work. I assume because it
returns what a web browser would return if this file was loaded into
one, a blank screen.

I've tried using the return statement in the file which houses the
information, but this seems to return a boolean value (1 or 0)... not
sure what's up with that.

Any help with this would be most appreciated.

Thank you.

Scott

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




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



[PHP] droping upload files

2005-08-24 Thread cajbecu
Hello. I need some help. I set my php to run script.php before any php 
script. I want to drop uploaded files, so I did


?php
if ($_SERVER[SERVER_NAME]==some.host.on.my.server) {
   if ((isset($_SERVER['REQUEST_METHOD']))  
($_SERVER['REQUEST_METHOD']==POST)) {

   unset($_FILES);
   unset($HTTP_POST_FILES);
   }
   } else {
   }
?

it`s working for that host, but my question is.. if a user can upload his 
file on the server, despite the fact i unset all the global variables where 
the files are stored. 


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



Re: [PHP] how to convert 0.5 to 0.50

2006-04-13 Thread cajbecu
?php
print number_format('0.5',2,'.','');

// 0.50
?


Merlin wrote:
 Hi there,
 
 I am searching for a command on how to format 0.5 to 0.50
 
 thanx for any help,
 
 merlin
 

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



Re: [PHP] php - mysql problem

2006-04-14 Thread cajbecu
thanks for your posting, but I have:

table1

id
name
value

table2

id
x
y

i want to

id name value x y

but there is no id from table 2 that is in table2.id and i want the
resource to bu something like this:

id(from table 1) name value (empty) (empty)

Jay Blanchard wrote:
 [snip]
 $sql = SELECT * FROM `table1` LEFT JOIN `table2` USING `id` WHERE ...
 GROUP BY `table1`.`id`;
 
 mysql_query($sql);
 
 the problem is, that, when in table2 is not matching data using that id,
 i lose that id from output array. but i don`t want to.. is there any
 posibility to keep that id?
 [/snip]
 
 More of a mysql question but do a left outer join with no group by
 statement.
 
 SELECT table2.* 
 FROM table1 LEFT OUTER JOIN table2 
 ON(table1.id = table2.id)
 WHERE table1.id IS NULL  
 
 
 Returns all of table2 id's where there is no id in table1
 

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



Re: [PHP] php - mysql problem

2006-04-14 Thread cajbecu
thanks a lot for your posting,


[cut]
Posted by Fred Mitchell on December 11 2004 2:47pm  [Delete] [Edit]

Let's say you are doing a LEFT JOIN with a table that shares a column
name in common with another table, and that you are selecting for
instances where the join is missing, that is IS NULL.

Normally, the common column name is wiped out by the null record, but
here is a workaround for it: You simply alias that common column name in
the select. For instance,

CREATE TABLE t1 (INT id NOT NULL, );
CREATE TABLE t2 (INT id NOT NULL, );
...
SELECT * FROM t1 LEFT JOIN t2 ON t1.id = t2.id
WHERE t2.id IS NULL;

would result in the column 'id' being null on each selected row.
Instead, you can do:

SELECT *, t1.id AS id FROM t1 LEFT JOIN t2 ON t1.id = t2.id
WHERE t2.id IS NULL;

And now the 'id' column will be preserved since the alias is evaluated
*after* the LEFT JOIN.
[/cut]

pay attention to: -  *, t1.id  -

cheers,
cajbecu

Jay Blanchard wrote:
 [snip]
 $sql = SELECT * FROM `table1` LEFT JOIN `table2` USING `id` WHERE ...
 GROUP BY `table1`.`id`;
 
 mysql_query($sql);
 
 the problem is, that, when in table2 is not matching data using that id,
 i lose that id from output array. but i don`t want to.. is there any
 posibility to keep that id?
 [/snip]
 
 More of a mysql question but do a left outer join with no group by
 statement.
 
 SELECT table2.* 
 FROM table1 LEFT OUTER JOIN table2 
 ON(table1.id = table2.id)
 WHERE table1.id IS NULL  
 
 
 Returns all of table2 id's where there is no id in table1
 

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



Re: [PHP] 2 questions: Search in array and detect JS

2006-04-15 Thread cajbecu
In your script, $js will be false false!

Chrome wrote:
 How about
 
 ?php $js = true; ?
 
 noscript
   ?php $js = false; ?
 /noscript
 
 ?php
 if ($js)  {
   // whizzy Ajax code (or file include)
 } else {
   // generic warning (or include non-JS base file)
 }
 ?
 
 I know that would work but does it give the desired effect?
 
 Dan
 
  
 ---
 http://chrome.me.uk
  
 
 -Original Message-
 From: tedd [mailto:[EMAIL PROTECTED] 
 Sent: 15 April 2006 15:10
 To: Chrome; 'Ryan A'; 'php'
 Cc: 'Stut'
 Subject: RE: [PHP] 2 questions: Search in array and detect JS
 
 Something to consider might be:

 noscript
 Sorry! This page requires Javascript to function properly! Please enable it
 or get a decent browser
 /noscript

 !-- Normal page functions --

 I haven't tested it so there is a chance it's fiction :)

 Of course, if web standards aren't a concern it makes no difference

 Dan
 
 
 It works and if you want it to validate, just enclose the paragraph 
 in p/p, like so:
 
 noscript
 p
 Sorry! This page requires Javascript to function properly! Please enable it
 or get a decent browser.
 /p
 /noscript
 
 To bad that php within those tags is read regardless or we would have 
 an easy way to detect js.
 
 tedd

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



Re: [PHP] Can't make shorthand work in PHP5

2006-04-16 Thread cajbecu
Hello,

Check your php.ini configuration, there is an option to activate this
option.

[EMAIL PROTECTED] wrote:
 Dear List,
 The shorthand form ?=$printthis? worked fine for me in PHP4, but I
 cannot make it work in PHP5. (?php print($printthis); ? works ok,
 however).
 Could anybody please tell me if this form is still available in PHP5, and,
 if so, if a different syntax is needed?
 I searched the matter in the documentation but couldn't find it.
 Thank you
 
 Alberto Brea
 [EMAIL PROTECTED]
 

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



Re: [PHP] session

2006-04-20 Thread cajbecu
Hello,

Try generating your own session id and the problem will be solved ;)

cheers,

João Cândido de Souza Neto wrote:
 Hi everyone.
 
 I hope someone here can help me.
 
 When i start a session in a php page, this session receives an unique id.
 
 If you think about this, if i call a session_destroy() in any page and in
 the other paga call a session_start() again, it'll receive other unique id.
 But it isn't working. Everything above has been executed but the session
 id's always the same.
 
 It can be any config var in php.ini?
 
 Thanks for tips.
 

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



Re: [PHP] MS SQL extension not loading

2006-04-27 Thread cajbecu
Hello,

Search for file: libssleay32.dll and copy it in windows\system32 folder.
The problem will be solved.

Laszlo Nagy wrote:
 
  Hello Richard,
 
 I hope you remember my question.
 
 Richard Lynch wote:
 On Tue, April 11, 2006 11:45 am, Laszlo Nagy wrote:
  
 I have a problem with a Win2003 server, IIS6 and PHP 5.1.2. I have
 Microsoft SQL Server tools installed. C:\PHP is on the path. Extension
 dirs are configured correctly. The php_mssql.dll is present there.
 Everything looks okay, except that the server does not load the
 extension. If I do
 
   
 
 Step #5.
 Switch to a superior web server: Apache
 :-)
   
 So did I. I replaced the server with a new Windows 2000 server and MS
 SQL server, I have Apache 2.0.55 with PHP 5.1.2. The only thing I have
 in php.ini is:
 
 extension_dir=C:\PHP\ext
 extension=php_mssql.dll
 
 The php.ini file path was setup with the PHPIniDir directive. I can load
 other extensions withouth problem. As another example, if I try to use
 
 extension=php_curl.dll
 
 then I get an error message about libssleay32.dll not found when I try
 to stop apache. But my main problem is the php_mssql.dll extension. It
 does not throw any errors, does not log errors into (apache) logfiles,
 but it is not loaded. Please help me. My boss is killing me because I
 could not solve this problem for weeks.
 
 Thanks,
 
   Laszlo
 

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



Re: [PHP] we are looking for experienced php programmers full time freelance...

2006-04-28 Thread cajbecu



 
 $300 / hr
 8 hr minimum per day
 available 0800 - 0900EST
 


it`s a joke, right?

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



[PHP] extract text from pdf

2006-05-11 Thread cajbecu
Hello,

Is there any posibility to extract all text from a PDF file? (I have
read all the documentation about PHP PDF-Lib but no answer...)

Thanks in advance,
cajbecu

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



Re: [PHP] Is it a bug ?

2006-05-14 Thread cajbecu

$var = file (http://www.some.server.net:someport;);
then $var=explode ... bla bla..

that never crash.

cheers,
cajbecu


On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:

On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:

 ok
 this is returning the retrived data from open sockets :
 http://pastebin.com/716768

 this is returning an empty string :
 http://pastebin.com/716767


it's not a bug :)
i shoul wait for stream to be returned, i use :

while(($buff = stream_get_contents($socket[$i]))==);
echo $buff;

it takes sometime to receive stream from socket, is it the best way (dont
think so) to wait for stream ?


On 5/14/06, chris smith [EMAIL PROTECTED] wrote:
 
  On 5/14/06, Fourat Zouari [EMAIL PROTECTED] wrote:
   Code 1 :
   -
   var_dump(stream_get_contents($rr));
   -
   Output 1
   -
   string(185) HTTP/1.1 202 Accepted
   Server: Apache2
   Content-Length: 24
   Connection: close
   Content-type: text/html
   Pragma: no-cache
   Cache-Control: no-cache
  
   0: Accepted for delivery
   -
  
  
   Code 2 :
   -
   $x = stream_get_contents($rr);
   var_dump($x);
   -
   Output 2
   -
   string(0) 
   -
  
   Am i wrong ?
 
  Without seeing all of the code, we can't tell anything from that.
 
  Post it in http://pastebin.com and send us a url.
 
  --
  Postgresql  php tutorials
  http://www.designmagick.com/
 






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



Re: [PHP] What's this in my dir list?

2006-05-18 Thread cajbecu
yup, psacln is the group of the user ancientstones who`s owner of the files.

tedd wrote:
 Hi Gang:
 
 When I list one of my directories, via:
 
 echo(pre);
 system(ls -l);
 echo(/pre);
 
 I get:
 
 -rw-r--r--  1 ancientstones psacln  6980 Apr 28 18:46 ancientstones.gif
 -rw-r--r--  1 ancientstones psacln  2090 May 14 10:10 as.css
 -rw-r--r--  1 ancientstones psacln   658 May  2 14:59 big_m.php
 ...
 
 My question is, what is psacln?
 
 In all the reference material I've looked at, that column is absent. Is
 that the name for the group?
 
 Thanks.
 
 tedd

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



Re: [PHP] Getting an advanced foreach to work

2006-05-23 Thread cajbecu

this shoul work:

while ($count  count($salespersons)) {

foreach ($salespersons[$count] AS $key = $value) {

echo htmlentities($key).' - '.$value;

$count++;
}

}




On 5/23/06, Jonas Rosling [EMAIL PROTECTED] wrote:

I got the code as follows bellow. I'm having some problems to get it to
work. Maybe some of you are able to help me a bit.
First of all I got an array (salespersons) containing names of dynamic array
names. For example it can contain Johan, Mark, Jenny, Bill etc.
By calling for the possision in the array based on $count I'll get the name,
and that's the name of another array. The problem is in the foreach
with ( { } ).

$count = 0;

// Loopa så länge räknaren är mindre än storleken av arrayn $salespersons
while ($count  count($salespersons)) {

foreach (${$($salespersons[$count])} AS $key = $value) {

echo htmlentities($key).' - '.$value;

$count++;
}

}

Anyone?

Thaks // Jonas

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




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



Re: [PHP] problems with regex

2006-05-27 Thread cajbecu
Merlin wrote:
 Hi there,
 
 I am somehow lost when it comes to regex. I am trying to remove ! and ?
 characters from a string. Could somebody please help me to get a working
 regex running for that?
 
 I tried: $str = preg_replace('/\!\?\./', ' ', $str);
 
 Thank you for any help,
 
 Merlin
 


try

$str = str_replace(?, ,$str);
$str = str_replace(!, ,$str);

:)

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



Re: [PHP] Column 'movie_type_id' in order clause is ambiguous

2006-05-28 Thread cajbecu
Hello,

Try ... ORDER BY `movie`.`movie_type_id`;

Mark Sargent wrote:
 Hi All,
 
 I get this,
 
 Column 'movie_type_id' in order clause is ambiguous
 
 for this code,
 
 $query = SELECT movie.movie_name, movietypes.movie_type_label FROM
 movie, movietypes WHERE movie.movie_type_id = movietypes.movie_type_id
 AND movie_year1990 ORDER BY movie_type_id;
 $results=mysql_query($query) or die(mysql_error());
 
 and here is the table structure,
 
 mysql SELECT * FROM movie;
 +--++---++-+---+
 
 | movie_id | movie_name | movie_type_id | movie_year |
 movie_lead_actor_id | movie_director_id |
 +--++---++-+---+
 
 |1 | Bruce Almighty | 5 |   2003
 |   1 | 2 |
 |2 | Office Space   | 5 |   1999
 |   5 | 6 |
 |3 | Grand Canyon   | 2 |   1991
 |   4 | 3 |
 +--++---++-+---+
 
 3 rows in set (0.00 sec)
 
 mysql SELECT * FROM movietypes;
 +---+--+
 | movie_type_id | movie_type_label |
 +---+--+
 | 1 | Sci Fi   |
 | 2 | Drama|
 | 3 | Adventure|
 | 4 | War  |
 | 5 | Comedy   |
 | 6 | Horror   |
 | 7 | Action   |
 | 8 | Kids |
 +---+--+
 8 rows in set (0.00 sec)
 
 A Google search for the error gave nothing.
 
 Cheers.
 
 Mark Sargent.
 

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



[PHP] ob_flush() problems

2006-05-31 Thread cajbecu

Hello,

   for ($i=0; $i  10; $i++) {
   $output = ccc2;
   print pre;
   echo $output;
   print /pre;
   ob_flush();
   flush();

   sleep(1);
   }

I want to show on the browser, ccc2 (example) every 1 second, but it
shows all the text when the for stops... any ideea?

i tried all the examples from php.net, all the examples on the net,
bot no succes.

cheers,

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



Re: [PHP] Session variables and words with spaces

2006-05-31 Thread cajbecu

option value=Niagara FallsNiagara Falls/option

replace with

option value=Niagara FallsNiagara Falls/option (note the quotes)

because you will post only Niagara instead Niagara Falls

cheers,

On 5/31/06, Beauford [EMAIL PROTECTED] wrote:


Thanks - Done that though. It shows the way it should be.

Example: option value=Niagara FallsNiagara Falls/option


-Original Message-
From: Brad Bonkoski [mailto:[EMAIL PROTECTED]
Sent: May 31, 2006 2:28 PM
To: Beauford
Cc: php-general@lists.php.net
Subject: Re: [PHP] Session variables and words with spaces

Perhaps you should load up your initial form and then use the view source
option in your browser as this will probably give you insight into your
problems...
-Brad

Beauford wrote:

Hi,

I have a form in which a drop down field is populated from a MySQL
database.
I am also using sessions.

The problem is this. After I submit the form the session variable only
shows the part of the input before the space.

Example: if I choose Niagra Falls from the drop down list, then I only
see Niagra when I display it.

I'm not sure though if it is the session or the forms variable that is
causing the problem. I haven't been able to find much on this.

See code below

Thanks



session_start(  );

..Open database and connect to server...

Include(connect.inc);

!! Start of form !!

select name=province
option selected-- Select Province --/option

?

$query = select pid, location from province order by location;
$results =
mysql_query($query) or $mysqlerror = mysql_error(); if ($mysqlerror) {
   $dberror = Messed Up;
   include(index.php);
   exit;
   }

while ($line = mysql_fetch_array($results)) {
   if($line['pid'] == 1) {
   echo Option
Value=$line['location'].$line['location']./option\n;
   }
}

/select

!! Rest of Form !!




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

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




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



Re: [PHP] SMS with php recommendation (a bit 0T i guess)

2006-06-18 Thread cajbecu
http://www.clickatell.com/brochure/products/developer_solutions.php

Ryan A wrote:
 Hey,
 
 Right now I am using PSWIN to send SMS messages from
 my php scripts, can anybody recommend a (reliable)
 company that i can use instead?
 
 We fill up on 25euros everytime on pswin, so i am
 not looking for a free provider, just a reliable and
 good priced one.
 
 PSwin is good, problem is they are charging us a euro
 .20 per day just for using the service, so even if we
 dont send a single sms per day we are getting
 charged...not good. 
 
 Thanks,
 Ryan
 
 --
 - The faulty interface lies between the chair and the keyboard.
 - Creativity is great, but plagiarism is faster!
 - Smile, everyone loves a moron. :-)
 
 __
 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



Re: [PHP] STRING TO ASCII CHARACTERS

2006-06-23 Thread cajbecu
function stransform($string) {
for ($i=0;$ilength($string);$i++) {
$data .= #.ord(substr($string,$i,1)).;;
}
return $data;
}


Juanjo Pascual wrote:
 Do you know any way to convert any string to ascii characters??
 
 I mean:
 
 
 *abcdefgh*
 
 to
 
 *#97;#98;#99;#100;#101;#102;#103;#104*
 
 
 Juanjo.
 

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



Re: [PHP] STRING TO ASCII CHARACTERS

2006-06-23 Thread cajbecu
That`s true, my mistake.. (length is in pascal)

cheers,

Juanjo Pascual wrote:
 Ok. Thanks.
 
 You only have to change the function *length() *by the function *strlen()*
 
 
 cajbecu escribió:
 function stransform($string) {
  for ($i=0;$ilength($string);$i++) {
  $data .= #.ord(substr($string,$i,1)).;;
  }
 return $data;
 }


 Juanjo Pascual wrote:
   
 Do you know any way to convert any string to ascii characters??

 I mean:


 *abcdefgh*

 to

 *#97;#98;#99;#100;#101;#102;#103;#104*


 Juanjo.

 


   

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



Re: [PHP] uploading...

2006-06-26 Thread cajbecu
Please give us output of the error that mysql returns.
cheers,

BBC wrote:
 hi all...
 I have the problem about this syntax:
 
$db-query(INSERT INTO `products`

 (`code`,`size`,`description`,`material`,`ads`,`price`,`new`,`categorynr`)
VALUES
('$code',
 '$size',
 '$description',
 '$material',
 '$ads',
 '$price',
 '$new',
 '$categorynr'));
 
 the syntax above could work properly in my computer which using PHP 4.1.1
 but the problem is when I publish it the server where I hosted couldn't run 
 such syntax (server uses PHP 4.4.2
 I don't know why. is any one can help me?
 please tell me the right syntax...
 
 Best Regard
 -BBC---

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



Re: [PHP] page redirecting

2006-06-28 Thread cajbecu
If the content of that variable is secret please don`t use GET or POST
method to send it in CLEAR. beacuse somebody who know a little bit PHP
or can break your code. You can hide that by hashing it, or crypt it
with password. or something... using POST method.. of course.

kristianto adi widiatmoko wrote:
 HI folks,
 
 i need to redirecting page, it could be done by using header function like 
 this
 
 header(Location : page2.php?var1=foo);
 
 but i need to hide variable from being displayed by browser since the content 
 of variable is secret.
 
 I guess i need POST method instead of GET for redirecting that page.
 
 Does any one have an idea??
  Send instant messages to your online friends http://uk.messenger.yahoo.com 

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



[PHP] page expired - problem

2006-07-06 Thread cajbecu
Hello there,

I have an website, with a lot of buttons with onClick statement.
(onclick=document.location='page.php') The problem is that this page
is result of a search criteria (for example filtering the products with
POST method) .. Then I chose a product, click on button, and when I
click back button on the browser (Internet Explorer) it displays me:
page expired. (There are some momments when i must click twice to go
back, and i don`t know why in firefox work perfect.)
Did you had similar problems in past?

Thanks in advance,
cajbecu

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



Re: [PHP] remote fopen not working, despite allow_url_fopen = on

2007-02-15 Thread cajbecu

 Hello Aras!
 
 my /etc/resolv.conf is ok - a host google.com works and i can reach
 google.com with lynx.
 There  are  no firewall or dns issues on the server.
 

try: var_dump(file('http://ip_google/'));

replace ip_google with google`s main ip.

cajb.

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



Re: [PHP] anti-spam GD security image code validation

2007-02-21 Thread cajbecu
 
 Ok, I could store actual security code in a hidden text field of the form, 
 but then it wold be visible to spam bots, isn't it?
 Or maybe there's another way to do this?
 

it`s not very good ideea to keep the security code in a hidden text
field. keep it in a session var.

cajb.

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



Re: [PHP] Which version of phpmyadmin is stable for php 5.1.6 and FC6 System

2007-02-22 Thread cajbecu
[EMAIL PROTECTED] wrote:
 Dear All,
 
 Which version of phpmyadmin is suitable for php 5.1.6 ?
 
 Edward.
 

the latest :)

cajb.

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



Re: [PHP] phpmyadmin for FC6

2007-02-23 Thread cajbecu
[EMAIL PROTECTED] wrote:
 Dear All,
 
 Which version of phpMyadmin are you using with FC6 ?
 
 Edward.
 

Always the latest.

cajb.

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



Re: [PHP] db query not working as expected

2007-03-07 Thread cajbecu
try:

mysql_query (INSERT INTO tmphitsmag (magazine) VALUES
   ('{$magazine_path[2]}'));

cajb.

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



Re: [PHP] syntax question

2007-03-26 Thread cajbecu
Ross wrote:
 Can I put post values directly into insert statements?
 
 $query = INSERT INTO categories (category_name) VALUES 
 ('$_POST['cat_name']); 
 

Yes you can, but it is not secure to do that!

use (insecure):

$query = INSERT INTO categories (category_name) VALUES
('{$_POST['cat_name']}');

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



Re: [PHP] What is wrong with this INSERT?

2007-03-29 Thread cajbecu
are you sure $_POST['Submit'] is set? i mean, do you have an input named
Submit that is set in your form?

Rahul Sitaram Johari wrote:
 Ave,
 
 Does anyone know what I¹m doing wrong?
 
 ?php
 //Add Record Function
 if($_POST['Submit']) {
 $db = mysql_connect(localhost,usr,pwd);
 mysql_select_db(thedb,$db) or die(Critical Error :.mysql_error());
 $WHEN = date(mdyHi);
 $WHAT = $_POST['WHAT'];
 $WHO = $_POST['WHO'];
 echo SPAN CLASS='BlackText'$WHEN, $WHAT, $WHO/SPANbr;

 mysql_query(INSERT INTO tbl (WHEN, WHAT, WHO) VALUES
 ('$WHEN','$WHAT','$WHO');
 $result = mysql_query($sql) or die(Fatal Error :.mysql_error());
 echo span class='SmallText'EMSTRONG~: message sent
 :~/STRONG/EM/spanBRBR;
 }
 ?
 
 I have a form which is sending POST data. Everything is working fine to this
 statement: echo SPAN CLASS='BlackText'$WHEN, $WHAT, $WHO/SPANbr;
 
 It is displaying POST data appropriately. It¹s just not Adding Records to
 the Database! It¹s not giving any Errors!! This is not working:
 mysql_query(INSERT INTO tbl (WHEN, WHAT, WHO) VALUES
 ('$WHEN','$WHAT','$WHO');
 $result = mysql_query($sql) or die(Fatal Error :.mysql_error());
 echo span class='SmallText'EMSTRONG~: message sent
 :~/STRONG/EM/spanBRBR;
 
 Yes ­ tablename is fine
 Yes ­ Fieldnames are fine ­ Connection is fine!
 I¹ve double checked all these things. I¹m not getting any errors ­ it¹s just
 not executing the INSERT for some reason!!!
 
 HELP!
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 
 

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



Re: [PHP] What is wrong with this INSERT?

2007-03-29 Thread cajbecu
Angelo Zanetti wrote:
 $result = mysql_query($sql) or die(Fatal Error :.mysql_error());
 
 where do you define $sql?
 

or that...

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



Re: [PHP] Form Handler Script Security Discussion

2007-03-29 Thread cajbecu
 
 ?
if($_POST  eregi(getenv(SERVER_NAME),getenv(HTTP_REFERER))) {
// This is a safe POST
} elseif(!eregi(getenv(SERVER_NAME),getenv(HTTP_REFERER))) {
die(Illegal access.  Your IP has been logged.\n);
}
 ?
 

it is not safe. i can use curl (www.php.net/curl) and modify the referer
of my script to pass this security check. i advise you to add image code
to the form and check that in your script. that will stop the attackers
insert lot of data in your database.

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



Re: [PHP] Form Handler Script Security Discussion

2007-03-29 Thread cajbecu
 
 And even then, some smart programmers are probably going to find a way
 to read your image code :)
 

that, of course, if your app will be an interface to client`s bank
account, with online management. :)

cajb.

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



Re: [PHP] Problems with mail

2007-04-02 Thread cajbecu
Mário Gamito wrote:
 Hi,
 
 I have this very straight forward code to send an e-mail:
 
 $subject_users_subscription_confirmation = Subscription confirmation;
 $message_users_subscription_confirmation = 'Please, click this link to
 confirm your subscritpion:
 http://www.telbit.pt/subscribe-confirm.php?email=' . $email . 'conf=' .
 $barfles;
 
 mail($email, $subject_users_subscription_confirmation,
 $message_users_subscription_confirmation);
 

try:

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


(change simple quote: ' with double quote:  )

cajb.

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



Re: [PHP] php-mysql problem

2007-04-03 Thread cajbecu
clive wrote:
 Me2resh Lists wrote:
 the query is :
$SQL = SELECT DISTINCT(EMail) FROM mena_guests WHERE Voted = 'yes'
 LIMIT $startingID,$items_numbers_list;
 
 the only php I see it $SQL,$startingID,$items_numbers_list. This is a
 mysql question.
 

so, you don`t know the answer, right?

cajb.

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



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

2007-05-12 Thread cajbecu

Hello,

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

cajb.

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