php-general Digest 15 Mar 2003 21:51:12 -0000 Issue 1940

Topics (messages 139791 through 139810):

Re: need a new challenge
        139791 by: Dominik Werder

How to write a module for php?
        139792 by: hzqbbc

Re: str_replace
        139793 by: Jason Sheets
        139805 by: Sebastian

SMTP Authenticate
        139794 by: Aitor Cabrera
        139795 by: Manuel Lemos
        139798 by: Bobby Patel

Do query strings get spidered by Google?
        139796 by: Mike Hillyer
        139799 by: Alexandru COSTIN
        139800 by: olinux

List tables
        139797 by: shaun
        139809 by: Joel Colombo

How to convert an array to variables?
        139801 by: Charles Kline
        139803 by: Tom Rogers

Wrox no more?
        139802 by: kaemaril.btinternet.com
        139810 by: Alexandru COSTIN

Re: Persistent values between executions
        139804 by: Lance Lovette

Performance and Function Calls
        139806 by: CF High

PHP User Groups
        139807 by: Charles Kline
        139808 by: John W. Holmes

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 Chris (and all others),

This seems to me a very common "problem". I managed it too with different approaches including complete on the fly code generation, but I don't think that I have already the perfect solution.
Does anyone have more information on this topic?


bye!
Dominik

Metatable
Suppose you've got one db table (meta-table) desribing the content of various other tables, for instance
ID
tablename
fieldname
fieldtype [integer|textarea|choicelist|link_to_other_table|....]
default_value
permissions
The easy part: make an interface so people can design their own db table, the description of every field goes into the metatable and the field is added to the datatable it refers to. With templates one can now quickly make show/edit/add/overview pages. I managed that.
Now I want to have choice lists that come from new tables. For instance: with this system they made a table
person (gender, name, etc), now i want to add a choice list of institutions, where the institutions are in another table (institute name, address, etc). Doing this directly is easier than doing it via this extra table. Let them use a class?

--- End Message ---
--- Begin Message ---
Hi all: 

 I want to write a small module for php and reduce some overhead while doingthe same 
job with PHP scripts. 

 But i'm new to php dev, and even don't konw about the archtecture of phpmodule.. So 
could anybody tell me where and how to get help to write a smallmodule? 

 Is there any sample of module exist the list or php.net? 

 Thanks a lot ~ :-) 


--- End Message ---
--- Begin Message ---
You could put logic in your header and footer file not to display output
if $_GET['action'] == 'print'.

Jason
On Fri, 2003-03-14 at 23:23, Sebastian wrote:
> doesn't work but also doesn't give any errors, I will try to explain what I
> am trying to do:
> 
> I am trying to remove the header and footer to create a "printer friendly
> page" with just the content, here's what my pages look like, I need to
> remove header and footer when they visit: file.php?action=print
> 
> <?php
> include("../config.php");
> 
> if($_GET[action] == "print")
> {
>    $header = str_replace('include("$header");', '', $header);
>    $footer = str_replace('include("$footer");', '', $footer);
> }
> 
> include("$header");
> ?>
> 
> // html
> 
> <?php include("$footer"); ?>
> 
> cheers,
> - Sebastian
> 
> ----- Original Message -----
> From: "John Gray" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, March 15, 2003 12:31 AM
> Subject: [PHP] Re: str_replace
> 
> 
> | $footer = str_replace('include("$header");', '', $footer);
> |
> | The way you have it now, you're telling PHP to first include the file
> | named by the variable $header, then do an str_replace on the result; but
> | the parser is going to fail on that first semi-colon, and that's not
> | what you want to do anyway (as I understand it). Put the line you want
> | to replace inside single quotes (as above) and PHP won't attempt to
> | parse it, it'll just treat it as a string literal. Hope this helps, hope
> | it makes sense.
> |
> | - john
> |
> | Sebastian wrote:
> | > This may seem weird:
> | >
> | > How do I str_replace an include function?
> | >
> | > I want to replace this line: include("$header");
> | >
> | > with nothing ..
> | >
> | > something like this:
> | >
> | > $footer = str_replace(" '. include("$header"); .' ", "", $footer);
> | >
> | > I get errors, any ideas?
> | >
> | > cheers,
> | > - Sebastian
-- 
Jason Sheets <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message ---
Thank you, that seems to work fairly well :)

cheers,
- Sebastian

----- Original Message -----
From: "Ernest E Vogelsinger"


| At 07:23 15.03.2003, Sebastian said:
| --------------------[snip]--------------------
| >doesn't work but also doesn't give any errors, I will try to explain what
I
| >am trying to do:
| >
| >I am trying to remove the header and footer to create a "printer friendly
| >page" with just the content, here's what my pages look like, I need to
| >remove header and footer when they visit: file.php?action=print
| >
| ><?php
| >include("../config.php");
| >
| >if($_GET[action] == "print")
| >{
| >   $header = str_replace('include("$header");', '', $header);
| >   $footer = str_replace('include("$footer");', '', $footer);
| >}
| >
| >include("$header");
| >?>
| >
| >// html
| >
| ><?php include("$footer"); ?>
| --------------------[snip]--------------------
|
| Hmm - can't work because the variable "$header" doesn't include the string
| "include("$header");".
|
| Try it this way:
|
| <?php
| include("../config.php");
|
| if($_GET[action] == "print") {
|   $header = null;
|   $footer = null;
| }
|
| if ($header) include($header);
| ?>
|
| // html
|
| <?php if ($footer) include($footer); ?>
|
|
| --
|    >O     Ernest E. Vogelsinger
|    (\)    ICQ #13394035
|     ^     http://www.vogelsinger.at/
|
|


--- End Message ---
--- Begin Message ---
Hi, I'm trying to use the mail() funtion but I can only use this funtion the email 
myself (the same email that I put in the php.ini file). I f I try to email someone 
else I get an error 

530 delivery not allowed to non-local recipient, try authenticating -7

How can I authenticate myselft? Which is the SMTP comand to do it and how do I use it? 
Thanks!!

--- End Message ---
--- Begin Message --- Hello,

On 03/15/2003 01:43 PM, Aitor Cabrera wrote:
Hi, I'm trying to use the mail() funtion but I can only use this funtion the email myself (the same email that I put in the php.ini file). I f I try to email someone else I get an error

530 delivery not allowed to non-local recipient, try authenticating -7

How can I authenticate myselft? Which is the SMTP comand to do it and how do I use it? Thanks!!

mail() does not support authentication. You may want to try this class that lets you specify the authentication credentials and comes with a wrapper function named smtp_mail() that sends the message to a SMTP server that you specify:


http://www.phpclasses.org/mimemessage

You also need this class to do the actual SMTP delivery:

http://www.phpclasses.org/smtpclass


--


Regards,
Manuel Lemos


--- End Message ---
--- Begin Message ---
There is another php mailer class which  is really good (and includes
authentication among alot of other things).
http://phpmailer.sourceforge.net

"Aitor Cabrera" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi, I'm trying to use the mail() funtion but I can only use this funtion the
email myself (the same email that I put in the php.ini file). I f I try to
email someone else I get an error

530 delivery not allowed to non-local recipient, try authenticating -7

How can I authenticate myselft? Which is the SMTP comand to do it and how do
I use it? Thanks!!



--- End Message ---
--- Begin Message ---
Hi All;

I am trying to decide how to lay out a site with a lot of articles, and I am
wondering if query strings get spidered by Google. I was thinking it would
make for an easy search engine if I could put the articles in fulltext
searchable MySQL columns, but I do not want to lose the ability of search
engines to spider them. Otherwise, I believe there is a way to convert the
quert string to a trailing / so it looks like directory structure, does
anyone have info on that?

Thanks,
Mike Hillyer


--- End Message ---
--- Begin Message ---
    Hi,
    Dynamic queries are googled as far as I know (*old* search engines
probably didn't do this).
    Search InterAKT and you'll see that we have all the pages indexed - and
our site is completely dynamic. (index.php?page=4_5, etc)

                Alexandru

--
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 411 2610
"Mike Hillyer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All;
>
> I am trying to decide how to lay out a site with a lot of articles, and I
am
> wondering if query strings get spidered by Google. I was thinking it would
> make for an easy search engine if I could put the articles in fulltext
> searchable MySQL columns, but I do not want to lose the ability of search
> engines to spider them. Otherwise, I believe there is a way to convert the
> quert string to a trailing / so it looks like directory structure, does
> anyone have info on that?
>
> Thanks,
> Mike Hillyer
>



--- End Message ---
--- Begin Message ---
A better solution - make your pages look like static
html pages:

Search Engine Friendly PHP Pages
http://zend.com/zend/spotlight/searchengine.php

Search Engine-Friendly URLs
http://www.sitepoint.com/article/485

How can I pass variables to a script in the url like
/script/var1/var2?
How can I pass variables in a form that won't scare
off search engines?
http://www.faqts.com/knowledge_base/view.phtml/aid/124

Apache ForceType Docs
http://www.apache.org/docs/mod/mod_mime.html#forcetype

I even add a ".htm" to the article id and then do a 
str_replace().

Remember to make sure that you are doing some type of
validation of the data that is being passed via the
URL.

olinux


--- Mike Hillyer <[EMAIL PROTECTED]> wrote:
> Hi All;
> 
> I am trying to decide how to lay out a site with a
> lot of articles, and I am
> wondering if query strings get spidered by Google. I
> was thinking it would
> make for an easy search engine if I could put the
> articles in fulltext
> searchable MySQL columns, but I do not want to lose
> the ability of search
> engines to spider them. Otherwise, I believe there
> is a way to convert the
> quert string to a trailing / so it looks like
> directory structure, does
> anyone have info on that?
> 
> Thanks,
> Mike Hillyer
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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

i would like to list all of the tables and field names in my database

e.g.

table 1
  field 1
  field 2
  field 3
table 2
  field 1
  field 2
  field 3
table 3
  field 1
  field 2
  field 3
etc

is there a simple way to do this?

thanks for your help



--- End Message ---
--- Begin Message ---
duplicate POST from php.db


"Shaun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> i would like to list all of the tables and field names in my database
>
> e.g.
>
> table 1
>   field 1
>   field 2
>   field 3
> table 2
>   field 1
>   field 2
>   field 3
> table 3
>   field 1
>   field 2
>   field 3
> etc
>
> is there a simple way to do this?
>
> thanks for your help
>
>



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

I have an array that gives me this when I do:

print_r($my_array);

Array
(
    [0] => Array
        (
            [dra_id] => 5
        )

    [1] => Array
        (
            [dra_id] => 8
        )

    [2] => Array
        (
            [dra_id] => 9
        )

)

using a foreach() I want to create a variable with a unique incremental name for each of the values.

for example:

$dra_1 = 5;
$dra_2 = 8;
$dra_3 = 9;

How would I do this? A variable that has a variable name based on a counter in the loop? Not sure the syntax for that.

Thanks
Charles





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

Sunday, March 16, 2003, 4:52:10 AM, you wrote:
CK> Hi all,

CK> I have an array that gives me this when I do:

CK> print_r($my_array);

CK> Array
CK> (
CK>      [0] => Array
CK>          (
CK>              [dra_id] => 5
CK>          )

CK>      [1] => Array
CK>          (
CK>              [dra_id] => 8
CK>          )

CK>      [2] => Array
CK>          (
CK>              [dra_id] => 9
CK>          )

CK> )

CK> using a foreach() I want to create a variable with a unique incremental 
CK> name for each of the values.

CK> for example:

CK> $dra_1 = 5;
CK> $dra_2 = 8;
CK> $dra_3 = 9;

CK> How would I do this? A variable that has a variable name based on a 
CK> counter in the loop? Not sure the syntax for that.

CK> Thanks
CK> Charles

something like this...

while(list($key,$val) = each($my_array)){
        $n = 'dra_'.$key+1;
        $$n = $val['dra_id'];
}





-- 
regards,
Tom


--- End Message ---
--- Begin Message ---
With the apparent very sad demise of Wrox (http://www.webstandards.org/
for details. This has also been reported on the webdesign list, although
the Wrox website itself doesn't seem to have anything) does anyone know
if "PHP MySQL Website Programming Problem-Design-Solution" will be
published?

According to their site it was due in "March", Amazon.com reports March
21, and Amazon.co.uk reports March 11th. Did it "get out of the door" in
time?

It would seem that Glasshaus are also gone (http://www.glasshaus.com/
for details) :(

Glasshaus & Wrox did good books, I thought. I'm sure they'll be greatly
missed, assuming they're not bought by anyone, or some other sort of
miracle can be arranged...

- Kaemaril.




--- End Message ---
--- Begin Message ---
This is a sad day, indeed.

It seems that web developers tend to skip reading books to improve
knowledge, and rely on web/google/this newsgroup, etc


Alexandru

--
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 411 2610

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
With the apparent very sad demise of Wrox (http://www.webstandards.org/
for details. This has also been reported on the webdesign list, although
the Wrox website itself doesn't seem to have anything) does anyone know
if "PHP MySQL Website Programming Problem-Design-Solution" will be
published?

According to their site it was due in "March", Amazon.com reports March
21, and Amazon.co.uk reports March 11th. Did it "get out of the door" in
time?

It would seem that Glasshaus are also gone (http://www.glasshaus.com/
for details) :(

Glasshaus & Wrox did good books, I thought. I'm sure they'll be greatly
missed, assuming they're not bought by anyone, or some other sort of
miracle can be arranged...

- Kaemaril.





--- End Message ---
--- Begin Message ---
The most efficient way to solve your problem is with a PHP extension I
developed. It handles constants and provides a type of persistent variable
too. It has been immensely useful for my projects.

http://pwee.sourceforge.net/

Lance

> -----Original Message-----
> From: Mike Mannakee [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 10, 2003 11:30 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Persistent values between executions
>
>
> I have some sets of values that I have stored in several tables in a mySQL
> database.  These don't often change, but are referenced on every
> single page
> view.  While each call is quick, as a gross the load on the server is too
> high.  I would like to know if there is a way to have these sets of values
> remain persistent in the server's memory between calls from browsers, like
> environment variables, to reduce the back and forth calls to
> mySQL.  As the
> data from the calls are almost always the same, it would seem easier this
> way.
>
> Any thoughts?  Comments?  RTFM suggestions?
>
> Mike
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Hey all.

Quick question:

If I have a function that, say, prints out the months in a year, and I call
that function within a 10 cycle loop, which of the following is faster:

    1) Have function months() return months as a string; set var
string_months = months() outside of the loop; then echo string_months within
the loop

    -- OR

    2) Just call months() for each iteration through the loop

I'm not sure how PHP interprets option number 1.

Guidance for the clueless much appreciated...........

--Noah

--




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

Is or has anyone here been part of or started a PHP user group? I am thinking it would be a great thing to get started in my area (maybe one already exists?) and I was looking for suggestions on how to go about it and things to know before getting started, etc.
BTW. I live in Southern New Jersey (USA)


Please feel free to contact me off list.

Thanks,
Charles


--- End Message ---
--- Begin Message ---
> Is or has anyone here been part of or started a PHP user group? I am
> thinking it would be a great thing to get started in my area (maybe
one
> already exists?) and I was looking for suggestions on how to go about
> it and things to know before getting started, etc.
> BTW. I live in Southern New Jersey (USA)

Check http://php.meetup.com/ for your area.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



--- End Message ---

Reply via email to