|
Sorry! I was only following a joke that Led Mike made...
I've been able to test it using different computers with different public IP's and the variable value is maintained in all the different connections so that variable must be stored in the server side.
Thank you for your answer...
|
|
|
|
|
PHP is a server template system that interprets all PHP script inside <?php ?> tags. Since PHP runs on the server, its variables also reside on the server.
If one user sets $Test = 10; in a script, it is not available in another call to the same script. If you want to share the value among multiple calls by the same user, you have to use $_SESSION['Test'] = 10;. Please make sure that you call session_start(); in all PHP script files that you want to access session variables.
To share between all sessions, use global variables. Syntax: $GLOBAL['Test'] = 10;
modified 29-Aug-18 21:01pm.
|
|
|
|
|
|
No problem. Just in case you are writing a PHP based website from scratch, try to do the following:
Organize code such that functions that provide core functions (such as accessing databases) be kept in separate php files. Then, you can use
<?php
require 'core.php'
?>
to include it in any other PHP file.
This way, you can reuse the functions, there will be as little PHP code in the HTML pages. It is much more manageable that way.
I go to another level usually, where PHP scripts corresponding to user actions are kept in another PHP file. Conceptually similar to MVC.
view.php has all the HTML with minimal PHP calls to functions in controller.php. Controller.php is specific to the view.php and contains all the PHP code specific to that page. All reusable functions between multiple pages go into core.php. I use multiple core files to aggregate functions based on functionality. For example: authentication goes into one file.
In the view.php, I just use
--
require 'core.php';
require 'controller.php';
HTML with function calls to controller.php.
--
I hope this helps. All this is just a matter of individual preference. I have found it much better to manage in the long term.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thomas George wrote: To share between all sessions, use global variables. Syntax: $GLOBAL['Test'] = 10;
Um... no. This is wrong. You are confusing Sessions with scope.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
A variable with global scope is available to all sessions. What is wrong?
modified 29-Aug-18 21:01pm.
|
|
|
|
|
My understanding is that a variable with global scope is available anywhere within the current instance of the script and (depending on your config) in the current user session.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
You are right. Thank you for correcting my misconception.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
That's not a problem.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hello
I am wondering if anybody could please assist me in solving this problem.
The problem is as follows:
1) I want a "session - about to expire in x: minutes " message to popup x - minutes before the session comes to an end.
2) I need to be able to register a 'session - refresh' event in a central position, thus not in the Page_Load event of every page. Is there a way to do this.
I am a complete newby to ASP>Net and I would greatly appreciate any help.
Thanking you in advance
ChristiaanS
ChristiaanS
|
|
|
|
|
You would need to do this using a timer in javascript. You could also have all your pages inherit from a base page/master page that would output this script.
|
|
|
|
|
I need to view an rvt file in the html page. I have installed the Revit viewer RAC2009. What coding should I include in html page to view the revit file?
Note: rvt is the extension of revit file.
|
|
|
|
|
Ramya.G wrote: rvt
A quick Internet search reveals that it is an Autodesk file. Does your Autodesk support automation to export to HTML or XML?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi,
I want to close the current browser screen, why doesn't the following javascript not work?
<input type="button" id="btnClose" class="button" value="Close" onclick="javascript:window.close();" />
Regards
Brendan
|
|
|
|
|
first of all recheck your question statement...
why doesn't the following javascript not work?
OOPS !
anyways here is the answer to your problem..
<input type="button" id="btnClose" class="button" value="Close" onclick="javascript:window.close(); return false;" />
cheers !
Ashish Sehajpal
|
|
|
|
|
Ashish Sehajpal wrote: return false;"
I don't think it is mandatory unless you are within a function.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
What is the error?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
if u don't know the error then how come you suggest anything to me dear...
check his code
then
mine....and then decide
Ashish Sehajpal
|
|
|
|
|
Watch it.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
I am working on a small banking application in which if suppose i have to transfer money from US to UK, I have to retrieve the latest Dollar to Pound conversion rate and the transfer the corresponding pounds to the corresponding account.
Now how do i retrieve these conversion rates in to my application. Can i retrieve these from the existing websites offering these conversion services..? If yes.. How do i do it?
Let me know if there is any other method.. Also suggest me any forums,Sites,Links or articles having info about this. Forgive me if the problem is too basic. . I am novice in this field.
Harsha
|
|
|
|
|
If you are developing this for a bank or financial institution they will have real time feeds available through a well known api which you should have access to. If not then you'll need to retrieve the data from an online service of some description. There will be 2 types: free and pay. The free are usually at least 15 minutes behind the market and, therefore, may cost you money on the exchange. You should look at a paid, real time service.
A good free one is Yahoo. They expose much of their financial data (including FX rates) through a published api which I use on my web site to get some data of interest. Here: FX and market data[^]
You can find some good information on how to do that here: http://www.gummy-stuff.org/Yahoo-data.htm[^]
Good luck: you'll need to figure out how to code that in an appropriate manner to your skill level and language preference. Hey, got to leave you something to figure out on your own otherwise you'll never learn.
|
|
|
|
|
Thanks a lot.. I will try it out...
Harsha
|
|
|
|
|
From your question, I assume that you do not have a relationship with a bank yet. All banks have in-house conversion rates for their customers, and currency trading desks with real time feeds to current market prices. Many banks just give customers a single rate through out the day.
Since the choice of source of the conversion data will vary from bank to bank, you may have to code in such a manner that you can customize your code to handle different data sources and input data formats easily. If it is just for a demonstration, you may use any of the sources from the Internet.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
What kind of an application is this? The answer will vary depending on the role of the application.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hello all!
Hope I'm not repeating topic, since I haven´t found the answer I posted this!
I'm working on a Javascript menu over a Flash movie. In IE, I see the right result but in Firefox, the menu goes behind the flash movie.
I tried the z index styling with css:
.menu {
position:static;
z-index: 10;
overflow: visible;
}
.flash {
z-index: -1;
}
And also the Transparent parameter with the code on the Flash Movie:
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','507','height','519', 'hspace','0', 'vspace','0','align','middle','class','flash','src','images/home3','quality','high', 'wmode' ,' transparent', 'pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','images/home3' ); //end AC code
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="507" height="519" hspace="0" vspace="0" align="middle" class="flash">
<param name="movie" value="images/home3.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="play" value="true" />
<embed src="images/home3.swf" width="507" height="519" hspace="0" vspace="0" align="middle" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" />
Please, if someone knows a workaround in this, let me know!!!
Check the site here:
http://www.cic-caracas.org/test3/[^]
|
|
|
|