/    Sign up×
Community /Pin to ProfileBookmark

newbie wants to know how to use PHP

I don’t really want to know a history of PHP or anything too indepth, all I want to know is if I download a file of PHP files, and want to use them in my html doc. How do I call for those scripts to work, is it like Javascript, were you just simply go like this: <script language=”PHP” target=”../my.php”>
Something like that?

regards,

Code One

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@pyroNov 14.2003 — No, actually PHP code resides between PHP tags:

[code=php]<?PHP
# code here
?>

<!--OR, with short tags (not recommended)-->

<?
# code here
?>[/code]
Then, name the file with a .php extention and if your server supports PHP, the code between the tags will get processed.
Copy linkTweet thisAlerts:
@Code_OneauthorNov 15.2003 — that makes sense... thanks alot.

regards,

code one

Oh one more thing...how does the server know were to find the .php file? If the code isn't actually on the page, and his tucked away in a folder on my server, how will it kow which folder to reference? Or are u suggesting I take the PHP code from the downloaded files, and paste it within the document. Don't know if that would work, because I have one file acting as a data base. This is for a vote script, made with sql and php.
Copy linkTweet thisAlerts:
@JonaNov 15.2003 — [font=arial][color=maroon]The code goes inside of the .php document, and the code is run from there. If you're accessing an SQL database, you'll just use code to access that database's name, etc. via functions pre-set in PHP.[/color][/font]

[b][J]ona[/b]
Copy linkTweet thisAlerts:
@Code_OneauthorNov 15.2003 — so your saying, even if the doc, was a html doc, to begin with, if I add any PHP it should be saved as a PHP doc, instead? and if i was accessing an sql database what kind of calls should i use?

regards

Code One
Copy linkTweet thisAlerts:
@pyroNov 15.2003 — PHP documents do not need to reside in any specific directory. Anything with a .php extention will be processed.
Copy linkTweet thisAlerts:
@Code_OneauthorNov 15.2003 — alright I'll give it a shot and see what happens.

thanks,

co
Copy linkTweet thisAlerts:
@pyroNov 15.2003 — You bet... ?
×

Success!

Help @Code_One spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...