php-general Digest 10 Sep 2004 09:43:57 -0000 Issue 2987

Topics (messages 196265 through 196283):

Problem with the code
        196265 by: Mulley, Nikhil

Re: Users of RDBMS
        196266 by: Mulley, Nikhil

Re: Assigning one var to multiple vars
        196267 by: Matthew Sims
        196272 by: Curt Zirzow

image size?
        196268 by: Ed Lazor
        196274 by: Paul Birnstihl
        196275 by: Ed Lazor
        196276 by: Paul Birnstihl
        196277 by: Jason Wong
        196278 by: Tom Rogers

preg_replace question
        196269 by: Zoran Lorkovic
        196273 by: John Holmes

Re: stdin buffering
        196270 by: Martin Holm

"no-store" and "no-cache" = no files in browser"s cache ?
        196271 by: Bart Coninckx

imap and multipart
        196279 by: Maxime Thonon

Re: open_basedir restriction in effect., help
        196280 by: Louie Miranda
        196281 by: Marek Kilimajer

help-fetching-url-contents
        196282 by: vijayaraj nagarajan

find quoted string within a string (more of a regex question, though ..)
        196283 by: Wouter van Vliet

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi All,
 
I have a problem...with my code ,can any one please guide or correct me.
 
[BLUE]
My main aim is to develop a php(or php in html) ,in which Login is there ,after 
appropriate login ,User must get the 
Option of selecting available databases ,Upon selecting databases,user must get to 
select the appropriate tabl from Selected database,
 
Can I have that code.
Please do the needful.
[BLUE]
Please find the questions in blue format ....
authenticate.php (should be login.php no probs but)
 
<?php
include("phpscripts/draw_table.php");
$hostname="xxx";
$usrname=$_POST['username'];
$usrname="root";
$pswd=$_POST['password'];
$db_selected;
$db_list;
$row;
$dbconnlink=mysql_connect($hostname,$usrname,$pswd);
 if($dbconnlink) {
  echo "<h4><b>Connected to the MYSQL Server :  $hostname </b><h4><br>";
  $db_list = mysql_list_dbs($dbconnlink);
  echo "<h4>The Databases available in $hostname are :</h4>";
  while ($GLOBALS["row"]  = mysql_fetch_object($db_list)) {
//     echo $row->Database . "\n";
  echo  "<form METHOD=\"POST\" action=<?php show_table($row->Database); ?><p>
<input type=\"radio\" name=\"Database_Selection\" value=\"$row\"> $row->Database
  </p>
 [BLUE] I am listing the available databases here present in the mysql server 'xxx'
I want the user to select the database available ,upon the submit of selection of 
database,User must be able to see the available tables in that selected database
Again in the same format of Radio Options to select the table,He must be able to 
select the table,Upon selecting particular available table,he must be able to see the 
Values in it.
[BLUE]
<br>" ;
  echo "Testing";
  $selectcat=$row["category"];
  echo "<option value=\"$selectcat\">$selectcat</option> <br>";
 
  //To List all the Databases present in $hostname
  }
echo    "<BR><INPUT TYPE=\"reset\" VALUE=\"Clear\">
<INPUT TYPE=\"submit\" VALUE=\"Select\">  ";
[BLUE]Can I have here to put the value as dynamic database.[/BLUE]

  mysql_free_result($row);
 } else {
  echo "<b>Error :  ".mysql_error()."</b><br>"."<b>
  <pre>
Go Back and type the Exact User ID and Password   Which mySQL Admininistrator Gave You,
  
 
if not available,Please contact <a href = \"[EMAIL PROTECTED] [EMAIL PROTECTED] 
<mailto:[EMAIL PROTECTED]> 
</pre>
  <script language=\"javascript\">
  javascript.alert(\"Go Back and type the Login Information Correctly\");
  </script>
  <br>
  </b>";
 }
function show_table() {
 $tableselected='';
 $tableselected= $_POST[$row->Database];
}
 
?>
Thanks,
Nikhil.

--- End Message ---
--- Begin Message ---
You can create user from mysql prompt by connecting it through first
cmd>mysql -h host -u userid -p instance
password : ******
then type
GRANT ALL PRIVILGES ON *.* TO 'newuser'@'host'
IDENTIFIED BY 'password' with GRANT OPTION;
where newuser is new users id and host may be either localhost or any other host,if 
you want to add that user to connect from any host then replace 'host' with '%'
with single quotes.
and password is new users password.
Regards
Nikhil

-----Original Message-----
From: Victor Salda�a D. [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 1:03 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Users of RDBMS


On Wed, 8 Sep 2004 12:01:55 -0700 (PDT), Pahlevanzadeh Mohsen
<[EMAIL PROTECTED]> wrote:
> Dears,
> I need to create user for MySQL.
> Please guide me......

Please RTFM

http://dev.mysql.com/doc/mysql/en/Adding_users.html

--
Victor Salda�a D.

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

--- End Message ---
--- Begin Message ---
> How about:
>
> <?
> $var1 = $var2 = $var3 = 5;
> echo $var1 . '<br/>' . $var2 . '<br/>' . $var3 . '<br/>';
> ?>
>
> Regards,
>
> Justin
>

I had something stuck in my head between what Python does and PHP's list
function. Not sure why I couldn't figure this one out. Thanks all.

-- 
--Matthew Sims
--<http://killermookie.org>

--- End Message ---
--- Begin Message ---
* Thus wrote Jason Davidson:
> $var2 = $var3 = $var5 = "all the same";
or

$var2 =
$var3
= $var5
=
"all the same";



Curt
-- 
The above comments may offend you. flame at will.

--- End Message ---
--- Begin Message ---
Is there a way to get the size of an image created using the imagecreate
function?

 

The PHP manual section on image functions mentions getimagesize, but that
only works on remote or local files.

 

Thanks, 

 

Ed

 

 


--- End Message ---
--- Begin Message --- Ed Lazor wrote:
Is there a way to get the size of an image created using the imagecreate
function?

I'm guessing it would be xsize x ysize x colour depth = size in bits ?

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> Ed Lazor wrote:
> > Is there a way to get the size of an image created using the imagecreate
> > function?
> 
> I'm guessing it would be xsize x ysize x colour depth = size in bits ?

What's the default color depth?

-Ed

--- End Message ---
--- Begin Message --- Ed Lazor wrote:
-----Original Message-----
Ed Lazor wrote:

Is there a way to get the size of an image created using the imagecreate
function?

I'm guessing it would be xsize x ysize x colour depth = size in bits ?


What's the default color depth?

-Ed

It looks to me like it's 8bit for imagecreate and maybe 24bit for imagecreatetruecolor ? Does anyone else know about this for certain ?

--- End Message ---
--- Begin Message ---
On Friday 10 September 2004 06:59, Ed Lazor wrote:
> Is there a way to get the size of an image created using the imagecreate
> function?

Size as in ... ?

You do realise that *you* specify the size when using imagecreate()?

> The PHP manual section on image functions mentions getimagesize, but that
> only works on remote or local files.

getimagesize() would not give you any info you don't already know when using 
imagecreate().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Everything ends badly.  Otherwise it wouldn't end.
*/

--- End Message ---
--- Begin Message ---
Hi,

Friday, September 10, 2004, 8:59:30 AM, you wrote:
EL> Is there a way to get the size of an image created using the imagecreate
EL> function?
EL> The PHP manual section on image functions mentions getimagesize, but that
EL> only works on remote or local files.
EL> Thanks,
EL> Ed

Something like this may work if your after the output image size

<?
function jpeg_image_size($im,$quality){
  ob_start();
  imagejpeg($im,'',$quality);
  $str = ob_get_clean();
  return strlen($str);
}

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
Hi

Sorry for issuing this again, but I need help with preg_replace. I manage to replace 
certain text between <b></b> in text with preg_replace but I want for every other 
<b></b> to be replaced by other text.
By this I mean when some text between <b></b> has been found that text is replaced 
with some Text, on second match, text between <b></b> is replaced by some other 
different text etc.

Btw, where I can find patterns that are valid?
(something like (\w+), (\d+)+i etc.

Thanks.
Regards.
Zoran

--- End Message ---
--- Begin Message ---
Zoran Lorkovic wrote:

Sorry for issuing this again, but I need help with preg_replace. I manage to replace certain text between 
<b></b> in text with preg_replace but I want for every other <b></b> to be replaced by 
other text.
By this I mean when some text between <b></b> has been found that text is replaced with some Text, 
on second match, text between <b></b> is replaced by some other different text etc.

Btw, where I can find patterns that are valid?
(something like (\w+), (\d+)+i etc.

Use preg_replace_callback() with a static variable within the callback function. Increment the variable each time the function is called and then based upon whether it's odd or even, substitute the appropriate string.


--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Greg Donald wrote:

On Thu, 2004-09-09 at 15:25, Jim Grill wrote:


exec("stty -icanon min 0 time 0");



Nice.

I suspect 'phpSnake' will appear on freshmeat in a couple days.

:)




thats more or less what we are trying to do. =)
pong as a start at least.

doing it all over again, this time php-style.
--- End Message ---
--- Begin Message ---
Hi!

Am I assuming correctly that if you add this in the beginning of a PHP 
page
that the browser will not store files for that page to its cache?

<?php
    header('Cache-Control: no-store, no-cache, must-revalidate'); //
HTTP/1.1
    header('Cache-Control: post-check=0, pre-check=0'); // damnable IE5
    header('Expires: Wed, 16 Nov 1977 10:00:00 CET');   // date in past
    header('Last-Modified: '.date('r'));                // right -now-
    header('Pragma: no-cache');                         // HTTP/1.0
?>


I tried it, but the sensitive files I want to avoid from being available 
on
the client's harddrive, still get downloaded and saved in the "Temporary
Internet Files" for IE6. I also tried Mozilla, but I see changes in the
cache as well.


Comments would be greatly appreciated!
Thx!

Bart

--- End Message ---
--- Begin Message ---
hello,

i work with imap and php to make a webmail. it works fine but i have a
big problem with some mails, those who contains a multipart into a
multipart. it happends with outlook express who puts into a mutlipart
the text and html version of the text into the first part of the mail.
an other case is when i forward a mail, the whole mail is fully
contained into a part of the mail. the problem is that with the imap
commands i cannot access into these parts to retrieve their contents. if
someone could help me !

thx

        --maxime--

--- End Message ---
--- Begin Message ---
Warning: main(): open_basedir restriction in effect.
File(/home/mainwww/www/sysfolder/pear/Pager/Pager.php) is not within
the allowed path(s):
(/home/axishift/:/usr/lib/php:/usr/local/lib/php:/tmp) in
/home/axishift/public_html/pageApps/viewMessage.php on line 11

Hi, what is open_basedir? my host is on a cpanel machine..

-- 
Louie Miranda
http://www.axishift.com

--- End Message ---
--- Begin Message --- Louie Miranda wrote:
Warning: main(): open_basedir restriction in effect.
File(/home/mainwww/www/sysfolder/pear/Pager/Pager.php) is not within
the allowed path(s):
(/home/axishift/:/usr/lib/php:/usr/local/lib/php:/tmp) in
/home/axishift/public_html/pageApps/viewMessage.php on line 11

Hi, what is open_basedir? my host is on a cpanel machine..


http://sk.php.net/features.safe-mode#ini.open-basedir

basicly you cannot open any file outside of the listed directories. How are you including the file? Are you using full path? Pear might be also installed in /usr/lib/php or /usr/local/lib/php.
--- End Message ---
--- Begin Message ---
hi all
i would like to fetch the content of a url. 
and then would like to put in my page... dynamically
refreshing it once in a day...

is it possible to do this in php.
i have used perl get url option and then parse the
file, with the date and time function...to do this.

pls help.
thanks in advance
vijay


                
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

--- End Message ---
--- Begin Message ---
Howdy,

Thanks for the answers on my previous question, though it hasn't
resulted in a quicker dirparsing.. Anyway, here's a next one.

For my own reasons (can explain, would take long, won't till sbody
asks) I want to match a quoted string within a string. That is somehow
kind of easy, I know ... if it weren't for the slashing of quotes.
I've set up a regex that will nearly do the trick and now I'm looking
for an enhancement (or replacement) that will work in all cases.
Here's the code I use:

<?php
$str    = "the quick \"brown fox ' jumps \' over \\\\\"the ' lazy \"dog";
print "Test String: $str\n";

$regex = '/(
                        ([\'"])
                        .*?
                        (
                                (?<!\\\\)
                                \\2)
                        )/x';

print "Regex to use: $regex\n";

preg_match($regex, $str, $m);
print_r($m);
?>
(x modifier allows whitespaces in the regex).

When run, it produces the following output:

[output]
Test String: the quick "brown fox ' jumps \' over \\"the ' lazy "dog
Regex to use: /(
                        (['"])
                        .*?
                        (
                                (?<!\\)
                                \2)
                        )/x
Array
(
    [0] => "brown fox ' jumps \' over \\"the ' lazy "
    [1] => "brown fox ' jumps \' over \\"the ' lazy "
    [2] => "
    [3] => "
)
[/output]

basically, I think that I'll need to change the assertion (?<!\\) to
match only odd numbers of slashes - but I don't know how to do it. Who
does?

Thanks,
Wouter

--- End Message ---

Reply via email to