Ugly Hedgehog - Photography Forum
Home Active Topics Newest Pictures Search Login Register
General Chit-Chat (non-photography talk)
Question for HTML/PHP programers...
Page 1 of 2 next>
Jul 17, 2023 19:54:59   #
Longshadow Loc: Audubon, PA, United States
 
Can someone tell me if these two statement sets will do the same thing in an HTML file?

<script src="htt..://URL_of_Script_FIle_on_Web"></script>
(dots are so the parser here doesn't think it's a web URL. (h t t p s:)

and

<script>
<?PHP
include ("Path_to_Local_Script_File");
?>
</script>


Thanks in advance.

Reply
Jul 17, 2023 20:08:58   #
DirtFarmer Loc: Escaped from the NYC area, back to MA
 
I'm kinda rusty on PHP but they look to me like they would do the same thing. But I haven't written any PHP in about 6 years now. Use it or lose it.

I would try it and see.

What are you using for an html editor? I use Dreamweaver so it's pretty easy to make a test page and see what it does.

Reply
Jul 17, 2023 20:25:48   #
DirtFarmer Loc: Escaped from the NYC area, back to MA
 
I never included the php inside <script> tags. I just used it as code but I used the file with a php extension rather than html. I used <script> for javascript code.
Been so long I don't recall whether that's necessary or if I just used it for my information to keep files separated.

I just used things like:

<?php include("PageMenu.inc"); ?>

I could include javascript within the include file with <script> tags.

Reply
 
 
Jul 17, 2023 20:36:46   #
Longshadow Loc: Audubon, PA, United States
 
DirtFarmer wrote:
I'm kinda rusty on PHP but they look to me like they would do the same thing. But I haven't written any PHP in about 6 years now. Use it or lose it.

I would try it and see.

What are you using for an html editor? I use Dreamweaver so it's pretty easy to make a test page and see what it does.

Yea, I was wondering if someone might know before I copy and push the files to the server and create a test file.
Not hard, just time consuming.

Currently I'm using Komodo IDE, But I really liked Spider Pad. It forced all the tags to upper case. I did find that Spider Pad will run on my new Win 11 box! (Spider Pad lost its marbles on my old Win 7 laptop one day, re-installing did not work. So I found Komodo. So now I have two editors.
(Spider Pad was written as Shareware YEARS ago (1997 or before). I sent the guy some money. He was either a high school student or JUST started college. When he stopped supporting it he made it Freeware and supplied the keys.
I have the Spider Pad install file(s) archived in three+ places.

(I only maintain four sites now, one is mine.)

Ive started using files with a .phtml extension.

Reply
Jul 17, 2023 21:24:15   #
Longshadow Loc: Audubon, PA, United States
 
DirtFarmer wrote:
I never included the php inside <script> tags. I just used it as code but I used the file with a php extension rather than html. I used <script> for javascript code.
Been so long I don't recall whether that's necessary or if I just used it for my information to keep files separated.

I just used things like:

<?php include("PageMenu.inc"); ?>

I could include javascript within the include file with <script> tags.

Exactly what I do!
Change the menu file ONCE, and the change appears on all the <many> pages. Love the include statement! Saves a TON of editing!

Works for footers also.

Reply
Jul 17, 2023 21:56:24   #
Longshadow Loc: Audubon, PA, United States
 
DirtFarmer wrote:
I'm kinda rusty on PHP but they look to me like they would do the same thing. But I haven't written any PHP in about 6 years now. Use it or lose it.

I would try it and see.

...

I suppose if the style statement does not like the the PHP include, I can add the <script> & </script> commands at the beginning and end of the include file and just use the PHP include to pull it in.
That may be better (safer).

Thanks, love talking things through.

Reply
Jul 18, 2023 01:36:42   #
Wallen Loc: Middle Earth
 
DirtFarmer wrote:
I'm kinda rusty on PHP but they look to me like they would do the same thing. But I haven't written any PHP in about 6 years now. Use it or lose it.

I would try it and see.

What are you using for an html editor? I use Dreamweaver so it's pretty easy to make a test page and see what it does.


LOL, i was reading on and find myself very rusty as well.
I think the difference in the line, if it works would be the location of the script & the PHP tag will run it on every page.

Reply
 
 
Jul 18, 2023 07:33:51   #
Longshadow Loc: Audubon, PA, United States
 
Wallen wrote:
LOL, i was reading on and find myself very rusty as well.
I think the difference in the line, if it works would be the location of the script & the PHP tag will run it on every page.



Yea, I found that at 72, these things leak out faster than they used to....
Especially Java Script.....
(That doesn't even dance around in my head before leaving sometimes.)
Then, one has to also keep track of what HTML code pieces have been depreciated over the years (no longer valid).

Reply
Jul 18, 2023 09:02:35   #
Wallen Loc: Middle Earth
 
Longshadow wrote:


Yea, I found that at 72, these things leak out faster than they used to....
Especially Java Script.....
(That doesn't even dance around in my head before leaving sometimes.)
Then, one has to also keep track of what HTML code pieces have been depreciated over the years (no longer valid).


The tag <marquee> comes to mind. It was not even read on all browsers during its time.
I fully gave up the ghost when CSS happened.

My first webpage project, wayback 2003
https://web.archive.org/web/20091027013932/http://geocities.com/d_creators/

Reply
Jul 18, 2023 09:04:34   #
Longshadow Loc: Audubon, PA, United States
 
Wallen wrote:
The tag <marquee> comes to mind. It was not even read on all browsers during its time.
I fully gave up the ghost when CSS happened.

YES!!

But I found a SIMPLE <Marque> substitute!
(But where did I put the code snippet.....)

Reply
Jul 18, 2023 09:04:55   #
DirtFarmer Loc: Escaped from the NYC area, back to MA
 
Longshadow wrote:


Yea, I found that at 72, these things leak out faster than they used to....


Wait until you catch up with me at 84.

Reply
 
 
Jul 18, 2023 09:10:14   #
Longshadow Loc: Audubon, PA, United States
 
DirtFarmer wrote:
Wait until you catch up with me at 84.



More power to ya!

Reply
Jul 18, 2023 09:12:09   #
Wallen Loc: Middle Earth
 
Longshadow wrote:
YES!!

But I found a SIMPLE <Marque> substitute!
(But where did I put the code snippet.....)


Dont look under the bed
I tried that, the back still hurts

Reply
Jul 18, 2023 09:12:56   #
Longshadow Loc: Audubon, PA, United States
 
Wallen wrote:
Dont look under the bed
I tried that, the back still hurts


Reply
Jul 18, 2023 09:17:46   #
Longshadow Loc: Audubon, PA, United States
 
Wallen wrote:
The tag <marquee> comes to mind. It was not even read on all browsers during its time.
I fully gave up the ghost when CSS happened.

My first webpage project, wayback 2003
https://web.archive.org/web/20090829150446/http://geocities.com/d_creators/


I think <blink> may be another. Turns out that was a simple workaround.

Reply
Page 1 of 2 next>
If you want to reply, then register here. Registration is free and your account is created instantly, so you can post right away.
General Chit-Chat (non-photography talk)
UglyHedgehog.com - Forum
Copyright 2011-2024 Ugly Hedgehog, Inc.