Re: php-general Digest 5 Sep 2017 20:59:01 -0000 Issue 9316

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> <script src="login.js" type="text/javascript">
> Is there a way I can reuse my JS file and still have embedded PHP in it?

What I do is create a file "login_js.php". Then:
<script src="login_js.php" type="text/javascript">

Only except if your web browser objects to a file expecting type
text/javascript but has a file extension other than 'js', then the web
server will have PHP run this script and then deliver it to the client.


On Tue, Sep 5, 2017 at 1:59 PM, <php-general-digest-help@xxxxxxxxxxxxx>
wrote:

>
> php-general Digest 5 Sep 2017 20:59:01 -0000 Issue 9316
>
> Topics (messages 326200 through 326202):
>
> Re: PECL Mongo 1.6.15 - PHP Fatal error: Class 'Mongo' not found
>         326200 by: Poil
>         326201 by: Frank Arensmeier
>
> Including JS code that uses PHP
>         326202 by: Larry Martell
>
> Administrivia:
>
> To subscribe to the digest, e-mail:
>         php-general-digest-subscribe@xxxxxxxxxxxxx
>
> To unsubscribe from the digest, e-mail:
>         php-general-digest-unsubscribe@xxxxxxxxxxxxx
>
> To post to the list, e-mail:
>         php-general@xxxxxxxxxxxxx
>
>
> ----------------------------------------------------------------------
>
>
> ---------- Forwarded message ----------
> From: Poil <poil@xxxxxxxx>
> To: PHP General <php-general@xxxxxxxxxxxxx>
> Cc:
> Bcc:
> Date: Mon, 4 Sep 2017 21:33:17 +0200
> Subject: Re:  PECL Mongo 1.6.15 - PHP Fatal error: Class 'Mongo' not
> found
> When running on CLI, I have got this error
>
> PHP Warning:  PHP Startup: Unable to load dynamic library
> '/usr/lib/php5/20121212/mongo.so' - /usr/lib/php5/20121212/mongo.so:
> undefined symbol: php_mongo_matches_san_list in Unknown on line 0
>
>
> Le 04/09/2017 à 21:31, Poil a écrit :
>
>> Hi,
>>
>> When running mongo PECL library 1.6.15 I have this error. " Class 'Mongo'
>> not found  in ....."
>>
>> Rollbacking to 1.6.14 all is working fine.
>>
>> Anyone with the same issue ? (Ubuntu 14.04 - PHP 5.5.9-1ubuntu4.14)
>>
>> Best regards,
>>
>>
>>
>
>
> ---------- Forwarded message ----------
> From: Frank Arensmeier <farensmeier@xxxxxxxxx>
> To: Poil <poil@xxxxxxxx>
> Cc: PHP General <php-general@xxxxxxxxxxxxx>
> Bcc:
> Date: Tue, 5 Sep 2017 08:16:39 +0200
> Subject: Re:  PECL Mongo 1.6.15 - PHP Fatal error: Class 'Mongo' not
> found
>
> > 4 sep. 2017 kl. 21:33 skrev Poil <poil@xxxxxxxx>:
> >
> > When running on CLI, I have got this error
> >
> > PHP Warning:  PHP Startup: Unable to load dynamic library
> '/usr/lib/php5/20121212/mongo.so' - /usr/lib/php5/20121212/mongo.so:
> undefined symbol: php_mongo_matches_san_list in Unknown on line 0
> >
> >
> > Le 04/09/2017 à 21:31, Poil a écrit :
> >> Hi,
> >>
> >> When running mongo PECL library 1.6.15 I have this error. " Class
> 'Mongo' not found  in ....."
> >>
> >> Rollbacking to 1.6.14 all is working fine.
> >>
> >> Anyone with the same issue ? (Ubuntu 14.04 - PHP 5.5.9-1ubuntu4.14)
> >>
> >> Best regards,
> >>
> >>
>
> Hi.
>
> Actually, I have no idea. But it seems that the PECL mongo driver is no
> longer supported / actively developed. From mongodb.com:
>
> "The mongo extension available from PECL is an older, legacy driver for
> PHP 5.x. The mongo extension is no longer maintained and new projects are
> advised to use the mongodb extension and PHP library. A community-developed
> Mongo PHP Adapter project implements the legacy mongo extension’s API using
> the new mongodb extension and PHP library, which may be useful for those
> wishing to migrate existing applications."
>
> If you are stuck with PHP 5.5, maybe you could try the mongo-db-adapter (
> https://github.com/alcaeus/mongo-php-adapter <https://github.com/alcaeus/
> mongo-php-adapter>)?
>
> Regards,
> Frank
>
> ---------- Forwarded message ----------
> From: Larry Martell <larry.martell@xxxxxxxxx>
> To: PHP General <php-general@xxxxxxxxxxxxx>
> Cc:
> Bcc:
> Date: Tue, 5 Sep 2017 16:58:16 -0400
> Subject: Including JS code that uses PHP
> I have some javascript code that has PHP in it like this:
>
> var CLIENT_ID='<?php echo $CLIENT_ID; ?>'
>
> If I put the JS code directly in a php file with:
>
>   <script type="text/javascript">
>       .
>       .
>       .
>   </script>
>
> Then at run time CLIENT_ID has the value I want. I want to use the
> same JS code in many php files. But if I include the JS code like
> this:
>
>   <script src="login.js" type="text/javascript">
>
> Then that php code does not get run and CLIENT_ID has the literal
> string '<?php echo $CLIENT_ID; ?>'
>
> Is there a way I can reuse my JS file and still have embedded PHP in it?
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux