Dynadot

Just started PHP

Spaceship Spaceship
Watch
Hey
I just started some php tutorials and i just tried coding this

<html>
<body>
<?php
$zubair0="1";
$zubar01="2";
$zubair="$zubair0+$zubair01";
print "Hi" . " " $zubair; ?>
</body>
</html>

but the code didnt work
can u tell me what i did wrong since its not working

see it for urself

http://extremewebsitehost.com/testing.php
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
I don't know of any guestbook tutorials that don't use mySQL..... but i know how you feel, i didn't want to learn mySQL either.... i still haven't, i use ASP with SQL if i want any database work :)

if you want a major project you could try making your own guestbook from scratch... learn about using the FPUT command to put data into a text file, and use that as your method for storing messages, the rest can be worked around that.... it wont be easy though, im sure there are plenty of people here (including myself) who will help you with any problems



As for the clock, im not sure, if you find a method of refreshing that doesn't look like the whole page is refreshing.... let me know, i have a shoutbox on my site and its terrible because even though its in an iframe, it appears as if the whole page is refreshing
 
Last edited:
0
•••
Thanks wild :P I will let u know if i face any problem :)
 
0
•••
0
•••
0
•••
unknowngiver said:
wow
lol
look at my first script
http://extremewebsitehost.com/main.php
lol...

OKay is there a easy way of adding space then using
. " " . command?


lol, i got this

Today is ThursdayIt's Jul.1.th
and its 13:08:42 EDT 2005

might need fine tuning B-)
 
0
•••
it cool, you may want to start a new line for the date
also why is it telling me its the 1st july

-------------------

i don't think there is an easier way than . " " . sorry
 
0
•••
I dont know...Thats wt making me go all nuts too
lol
here is the code


<?php
$d=date("M.I.S");
$t = date("G:i:s T Y");
$b=date(l);
echo '<br>';
echo "Today is" . " " . $b ;
echo "It's" . " " . $d ;
echo '<br>';
echo "and its" . " " . $t;
?>

Wow untill today i thought making forums and those scripts was easy :P lol now i know how hard php is :p
 
0
•••
maybe the time is set really bad on the server lol
 
0
•••
unknowngiver said:
I dont know...Thats wt making me go all nuts too
lol
here is the code




Wow untill today i thought making forums and those scripts was easy :P lol now i know how hard php is :p

Try writing your own php template engine thats when the funs begins lol
 
0
•••
0
•••
lol dude this is my first day on PHP and i m doing it from my summer school lol

and i m in my TECH class..they are teaching me all the borin stuff {COREL DRAW!!!} SO YEA

i asked my COMPUTER teacher if he could help me wid this php since i m done the work and he was like...WHATS PHP
36_11_6%5B1%5D.gif
 
0
•••
Try that :)
PHP:
<?php

$d= date("M.I.S");
$t= date("G:i:s T Y");
$b= date(l);

echo "Today is" . " " . $b ;
echo '<br />';

echo "It's" . " " . $d ;
echo '<br />';

echo "and its" . " " . $t;
?>
 
Last edited:
0
•••
ah i was at college for a year but i left after the first year because it wasnt for me....

Access Databases
Excel Spreadsheets
Presenting Info (writing letters etc)

all stuff like that


and one time, my course director asked me to print off a copy of some coding i had done for a macro in a spreadsheet.... she said she wanted to look at it and learn from it and see how i had done it :-/ :-/ :-/

I didn't do a lot of learning lol

Also the course director was really biased, if you didn't do something her way, you were doing it the wrong way
 
0
•••
PHP is not hard at all comparing it to similar server side languages. You just need to get used to many functions and teach yourself on example by example basis.

Also, you do not need any books or tutorials other than spending some time on php.net/manual/en daily. W3shools is good if you never wrote a script, or you know only few things about the script sturcture basics, like defining variable, assigning it, using if/else.. :)

Good luck :tu:
just spend some time on php official manual ;)
 
0
•••
0
•••
I haven't touched the php manual :guilty: I learned most of what I know about PHP by correcting to original authors mistakes. :p :lol:
 
0
•••
0
•••
I have heard the guy is starting out, I do not think that when you start out in php you go directly with OOP and books, do you? :) So most likely, he has a long journey to do in the php manual before reading books.
 
0
•••
Dont waste your money on books. There are thousands of php tutorials on the internet, that are free and will teach you more, and explain more than any book.

http://codewalkers.com
http://webmonkey.wired.com/webmonkey/programming/php/
http://phpfreaks.com
http://tutorialempire.com
http://tutorialized.com

Most of the "php" related forums, will be nice and help out a noob.

Best way to do math in php:

PHP:
$n1 = "3";
$n2 = "5";
$domath = ($n1 + $n2);
print $domath;

That is how i do math in php... its the easiest way...
 
0
•••
Designporte said:
I have heard the guy is starting out, I do not think that when you start out in php you go directly with OOP and books, do you? :) So most likely, he has a long journey to do in the php manual before reading books.

Neither do I. Congratulations in just conjuring something up out of nowhere.

I was merely stating that books are useful for advanced techniques to counter these people that think books are a waste, when they clearly are not.
 
0
•••
Sorry, I thought you were not stating but you did disagree that books are not useful for newbies, and I was stating that he doesn't need any books --not that books are not useful-- But If he was asking for a php book, and I said that he doesn't need one, you could disagree then.

Thanks.
 
0
•••
k dude
my first script
www.extremewebsitehost.com/email.html
BUT There is a problem
no matter wt user writes in the SUBJECT line it still sends the email with the subject {NO subject}

here is the code {DONT STEAL IT}
email.html
<form action="mail.php" method="post">
Your Name: <input type="text" name="name" size="20"><br>
E-mail: <input type="text" name="email" size="20"><br><br>
To: <input type="text" name="id" size="20"><br>
Subject: <input type="text" name="subject" size="20"><br>
Comments<br>
<textarea name="comments" rows="1" cols="20"></textarea><br><br>
<input type="submit" value="Submit">
</form>

mail.php
<?
$name=$_POST['name'];
$email=$_POST['email'];
$header=$_post['subject'];
$comments=$_POST['comments'];
$to=$_POST['id'];
$message=$comments;
if(mail($to,$header,$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
 
0
•••
PHP:
<?
$name=$_POST['name'];
$email=$_POST['email'];
$header=$_POST['subject'];
$comments=$_POST['comments'];
$to=$_POST['id'];
$message=$comments;
if(mail($to,$header,$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>

Try that for mail.php.
 
0
•••
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back