Search found 26 matches

by guvna
Wed Feb 12, 2020 9:39 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 12
Views: 97

Re: Create photo gallery (no mysql or widget)

OK that's what I've done and it works. I had the switch code and some script in the same include file which stumped me for a bit as the code wouldn't work if all placed at the start or all at the end of a page. It would be nice to get an explanation as to why so I don't try it again in the future: T...
by guvna
Tue Feb 11, 2020 6:27 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 12
Views: 97

Re: Create photo gallery (no mysql or widget)

Whenever $sub_div in function pid_text() is set to one of the values in function sub_div_text() Using '=' always returns the first 'if($sub_div =' value. Using '==' always returns the 'else $sub_div_abb = 'text'. This is regardless to the path as that doesn't form part of this function. $sub_div wil...
by guvna
Mon Feb 10, 2020 9:53 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 12
Views: 97

Re: Create photo gallery (no mysql or widget)

OK making progress but stuck on a function to display a sub-division name (where property is located). Might just be fatigue. No matter where in the images directory path I run this code $sub_div_abb is always: GR image path directory structure: ..training/gallery/....my test images ..training/galle...
by guvna
Wed Jan 29, 2020 4:06 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 12
Views: 97

Re: Create photo gallery (no mysql or widget)

this seems to work fine.

Code: Select all

foreach(glob(IMAGEPATH."*.{jpg,png,gif,JPG,PNG,GIF}", GLOB_BRACE) as $filename){
	echo basename($filename) . '<br>';
}
by guvna
Wed Jan 29, 2020 3:29 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 12
Views: 97

Re: Create photo gallery (no mysql or widget)

So I've implemented your response. The extension is case sensitive. <?php echo '20200129-02: from php forum<br>'; define('IMAGEPATH', '../gallery/'); foreach(glob(IMAGEPATH.'*.JPG') as $filename){ //extension is case sensitive. echo basename($filename) . '<br>'; } foreach(glob(IMAGEPATH.'*.gif') as ...
by guvna
Tue Jan 28, 2020 11:12 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 12
Views: 97

Re: Create photo gallery (no mysql or widget)

OK I've looked at things like scandir() but I don't think I really need this as I already know where the images are located. From day 1 I've stored images under a key system so we know 'bth_.' = bathroom, 'bed_..' = bedroom, lr_.. = living room etc. So we can derive an image caption from a single fi...
by guvna
Tue Jan 28, 2020 7:32 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 12
Views: 97

Re: Create photo gallery (no mysql or widget)

I found this but was hoping for something more dynamic that could automatically pick up the image files from a designated folder:

https://www.w3schools.com/howto/howto_js_slideshow.asp
by guvna
Tue Jan 28, 2020 4:11 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 12
Views: 97

Create photo gallery (no mysql or widget)

I have images for properties already loaded on my server in specific folders for each property. I'm trying to find out if it's possible, just using PHP, to create a gallery to display the images (all known set sizes) with next/previous arrows/chevrons. I'd like to set the image order to display and ...
by guvna
Mon Dec 23, 2019 11:39 am
Forum: PHP Scripts
Topic: function function_name(parameters)
Replies: 5
Views: 128

Re: function function_name(parameters)

OK I've had a go with parameters defined in () and without and keep getting fatal error message: called to undefined function. //Variable font settings: function fnt_var($fnt_name, $fnt_sz_xsm, $fnt_sz_sml, $fnt_sz_med, $fnt_sz_mlg, $fnt_sz_lge, $fnt_sz_xlg, $fnt_sz_xxl){ // function fnt_var(){ $fnt...
by guvna
Thu Dec 05, 2019 8:53 am
Forum: PHP Scripts
Topic: function function_name(parameters)
Replies: 5
Views: 128

Re: function function_name(parameters)

OK, so any parameter in a function() needs to be predefined before the function is called. Presumably either: - within the same php tag as a declared variable or another function() that has been called within the php tag. - from an include(). - from a require(). If a parameter is not defined in a fu...
by guvna
Wed Dec 04, 2019 4:22 am
Forum: PHP Scripts
Topic: function function_name(parameters)
Replies: 5
Views: 128

function function_name(parameters)

I'm trying to learn and understand the correct terminology for some php script being used to create a pdf document using fpdf. function show_other_info($sale_id, $prepayment_info, $pdf, $y_start=180, $fnt_sz, $style=4){ What is the correct term to use for the items in the parenthesis? Are they varia...
by guvna
Thu Apr 04, 2019 3:19 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 1595

Re: form validation using form from include () file

OK looks like I'm doomed with this task then. My form logic is correct and works. My header file has this code in the <head> section for the entire website: <title><?php echo $page_title; ?></title> Pages on the website then include the header file and this code: $page_title = 'My Page Title'; An ec...
by guvna
Tue Apr 02, 2019 2:32 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 1595

Re: form validation using form from include () file

I'm pretty sure I'm doing this the way that has been suggested: if ($response->success) { //echo "Verification success. Thank you $fullname for your information request."; header('ret_frm_mailer-pm.php'); // code line 266 } else { $captchaErr = "Verification failed! Did you confirm you're not a robo...
by guvna
Thu Mar 28, 2019 8:43 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 1595

Re: form validation using form from include () file

This is a most valuable point: "You're looking at this from the wrong point of view, you are trying to do it in a particular way - don't - you need to do it in the way that it needs to be done." I have been trying to replicate my ancient basic html file to a PHP file with field validation. On submit...
by guvna
Thu Mar 28, 2019 4:11 am
Forum: PHP General
Topic: Dynamically display images in a container depending on page height
Replies: 7
Views: 1365

Re: Dynamically display images in a container depending on page height

Each image is width:125px height:94px and I have eight before I need to duplicate. They are controlled by this css:
.tblRetailImgBdr {
background-color:#FFFFFF;
border:none;
padding:none;
text-align:left;
vertical-align:top;
width:125px;
}
by guvna
Wed Mar 27, 2019 10:25 am
Forum: PHP General
Topic: Dynamically display images in a container depending on page height
Replies: 7
Views: 1365

Re: Dynamically display images in a container depending on page height

Is there any method of doing the container height calculation clientside and using the result to render 'x' number of images serverside or is it something that simply isn't done?
by guvna
Wed Mar 27, 2019 9:02 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 1595

Re: form validation using form from include () file

Okay I'm getting closer. I'll leave the DEFINE for now until I've got the form sorted. I have got my form validating on the correct page (itself) and the recaptcha code works. This only happens when: <form method="post"> I removed the 'action'. If I have either of these form action settings the scri...
by guvna
Tue Mar 26, 2019 5:27 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 1595

Re: form validation using form from include () file

Hyper I have to admit a 'double dunce' here. I should go sit in the corner with the hat on. First, I was working through a book and stopped at the page going from cookies to sessions. If I'd read the manual I would have understood your replies better! Second, I used the code you suggested: "$root/fr...
by guvna
Tue Mar 26, 2019 5:14 am
Forum: PHP General
Topic: Dynamically display images in a container depending on page height
Replies: 7
Views: 1365

Dynamically display images in a container depending on page height

First of all, if this topic is already covered please provide the search term I should have used to find it. I am trying to construct pages that have different content so they vary in height depending on their content. Using PHP I'd like to display images in a container <div> by the side of my conte...
by guvna
Tue Mar 12, 2019 2:07 pm
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 1595

Re: form validation using form from include () file

Thanks for the direction on the client/server side. Coding is not my principle role so these things take me weeks whereas you may knockout in a few hours. The w3schools link does expalin why <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> works and that part I'm fi...
by guvna
Tue Mar 12, 2019 10:52 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 1595

Re: form validation using form from include () file

OK so in response to 'hyper' suggestion I've tried a few things. in public_html/frm frm-pm.php now shows as: $root=$_SERVER['DOCUMENT_ROOT']; include "$root/retail/pm_form.php"; in public_html/retail pm_form.php I've no idea why it works but would be nice to get an understanding. All works with the ...
by guvna
Tue Mar 12, 2019 4:07 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 1595

form validation using form from include () file

I've been researching looking into form method and post but can't seem to get round this one. Whilst this is a good example: https://www.w3schools.com/php/php_form_complete.asp The form is self contained. My situation is twofold but I'll deal with the validation while using an include file first. My...
by guvna
Tue Mar 14, 2017 10:23 am
Forum: PHP coding => General
Topic: includes in sub directories of password protected directories
Replies: 7
Views: 2214

Re: includes in sub directories of password protected directories

response to chorn post:
Is your warning relative to the using of http full path in includes, to using server path, or both?
by guvna
Tue Mar 14, 2017 4:35 am
Forum: PHP coding => General
Topic: includes in sub directories of password protected directories
Replies: 7
Views: 2214

Re: includes in sub directories of password protected directories

ok thanks. This works but only with server path, not with site path. So this leads to another issue, I use Dreamweaver for websites and with site paths any changes I make will automatically update affected pages. The server path include paths are not automatically updated by Dreamweaver. I'm thinkin...
by guvna
Fri Mar 10, 2017 9:41 am
Forum: PHP coding => General
Topic: includes in sub directories of password protected directories
Replies: 7
Views: 2214

Re: includes in sub directories of password protected directories

Have tried that and still get the authorization error message. Also I have multiple sites with 'includes' but they don't sit behind a protected directory so they are not an issue right now.