

![]() |
![]() |
|
|||||||
![]() |
![]() |
| Web Development Website design and programming, content development. It's all here. |
![]() |
|
|
LinkBack | Thread Tools |
![]() |
![]() |
|
|
#1 (permalink) |
![]() ![]() Deviant Join Date: Aug 2006
Posts: 44
![]() |
I want to learn PHP, but first I need to set up a server [Program] like apache, right?
I created a simple .PHP page, here is the source to it (This is not mine): Code:
<html><body><?phpecho "Hello World";?></body></html> What am I doing wrong, and how can I use php when makeing a webpage? |
|
|
|
![]() |
![]() |
|
Advertisement
|
|
![]() |
![]() |
|
|
#2 (permalink) |
![]() ![]() ![]() ![]() Disciple |
YOu must install PHP first
i would suggest Reactor Server for beginning windows users, it gives you it all in a lil package also Code:
<html><body><?php echo"Hello World"; ?></body></html> |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#4 (permalink) |
|
I hate Steve Jobs.
Senior Member
Gold Member ![]() ![]() ![]() ![]() Enlightened |
If you want to save yourself the trouble of setting up a server, take a look at Wamp. http://www.wampserver.com/en/
__________________
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#7 (permalink) | |
![]() ![]() ![]() ![]() Enlightened |
PHP is an interpreted language. Therefore, the computer that processes the PHP code must have PHP and any other run-times previously installed. To be able to upload your files to a server via FTP you need to rent webspace and bandwidth from a provider, the server must have PHP installed. Some new things introduced in PHP5 cannot be done without the server having the latest PHP run-times. PHP4 is still the standard among most webservers, since the PHP5 release is relatively new.
I don't think Invisionfree allows the custom uploading of scripts, however - you could try taking a look at the Invision documentation, put your poll code in a plug-in, and use it through Invision's native plug-in installation procedure (the board probably has a built in uploader for that). The main use for PHP is dynamic content. You can use it to perform complex mathematical algorithms on data dtructures or to dynamically choose based on the control structure of your page to show specialized content.
__________________
Ultimate Guide/Resource/Tutorial/Book Thread
Technobabble! - My Blog About All Things Technological Quote:
|
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#8 (permalink) |
![]() ![]() Deviant Join Date: Aug 2006
Posts: 44
![]() |
So, could I create polls, a clock, skin swapper (Swaps by time) and things of this sort with PHP?
Also, could create a registration system if I wanted? Like, makeing a script in PHP that could make it to where people sign up for a website just like they do forums. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#9 (permalink) | |
![]() ![]() ![]() ![]() Enlightened |
Yes. This forum and most others are written in PHP. However, people have been switching to ASP.NET and AJAX recently.
__________________
Ultimate Guide/Resource/Tutorial/Book Thread
Technobabble! - My Blog About All Things Technological Quote:
|
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#10 (permalink) |
![]() ![]() ![]() ![]() Disciple |
SC_Modder confuses me thats for sure and if you have an invision free board that is a little more on the advanced and restricted side of the code
YOu don't have the ability to edit the souce files so you can't do any php mods but you can edit the skins files to an exstent where your ideas could be posable Also i don't think ajax is near php or asp, since ajax is commenly used with php and probily asp |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#11 (permalink) |
![]() ![]() Deviant Join Date: Aug 2006
Posts: 44
![]() |
Thanks!
Off topic, I need help with something... I wrote this code, but something is wrong. (Javascript) Code:
<script type="text/javascript">
var d= new Date();
document.write("Welcome to 8! Todays date is: November the " + mytime() + ".")
function mytime()
{
document.write(d.getDate())
}
</script>
19Welcome to 8! Todays date is: November the undefined. The result I needed was this: Welcome to 8! Todays date is: November the 19. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#12 (permalink) | |
![]() ![]() ![]() ![]() Enlightened |
Your function isn't returning a numerical value. What happens is that at compile time (at the time that the machine compiles the javascript code and processes the output), all functions are executed. Since your function is calling a function and outputting the data to screen (instead of returning the value to the invoker), the function gets resolved to it's output, and so the number "19" gets written to the screen. The original output gets printed, where you called your function. And since you didn't return a value, the value that you make reference to is undefined.
__________________
Ultimate Guide/Resource/Tutorial/Book Thread
Technobabble! - My Blog About All Things Technological Quote:
|
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#13 (permalink) |
![]() ![]() Deviant Join Date: Aug 2006
Posts: 44
![]() |
So, instead of the function calling another function to print something onto the screen..
I should make a function return the value of getDate() to the invoker? If yes, how could I do this, and how would I achieve the same result I needed? |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#14 (permalink) |
|
Senior Member
Gold Member ![]() Evangelist |
Code:
<script type="text/javascript">
var d= new Date();
document.write("Welcome to 8! Todays date is: November the " + mytime() + ".")
function mytime()
{
return d.getDate()
}
</script>
Code:
document.write("Welcome to 8! Todays date is: November the " + d.getDate() + ".")
__________________
New AIM S/N - TooHyeToReply |
|
|
|
![]() |
![]() |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|