f



Get date from text/php-file

Hi there,

I'm new to PHP, and i want to create a pop-up (on page load) on certain dates..
What i have is the script for the pop-up:

        <body scroll="auto"  <?php $today =date("d-F"); if ($today==$datum) 
        {echo "onLoad=".$g_birthday_pop;}?>>

The pop-script =
        $g_birthday_pop	  = <<<EOT
        "MM_openBrWindow('http://www.nu.nl','popup','width=300,height=300')" 
        EOT;

$datum is in another file (include/datum.php):
<?php
    $datum	= "30-December";	
?>

And this works if the date is 30th of December,
but i want it too on other dates that you put in $datum
Something like:
        <?php
            $datum	= "30-December";"10-March";	
        ?>
So i want to control the pop-up just by editing the "datum.php"-file

Thanks in advance,

Greetings Krunkelgarten
0
12/30/2003 4:58:34 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

2 Replies
532 Views

Similar Articles

[PageSpeed] 37

krunkelgarten escribi�:
> Hi there,
> 
> I'm new to PHP, and i want to create a pop-up (on page load) on certain dates..
> What i have is the script for the pop-up:
> 
>         <body scroll="auto"  <?php $today =date("d-F"); if ($today==$datum) 
>         {echo "onLoad=".$g_birthday_pop;}?>>
> 
> The pop-script =
>         $g_birthday_pop	  = <<<EOT
>         "MM_openBrWindow('http://www.nu.nl','popup','width=300,height=300')" 
>         EOT;
> 
> $datum is in another file (include/datum.php):
> <?php
>     $datum	= "30-December";	
> ?>
> 
> And this works if the date is 30th of December,
> but i want it too on other dates that you put in $datum
> Something like:
>         <?php
>             $datum	= "30-December";"10-March";	
>         ?>
> So i want to control the pop-up just by editing the "datum.php"-file
> 
> Thanks in advance,
> 
> Greetings Krunkelgarten


I would make $datum an array variable, for example:
<?php
   $datum = array()
   $datum[] = "30-December";
   $datum[] = "10-March";
?>

And then in your layout PHP check if today date is on the $datum array.

Regards,

	knocte

0
knocte (29)
12/30/2003 5:04:50 PM
krunkelgarten wrote:
> What i have is the script for the pop-up:

>         <body scroll="auto"  <?php $today =date("d-F"); if ($today==$datum) 
>         {echo "onLoad=".$g_birthday_pop;}?>>

> The pop-script =
>         $g_birthday_pop	  = <<<EOT
>         "MM_openBrWindow('http://www.nu.nl','popup','width=300,height=300')" 
>         EOT;

> $datum is in another file (include/datum.php):
> <?php
>     $datum	= "30-December";	
> ?>

> And this works if the date is 30th of December,
> but i want it too on other dates that you put in $datum

> So i want to control the pop-up just by editing the "datum.php"-file

I'd do it with arrays:
in the included file put dates to check in one array
    <?php
    $datum[] = '30-December';
    $datum[] = '10-March';
    // ...
    ?>

and substitute your if ($today==$datum) with
    if (in_array($today, $datum))
-- 
            --= my mail box only accepts =--
            --= Content-Type: text/plain =--
            --=  Size below 10001 bytes  =--
0
hexkid2 (1017)
12/30/2003 5:13:47 PM
Reply:

Similar Artilces:

Get date from text/php-file #2
Allright, thank you guys!! I got it going. Now i have another question; Is there a way to link a date to a persons name, so i can get the pop-up, and the pop-up then automatically grabs the right name, and displays it? Thanks in advance.,.. "krunkelgarten" <krunkelgarten@hotmail.com> wrote in message news:8767e62e.0312301404.424614af@posting.google.com... > Allright, thank you guys!! > I got it going. > Now i have another question; > > Is there a way to link a date to a persons name, > so i can get the pop-up, and the pop-up > then automatically grabs th...

want to get content of one php file in another php file
i have one php file having content Contents of ex1.php file <body> <?php $content = "c://webserver/www/abc.php"; $handle = fopen($content, "r"); echo fread($handle,filesize($content)); ?> </body> this is reading abc.php file in which i m simply using an echo statement. When i execute ex1.php file i cant see the php statement of abc.php file content of abc.php file is <?php echo "hello";?> sarika wrote: > i have one php file having content > > Contents of ex1.php file > <body> > <?php > $content = "c://webserver/www/abc.php"; > $handle = fopen($content, "r"); > echo fread($handle,filesize($content)); > ?> > </body> > this is reading abc.php file in which i m simply using an echo > statement. When i execute ex1.php file i cant see the php statement of > abc.php file > > content of abc.php file is > <?php echo "hello";?> That's interesting, I've found out that it's the browser that's hiding <?php ?> tags within .phpx pages. Probably to avoid short tags scripts (on a server that doesn't allow them) from getting leaked by visitors who don't know about this browser trick, until the dev' realizes his error. Not a good thing, IMO; dev's should take care, themselves, and it's still not secure since the hidden string is still in the rendered source. And now we don't know how ...

Failed opening required 'PEAR.php' (include_path='F:\www\include') in F:\Program Files\PHP\PEAR\Text\CAPTCHA.php on line 22
Hi, Guys=EF=BC=8Cwhen I run my site ,I got some errors: Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in F:\Program Files\PHP\PEAR \Text\CAPTCHA.php on line 22 Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path=3D'F:\www\include') in F:\Program Files \PHP\PEAR\Text\CAPTCHA.php on line 22 It appears that it cann't find the pear.php ,but i checked my dir,and this file was there,and also I have my php.ini file checked,the include_path=3Dinclude_path=3D".;F:\Progr...

Getting a file via http or evaluating a php file and getting its output
I need to somehow merge two separate web programs written in php together (from the user's perspective). This solution won't be perminant, I just need something done quickly. I was thinking of two different approches. One would be to download a processed version (modified so it will create validating html with the page it's being embeded in) of one of the programs with the other, then just use print to embed it in the page. I couldn't find out how to get a file via http here (http://us2.php.net/manual/en/index.php). Sorry if I missed this in the docs. The other would be t...

PHP does not parse .PHP files
I have this problem with PHP that someone might be able to help. With CLI, I am able to execute my .php files. For example, if I type "php phpinfo.php" , this works fine on my system. If I put the phpinfo.php file is in /var/www/html and I try to access it through the browser, I get the content of the file and not the execution of the file. Instead of display the info of PHP, I got the text of the file as: <?php phpinfo(); ?> Why? Thanks Phong Ho wrote: >I have this problem with PHP that someone might be able to help. > >With CLI, I am able to execute my ....

I need to create html files from php files using php
I am very new to PHP, although I have been using ASP for a few years. I use a product in ASP called ASPTear, it's a small dll that my hosting company happens to have loaded. Basically you can set up a function that you can pass an ASP page to and it will read the ASP and write out an HTML file. I use this to save load on the server and speed up my site, I have a few include files that look up data and then present it, this data does not change very often, so I run a routine called rebuildhtml.asp that will call a few ASP files and create HTML versions. I am now converting the site to P...

Open .php file with PHP Designer 2007 by clicking the file in XP
In windows XP, I want to be able to click on a .php file and have it opened in PHP Designer 2007, Or right-click on it and have an "edit" menu option presented to me. I know how to tweak the registry to do this in general, but what would the command line look like in this specific case ? PHP Designer does not do this automatically. It is as if the program does not allow commandline options. It only opens with the last file used or a menu of recently opened files. ...

Is a PHP variable supposed to be seen in a .js file included into a .php file
Is a PHP variable supposed to be seen in a .js file included into a .php file? I have a client side javascript code stored in a .js file which is included into a PHP file using <script src="filename.js></script> This code initialises a Javascript variable var u="string"; The string is supposed to be the value of $HTTP_HOST So, when initialise this variable like var u=<? echo $HTTP_HOST;?>; I sterted getting a javascript message Syntax Error Am I doing something wrong, or PHP variables are not seen in included js files? aa wrote: > Is a PHP variable supposed to be seen in a .js file included into a .php > file? > > I have a client side javascript code stored in a .js file which is included > into a PHP file using > <script src="filename.js></script> > > This code initialises a Javascript variable > var u="string"; > > The string is supposed to be the value of $HTTP_HOST > > So, when initialise this variable like > > var u=<? echo $HTTP_HOST;?>; > > I sterted getting a javascript message Syntax Error > > Am I doing something wrong, or PHP variables are not seen in included js > files? js files are not parsed for PHP code unless you specifically tell the webserver to do so. Therefore, "var u=<? echo $HTTP_HOST;?>;" in the .js will error since the browser doesn't know what to do. -- Justin Koivisto - spam@koiv...

Parsing a php include (which also contains php code)
Hello, I am using the <?php include() ?> statement on my website for organizational purposes. However, one of my includes contains some PHP code. Is there any way for the server to actually parse the include? I've tried this before, and it did not parse the include. Rather, it included the file as just plain ASCII. ======================= /*EXAMPLE 1*/ /*index.php*/ .... <?php include('global/includes/footer.inc') ?> .... /*footer.inc*/ .... <p>&copy 1993-<?php echo date("Y") ?> Kingswood School. All rights reserved.</p> .... /*EXA...

When does the php interpreter loads the php file?
Hi All, I'm wondering three facts about php, apache and apache module. 1.How can i differentiate the php intepreter if it's running as a apache module or as cgi? 2.When does the php interpretor loads the php file to main memory? 3.and till when it keeps the php file on memory? - in my experience only after installing Zend it caches the php file. Thak you *** Kim Gijung wrote/escribi� (20 Oct 2004 00:03:35 -0700): > 1.How can i differentiate the php intepreter if it's running as a > apache module or as cgi? If I recall correctly phpinfo() calls it "Server API&qu...

php assembly of multiple php files
I am trying to combine multiple php pages into 1. Basically I have created a shell page and then a seperate php file for each form to be included within the shell. The problem I am having is that when a user submits one of the forms the main shell and the other php files POST values are all returned as NULL and I only get the values pertaining to the form that was submitted?. If all the files were combined into one very long php file, I would get all the POSTs returned how can I do the same but with multiple files? When you submit an include, do the POST values not get passed back to the M...

Modify a php file(model) with php
I have an invoice model on my server! and i want to replace some field(like adresse, phone, price, VAT, ....) do you know a tools or class that allows those kind of manipulations Thanks you Yoni Yoni Alhadeff a �crit : > I have an invoice model on my server! and i want to replace some field(like > adresse, phone, price, VAT, ....) > > do you know a tools or class that allows those kind of manipulations > > Thanks you > > Yoni > > Couldn't you replace field with var and have them set when including your template (it become one in fact) ? I didn'...

How to invoke remote php file from php?
Hi, I have a local php file and I need to get info back from php file on the server. How do I invoke remote a php? I can access this remote php thru a simple url and it prints some info on the web page. How do I get this info back to store as a variable in local php? Regards, Alex. Alex wrote: > Hi, I have a local php file and I need to get info back from php file > on the server. How do I invoke remote a php? I can access this remote > php thru a simple url and it prints some info on the web page. How do I > get this info back to store as a variable in local php? > > Reg...

SSI Including PHP File Within PHP File Causes Seg Fault and Crash
Can somebody concur or verify the following? I'm having this problem on all of my installations. I've got Apache 2.0.40 and PHP 4.2.2 installed and configured from RedHat RPMs. Nothing out of the ordinary. In the httpd.conf file, PHP files are called with the following: <Files *.php> SetOutputFilter PHP;INCLUDES SetInputFilter PHP LimitRequestBody 524288 </Files> I create two files as follows: /test1.php <!--#include virtaul="/test2.php" --> and /test2.php Testing 1 2 3 By going to http://host/test1.php, it may or may not display the fi...

PHP - using mail() and unicode text
I have the following problem. On a website there's a (simple) feedback form. This is used also by Polish visitors who (of course) type Polish text using special characters. However, when I receive the text in my mailbox, all special characters have been turned into mess...... For example: "wsp�lprace" is turned into "współprace". It seems PHP is handling the Unicode-8 strings quite well (when I 'echo' the strings on the site, I see the text correctly), until the point that it is send by using mail(). Is this a server configuration issue? Or something el...

including a PHP file displays the file's content to the user agent (PHP 5.1)
Hi all I'm having a strange problem when upgrading the content management system eZ publish from PHP 4.4 to PHP 5.1. Some cache files related to i18n are included with the "include" function, but they are being displayed to the user agent instead of being parsed by PHP. With PHP 4.4 there was no problem. You can download a test script from: http://blog.kristofcoomans.be/wp-content/uploads/test.tar Thanks for your help Cheers -- Kristof Cyberwolf wrote: > Hi all > > I'm having a strange problem when upgrading the content management > system eZ publish from...

grep for all php calls in the hierarchy of php files
By starting with index.php in the DocumentRoot, I want to find all calls to PHP files. Thus, I extract all the php files in index.php and then grep all those php files for the calls to php files in those until I get the entire hierarchy of php files. My attempt so far has not gone very well. Can anybody point me in the right direction? I just can't figure out where I went wrong. Below, note that I output results to the screen before actually using the same exact call to go to the next level. There probably is a better way but I couldn't think of it. The script does produce 2 or 3...

Upgraded php, lost php file association
Hi, I just upgraded my php but ran into a problem. Never seen this before. Somehow it seems I lost php file association. When I do a http://localhost/something.php I get a prompt for dowload of a file. I went to folder options, and changed file associations so that ".php" is associated with php interpreter, but still get the same problem. I am missing someting obvious. Can someone help. Thanks. -- http://www.dbForumz.com/ This article was posted by author's request Articles individually checked for conformance to usenet standards Topic URL: http://www.dbForumz.com/PHP-...

PHP Training Institute In Delhi, Live Projects on PHP. Short Term PHP Courses, PHP Scripts, PHP Training with Live Projects.
Vserve Global offers short term PHP: Hypertext Preprocessor Training Course, which is a widely used, general-purpose scripting language that was originally designed for web development, to produce dynamic web pages. It can be embedded into HTML and generally runs on a web server, which needs to be configured to process PHP code and create web page content from it. It can be deployed on most web servers and on almost every operating system and platform free of charge.PHP is installed on over 20 million websites and 1 million web servers. TOPICS:- >> Core PHP Language >> HTML, Cascad...

php outside php (?)
Sounds weird, i know. What i want/wonder is the following: PHP can do the next: <?php if($foo == 'bar') { ?> Ow yeah, foo is bar! <?php }; ?> But how can i do the following: <?php $foo= ?> this is what foo looks like. <?php }; ?> This way i could edit the content of $foo in DW's design-view. I hope it's clear enough for you all to understand... Greetings frizzle. frizzle wrote: > But how can i do the following: > > <?php > > $foo= > > ?> > this is what foo looks like. > &l...

PHP is looking for php.ini file in c:\windows
As the installation txt suggests, I have left my php.ini file inside the c:\php directory... but running phpinfo() shows that my php.ini file is in c:\windows as shown below. Configuration File (php.ini path) - C:\WINDOWS Well there is no php.ini file in my windows directory, so I'm not sure where it's getting it's configuration settings from... unless I suppose they're built into the executable somewhere if no php.ini file is found. My questions is - why php is not locating my php.ini file that is located in the c:\php directory? I'd rather not move it to the windows dir...

php bug? strange end of php file error
Why this code <?php function X() { // echo("commented ?>"); } X(); ?> give the error "Parse error: syntax error, unexpected $end" ??? ?> is into a string commented! On 07.09.2007 17:31 Fabio wrote: > Why this code > > <?php > function X() > { > // echo("commented ?>"); > } > X(); > ?> > > give the error > "Parse error: syntax error, unexpected $end" > > ??? > > ?> is into a string commented! no, it is not. There's no "strings" inside comments, ...

getting the name of the PHP file
Hi! I am a PHP beginner, and I don't know my way around. Let's say I have a file named as "file.php". Is there a special variable that already includes the file name, or should I just manually code it into the script; i.e. $filename = "file.php"? I am writing a script that prints out some information about each HTML/PHP file in my home directory. The name of the file is among them. Thanks for your time! Tuomas Tuomas napisal(a): > Hi! I am a PHP beginner, and I don't know my way around. Let's say I > have a file named as "file.php". Is...

PHP within PHP...
I took over the support of a website that is set up something like this inside one of the pages: include_once("header.php"); <?php //to get the content of the page they do this: $content = mysql_query("select content etc...); echo $content; ?> include_once("footer.php"); I am having problems evaluating any php that is used in the mysql content. Is there a way to get the mysql withing the mysql to run? Thank you for your time, Mandragon On Sep 17, 12:56 pm, Mandrago...@gmail.com wrote: > I took over the support of a website that is set up something li...

Web resources about - Get date from text/php-file - comp.lang.php

Many High-Profile Firms Using Vulnerable PHP File Manager: Researcher
A researcher says he has identified several serious vulnerabilities in a PHP file manager application that is used by many high profile organizations. ...

PHP format music files - iLounge Article
... from Pure Volume that have .php extensions. I want to put them onto my iPod but couldn’t import them into iTunes or convert them to MP3 files.… ...

Resources last updated: 3/11/2016 10:19:37 PM