Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / I need help with PHP!!!

Author
Message
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 1st Aug 2003 17:19 Edited at: 1st Aug 2003 17:20
O.k., first off, i know i have all ths supplies needed as my Dad just learned PHP also.

All last night and a little this morning i read a php book, and have created a simple web page:



<html >
<head >
<title >Testing 123!!!</title >
<body >
< ?php
$test = "Testing!"
print($test\n);
? >
</body >
</html >





Now how do i display a .php file in a browser? I have internet Explorer (don't know what version... will check....)

Thanks in Advance,
Mattman

---Mattman
DID YOU KNOW THAT ???
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 1st Aug 2003 17:21
note: Thoses spaces are there so it doesn't screw up this page and can be displayed!!!

---Mattman
DID YOU KNOW THAT ???
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 1st Aug 2003 17:47
upload it... if your webserver uses php then they'll show...
if you wanna test on your machine goto http://www.php.org & download the latest - you'll need a server on your machine setup already for it to actually work.

(i'd recommend apache)

Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 1st Aug 2003 17:53 Edited at: 1st Aug 2003 17:53
Yes, i have apache and MY_SQL i believe. As i am a n00b to web designs (all else i know is basic HTML) what does upload mean? Do I type in url of

C:/webstuff/test.php

???

---Mattman
DID YOU KNOW THAT ???
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 1st Aug 2003 18:33
@Mattman

Upload means to put your files somewhere so that they can be accessed on the web.

If you are running WindowsXP Professional, it comes with IIS, an internet server which runs on your PC. If so, you can just put your files in C:\Inetpub\wwwroot and they will be accessible over the intranet (http://localhost/)

You need to install the PHP script processor as well (php.exe) and set IIS to use it to run .php files. Download from http://www.php.org

Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 1st Aug 2003 18:51
My dad just called and made me update all our computers and he told me how to run it. Thx anyway guys!

---Mattman
DID YOU KNOW THAT ???
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 1st Aug 2003 21:55
k, now with that out of the way, i need help with this code:



my book tells me that isset is correct, and here is my submit button:



But when i run the page, it does not send an e-mail! What am i doing wrong???

---Mattman
DID YOU KNOW THAT ???
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 1st Aug 2003 22:40 Edited at: 1st Aug 2003 22:41
register globals might be turned off
and you don't need to give the button name a $ ...

<input type=submit name='mySubmit' value='GO!'>
check for $_REQUEST['submitButtonName']

Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 1st Aug 2003 23:39
I added the $_REQUEST and i got two errors:

Notice: Array to string conversion in c:\apache\htdocs\matt\contact.php on line 21

Fatal error: Call to undefined function: array() in c:\apache\htdocs\matt\contact.php on line 21

---Mattman
DID YOU KNOW THAT ???
Quote: "Life Is Short" That's a bummer
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 1st Aug 2003 23:40
oh ya, here is line 21:



---Mattman
DID YOU KNOW THAT ???
Quote: "Life Is Short" That's a bummer
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 2nd Aug 2003 02:38
adr???

---Mattman
DID YOU KNOW THAT ???
Quote: "Life Is Short" That's a bummer
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 2nd Aug 2003 06:24
$_REQUEST? WTF? Try $_GET or $_POST

Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 2nd Aug 2003 16:01
will try...

---Mattman
DID YOU KNOW THAT ???
Quote: "Life Is Short" That's a bummer
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 2nd Aug 2003 16:03
again : Notice: Array to string conversion in c:\apache\htdocs\matt\contact.php on line 21

Fatal error: Call to undefined function: array() in c:\apache\htdocs\matt\contact.php on line 21

---Mattman
DID YOU KNOW THAT ???
Quote: "Life Is Short" That's a bummer
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 3rd Aug 2003 17:45
Send the code to my e-mail and I'll help you out

adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 6th Aug 2003 14:02 Edited at: 6th Aug 2003 14:02
Sorry - forgot about this thread

line 21 : $_REQUEST (mySubmit);

You've been using Darkbasic too long Arrays indices are resolved using [square brackets].

line 21 should read : $_REQUEST['MySubmit'];

Kanzure : the $_REQUEST superglobal holds both $_GET and $_POST. Rather than bother figuring out which he was using, I thought I'd kill two birds with one stone.

I opened the case to my PC today and thought, my exhaust fan sucks.
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 6th Aug 2003 16:57
PHP...whoosh straight over my had...*says* cmon guys *to the group of pixalated men around him* lets go write some HEX and Translate those OPCODES...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 7th Aug 2003 01:08
For website design, you can never go wrong with html. That's what I use, and what I know(other than .asp )

Good luck with the website though.





Website 50% done (May be out by mid-end August)
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 17th Aug 2003 21:46
Oh man!!!! U guys DID HELP ME!!! I THOUGHT YOU FORGOT!!! THANK YOU THANK YOU THANK YOU!!! Will try in a sec...

Does it matter if i have a sig???
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 17th Aug 2003 21:52
hum, still an error.

Notice: Undefined index: MySubmit in c:\apache\htdocs\matt\contact.php on line 17

Does it matter if i have a sig???
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 17th Aug 2003 22:10
Here is full code:



Does it matter if i have a sig???
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 17th Aug 2003 22:20 Edited at: 17th Aug 2003 22:21
Quote: "$_REQUEST["MySubmit"];
if (isset($Submit)) :
mail ("mattman91@wideopenwest.com","$Type", "$message", "$sender");
print ("testn");
endif;
?>
"


You forgot..

$Submit = $_REQUEST["MySubmit"];



Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 17th Aug 2003 22:24
still not working. Did not change anything

Does it matter if i have a sig???
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Aug 2003 01:41
Or you could just do:



P.s. you are missing the form html tags which are probably causing you problems as well.

Put this before first form element (change action to be your page name):


and this after reset button:



Also, have you set up smtp server details in your php.ini file. You can't just expect the mail command to magically send you an email!

The programmer formerly known as sonic
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 18th Aug 2003 01:47
Yeah, I also noticed the <Form> tags were mysteriously gone lol.

"Computers are useless they can only give you answers."
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 18th Aug 2003 03:58
i tried form, did not work after it was sent, went to error 405.

what is smtp?

Does it matter if i have a sig???
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 18th Aug 2003 04:56
smtp = simple mail trasport protocol.
There is proberly something wrong with the way it is trying to send the e-mail.

Quote from Spooky previously in the thread
Quote: "Also, have you set up smtp server details in your php.ini file. You can't just expect the mail command to magically send you an email!"
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 18th Aug 2003 04:58
Quote: "i tried form, did not work after it was sent, went to error 405.
"


The page may nto be there Did you do..

<form action=MY_PAGE.php method=POST>

???

Login to post a reply

Server time is: 2024-11-23 16:46:23
Your offset time is: 2024-11-23 16:46:23