Search found 17 matches

by daybreaker
Tue Jan 12, 2021 1:26 pm
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

Re: handling session variables when the same page is opened

Hi there,

I came up with a solution :

I created unique session variables for form data for each page and restricted only a single instance of a page to be opened at any time.

If anybody has a better solution I would like to know.

Thanks
daybreaker
by daybreaker
Mon Jan 11, 2021 3:43 pm
Forum: JavaScript
Topic: processing a php array in javascript
Replies: 0
Views: 500

processing a php array in javascript

Hi there, I have several lines of html like the below in a form.... <select onkeydown="return event.key != 'Enter'" name="itemline[4][inventoryitem]"><option value=.... can anyone tell me how to access this information by using javascript to access this array item. I want to be able to check in java...
by daybreaker
Sat Dec 12, 2020 10:34 pm
Forum: PHP coding => General
Topic: populating a dynamically geneated drop down input box
Replies: 3
Views: 617

Re: populating a dynamically geneated drop down input box

Hi there i found a potential solution

Just used this line of code that I found on the web.


var inventoryitems = <?php echo '["' . implode('", "', $inventoryitems) . '"]' ?>;


where $inventoryitems is an array - $inventoryitems = array ("value1", "value2", "value3", "value4")
by daybreaker
Sat Dec 12, 2020 12:53 pm
Forum: PHP coding => General
Topic: populating a dynamically geneated drop down input box
Replies: 3
Views: 617

Re: populating a dynamically generated drop down input box

And here is the html for the javascript in the previous posting...

<html>
<body>
<div id="container"></div>
<br>
<div>
<button id="generate">Generate</button>
</div>
</body>
</html>


I thought it would be easy enough but unfortunately not. Any help would be appreciated.
by daybreaker
Sat Dec 12, 2020 12:51 pm
Forum: PHP coding => General
Topic: populating a dynamically geneated drop down input box
Replies: 3
Views: 617

populating a dynamically geneated drop down input box

Hi there i have found code i would like to use but am having trouble populating the dropdown from data from a table rather than the const values that is used in the code. Here is the original code. document.getElementById('generate').onclick = function() { var values = ["dog", "cat", "parrot", "rabb...
by daybreaker
Wed Nov 25, 2020 9:01 am
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

Re: handling session variables when the same page is opened

And here is the invocation of that code if ($pa[$i]->single_instance_only == 'Y') { echo "<a href='javascript:;' onClick=\"javascript:gmyWin=myOpenWindow('".$pa[$i]->permission_file.".php', '".$pa[$i]->permission_file."','',gmyWin);return false\"><b><font color=orange style=\"font-size: 16pt;\" ><sp...
by daybreaker
Wed Nov 25, 2020 8:44 am
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

Re: handling session variables when the same page is opened

Hiya , the code that i referred to in my previous posting does not work for every page. Which is kind of annoying - I dont understand why it wont work with every page - if it did it would be the perfect solution . Can anybody give me some idea why it wont always work. Here is the snippet of code - <...
by daybreaker
Fri Nov 06, 2020 8:04 pm
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

Re: handling session variables when the same page is opened

Hi there, I found some code that was useful - it used a javascript function call to open up a window. The trick that it does is if there is already an instance of that page open, then it opens the page on that page's window. I also made the session variable names different so that coupled with using...
by daybreaker
Wed Oct 28, 2020 11:14 pm
Forum: PHP coding => General
Topic: rendering a page when browsing via smart phone
Replies: 1
Views: 406

rendering a page when browsing via smart phone

Hi there, Any help welcome. RE: URL https://heatpump07.co.nz/hp07/default.php When I browse to this page using a smartphone, there is a bit of html that disappears when this page is rendered. If you check this webpage on a laptop or PC it renders just fine. The code that disappears is as below (you ...
by daybreaker
Sat Oct 10, 2020 1:10 pm
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

Re: handling session variables when the same page is opened

I found out from the author of the code that it is not dependent on the filename of the page but the domain name of the url so unless i modify it, it wont suit my purposes. i.e. you cant have more than one page rendered from the same website, not the page itself.
by daybreaker
Fri Oct 09, 2020 5:08 pm
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

Re: handling session variables when the same page is opened

yeah im guessing it is not as easy as just having different filenames for the web pages. what i did to stop overwriting session variables was to use different names for session variables for each page. But this means I still have to stop opening multiple instances of the same page. So i was hoping t...
by daybreaker
Fri Oct 09, 2020 5:02 pm
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

Re: handling session variables when the same page is opened

Hi, yeah i am looking into code on this url that could do the trick but it isnt working out quite the way i expected. I was under the impression that if the webpage was the same name, it would stop it from opening. But this doesnt appear to be the case. I have tried opening 2 pages of different name...
by daybreaker
Tue Oct 06, 2020 4:26 pm
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

Re: handling session variables when the same page is opened

Thanks for your reply. so do you think that if there is just one instance of the page allowed to be opened at any time that this will avoid the session variables being overwritten? How would i test for that? Or alternatively as you say we store the data being updated in a temporary table in mysql? B...
by daybreaker
Mon Oct 05, 2020 12:51 pm
Forum: PHP coding => General
Topic: handling session variables when the same page is opened
Replies: 12
Views: 2025

handling session variables when the same page is opened

Hi there, RE: handling session variables in a page when that same page is open twice or more. Just wondering what happens when you open the same page that uses the same session variable names? If it is an issue,that is opening the same page a second time how do you avoid overwriting the session vari...
by daybreaker
Sat Aug 29, 2020 4:03 pm
Forum: PHP coding => General
Topic: menu options dont appear when window is maximised
Replies: 4
Views: 761

Re: menu options dont appear when window is maximised

Hi Hyper, Thanks. I think I know what you mean. Have toggled the display settings and noticed that it does display when maximised when changing the width and height settings. I noticed in one of the stylesheets that the @media settings have different paired sizes so i am thinking i need to add anoth...
by daybreaker
Sat Aug 29, 2020 3:18 pm
Forum: PHP coding => General
Topic: menu options dont appear when window is maximised
Replies: 4
Views: 761

Re: menu options dont appear when window is maximised

Hi Hyper, Can you elaborate what you mean by media queries. I have tried using meta tag <meta name="viewport" content="width=device-width, initial-scale=1.0"> and style <style> img { max-width: 100%; }</style> website page that i am working on is https://gsale.co/hp07/default.php when it is a normal...
by daybreaker
Wed Aug 26, 2020 10:23 pm
Forum: PHP coding => General
Topic: menu options dont appear when window is maximised
Replies: 4
Views: 761

menu options dont appear when window is maximised

Hi there, I translated aspx pages into php pages and found that the menu options on the default page do not turn up on some browsers when the window is maximised. It works fine on browsers on my laptop regardless of whether they are normal size or maximised but only works if normal if browsing on ot...