Shoutbox

php doubt(i'm still a noob don't worry LOL) - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: php doubt(i'm still a noob don't worry LOL) (/showthread.php?tid=39147)

php doubt(i'm still a noob don't worry LOL) by Jhrono on 02-25-2005 at 08:14 PM

Has the subject says...i'm still a noob and i dont know all fuctions etc...but i am testing php's in a localhost server with apache and mysql installed...well my doubt is...like how do i save a form results to a .txt file or (if you dont bother explaining some basics) how to save anything to Mysql(dont know Sh*t about Mysql)...

Like here is a basic form in Html :
Form.html
(talking about :dodgy:ness eh?:S
<html>
<form action="formresult.php" method="POST">
Your Name <input type="text" name="name" />
Your Age: <input type="text" name="age" />
Hobbies: <input type="text" name="hobbies" />
Hours Spent at Pc per day: <input type="text" name="hours" />
<input type="submit">
</form>
</html>

Formresult.php

Hi <?php echo $_POST["name"]; ?>.
You are <?php echo $_POST["age"]; ?> years old.
Your hobbies are <?php echo $_POST["hobbies"]; ?>
You spend <?php echo $_POST["hours"]; ?> hours a day

Here i wanted to have somthing like a button..Confirm or smtnhg that saved the data..
...
Thanks






RE: php doubt(i'm still a noob don't worry LOL) by segosa on 02-25-2005 at 08:35 PM

<input type="submit">

to

<input type="submit" value="Go!">

?


RE: php doubt(i'm still a noob don't worry LOL) by Concord Dawn on 02-25-2005 at 09:04 PM

I suggest Googleing the motherf***er.


RE: php doubt(i'm still a noob don't worry LOL) by Jhrono on 02-25-2005 at 09:21 PM

quote:
Originally posted by Segosa
<input type="submit">

to

<input type="submit" value="Go!">



you didnt got me...i want to save the data that people write in the form...
RE: php doubt(i'm still a noob don't worry LOL) by Concord Dawn on 02-25-2005 at 09:27 PM

Why don't you use this?


RE: php doubt(i'm still a noob don't worry LOL) by segosa on 02-25-2005 at 10:10 PM

Don't forget to chmod the dir.


RE: php doubt(i'm still a noob don't worry LOL) by Jhrono on 02-25-2005 at 11:05 PM

i'll try that one later thank you =)...
anyway i was trying another one..proley it's really full of errors but can anyone tell me whats wrong here? :

<?php
$a = 1
$b = 5
if ($a > $b) {
    echo "A is bigger B";
} elseif ($a == $b) {
    echo "A is as big as B";
}  else {$a < $b) {
    echo "A is smaller then B";
}
?>


RE: php doubt(i'm still a noob don't worry LOL) by Concord Dawn on 02-25-2005 at 11:20 PM

quote:
Originally posted by johny
i'll try that one later thank you =)...
anyway i was trying another one..proley it's really full of errors but can anyone tell me whats wrong here? :

<?php
$a = 1
$b = 5
if ($a > $b) {
    echo "A is bigger B";
} elseif ($a == $b) {
    echo "A is as big as B";
}  else {$a < $b) {
    echo "A is smaller then B";
}
?>

It should be this:

code:

<?php
$a = 1
$b = 5
if ($a > $b) {
    echo "A is bigger B";
elseif ($a == $b) {
    echo "A is as big as B";
else {$a < $b) {
    echo "A is smaller then B";
}
?>


RE: RE: php doubt(i'm still a noob don't worry LOL) by Chris.1 on 02-25-2005 at 11:31 PM

quote:
It should be this:


No it shouldn't! It should be this:

code:
<?php
$a = 1;
$b = 5;
if ($a > $b) {
   echo "a is bigger than b";
} elseif ($a == $b) {
   echo "a is equal to b";
} else {
   echo "a is smaller than b";
}
?>


RE: php doubt(i'm still a noob don't worry LOL) by Jhrono on 02-26-2005 at 12:08 PM

Thanks chris for the correction =)
Another doubt sorry...How can i make $a= and $b= various random numbers and that the browser choose one each time it reloads?
thanks...


RE: php doubt(i'm still a noob don't worry LOL) by Eljay on 02-26-2005 at 12:13 PM

$a = rand();
$b = rand();

:grin:


RE: php doubt(i'm still a noob don't worry LOL) by L. Coyote on 02-26-2005 at 06:30 PM

Don't forget to download the manual. :D


RE: php doubt(i'm still a noob don't worry LOL) by Jhrono on 02-26-2005 at 08:02 PM

I've been reading stuff from the manual but some of the codes are hard to remember...


RE: php doubt(i'm still a noob don't worry LOL) by spokes on 02-26-2005 at 11:16 PM

* spokes spends a whole day working on some php for his site and then comes to this thread :dodgy:


RE: php doubt(i'm still a noob don't worry LOL) by segosa on 02-27-2005 at 07:04 AM

quote:
Originally posted by johny
I've been reading stuff from the manual but some of the codes are hard to remember...


codes? If you mean functions.. then that's programming for you. Trust me, it's normal to refer to the documentation a lot when programming.
RE: php doubt(i'm still a noob don't worry LOL) by L. Coyote on 02-27-2005 at 07:21 AM

quote:
Originally posted by Segosa
codes? If you mean functions.. then that's programming for you. Trust me, it's normal to refer to the documentation a lot when programming.
PHP Manual = my bible

* L. Coyote goes to read some PHP. :pound:
RE: php doubt(i'm still a noob don't worry LOL) by WDZ on 02-27-2005 at 07:25 AM

quote:
Originally posted by Leo
PHP Manual = my bible
Same here. :dodgy:

I've never read that dodgy religious bible, but I read the PHP Manual all the time! :banana:
RE: php doubt(i'm still a noob don't worry LOL) by Eljay on 02-27-2005 at 07:42 AM

ditto :banana:


RE: php doubt(i'm still a noob don't worry LOL) by WDZ on 02-27-2005 at 07:44 AM

Oh, we're not in T&T? :o

Blah... :dodgy: