SitePoint Sponsor |
|
User Tag List
Results 26 to 50 of 76
Thread: Php for kids
-
Aug 23, 2008, 01:13 #26
Thanks SilverB, I appreciate your help.
I have a question about cookie, like the following :
PHP Code:setcookie("loggedin", "TRUE", time()+(3600 * 24));
setcookie("mysite_username", "$username");
-
Aug 23, 2008, 09:00 #27
// please don't forget to answer me on my question above too.
A new question : please check the following code:
PHP Code:if (!isset($_COOKIE['loggedin'])) die("You are not logged in!<br><a href=login.html>log in</a>");
$mysite_username = $HTTP_COOKIE_VARS["mysite_username"];
echo "you are logged in as $mysite_username.<p>";
you are logged in as .
why ???
-
Aug 23, 2008, 09:02 #28
- Join Date
- Aug 2008
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I highly reccomend "Lynda.com.php.with.mysql.essential.training" I learned a lot from Kevin Skoglund.
Like you, I already knew basics, like echo, print, and more advanced SQL (funny order), but then I learned how to do much more, and now I feel I can make scripts without singularly relying on if.else!
-
Aug 23, 2008, 09:50 #29
thanks cj1, this is what I'm learning now, but to be honest with you, I found that the script is more clear on w3schools.com, Kevin writes the script and show it like he talks to a programmer, not to a new one likes to learn php. I'm in chapter 6 now, so I will see if the things will be better in next chapters.
I hope from other members to not forget to answer my questions above.
-
Aug 23, 2008, 09:58 #30my mobile portal
ghiris.ro
-
Aug 23, 2008, 09:59 #31
Surely you'll pick up bad habits wherever you go, whether a video or an online tutorial. With both you're bound to pick up bad habits (though not always). You can't avoid them.
I look back at some of my early projects which I built when I was still getting to grips with PHP and getting my head round MySQL and database theory in general. Whilst the programs I made worked, they certainly were not efficient. So to be honest I think you just have to go through that stage of making mistakes.
As for my learning style, I generally prefer books. Tutorials tend to only give you the ability to create certain things in isolation whereas books have a bigger scope. Although at the same time if you just want a quick answer to something tutorials are better for that. With books you need to set aside time to read them, which is a drawback.Get your heelys now at flywalk.co.uk - But what are heelys?
Heelys are simply shoes with wheels in the heels!
Flywalk.co.uk - The UK Heelys Retailer
-
Aug 23, 2008, 10:11 #32
Thanks Ernie1, I little bit understand what you mean, also I did not found where is the problem to fix it ??
just to explain more, in login.php page, there is the following code :
PHP Code:setcookie("loggedin", "TRUE", time()+(3600 * 24));
setcookie("mysite_username", "$username");
Please don't forget that I'm beginnerand not expert like you.
-
Aug 23, 2008, 10:13 #33
Also:
If the register_globals directive is set, then these variables will also be made available in the global scope of the script; i.e., separate from the $_COOKIE and $HTTP_COOKIE_VARS arrays.
always use:
print_r($_COOKIE); to check if variables are set in cookie.my mobile portal
ghiris.ro
-
Aug 23, 2008, 10:15 #34
thanks themightystephen, I respect your opinion, but I can't find an easy book, do you know one ??? show the things likes w3schools.com ( where I understand the relation between php and MySQL in few days ), simple explication + example to understand how they work.
-
Aug 23, 2008, 10:47 #35
The first book I used was a Sitepoint book - Build Your Own Database Driven Website using PHP and MySQL by Kevin Yank. The book has what you want - an explanation and example to go with it. It's a while since I read it so I can't remember how good the explanations were but I remember finding it extremely useful in getting me going with doing exactly the what the book's title describes - building my own database driven website.
Get your heelys now at flywalk.co.uk - But what are heelys?
Heelys are simply shoes with wheels in the heels!
Flywalk.co.uk - The UK Heelys Retailer
-
Aug 23, 2008, 16:34 #36
thanks themightystephen.
I have a question about Notpad++, it's true that it can modify many pages in one time ??
-
Aug 23, 2008, 17:17 #37
- Join Date
- Aug 2008
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Oh right yeah, well if you are going to participate in talks on Forums in the future, then you will need to know some of the proper terms, such as concatination, functions, etc. etc.
I personally looked at w3schools first, and then once you read through that you need to move on to the Lynda training... like I said, I already knew basic PHP, most of the terms, and mysql, so it was easy to pick up.
After you have read w3schools, you NEED to see some proper coding... becuase then you can see some code you might really need... for example you can read about functions on w3schools, but can't see uses, globals, returning globals, and Kevin tells you what $_SESSION does for example (cookies), not just how to code it...
Also on the topic of bad habits, $HTTP_GET_(SESSION, COOKIE etc) have been changed to $_SESSION etc. and will be removed in the future PHP versions.
-
Aug 23, 2008, 23:40 #38
-
Aug 23, 2008, 23:45 #39
I post again my question for all:
I have a question about Notpad++, it's true that it can modify many pages in one time ??
I'm trying to keep all my questions in the same post, like that the way will be easy for a future PHP beginner ( like me now ) to find a lot of answers in the same post.
-
Aug 24, 2008, 01:45 #40
No body will answer my question about Notpad++
so let me ask you another question about ( register_globals = on ) in WAMP. it's no problem if I turn it ON ??? sure I know that I can change it from php.ini, but when it was off, I had some probelms like ( NOTICE : Undefined variable : username ) in the following line for example : setcookie("mysite_username", "$username");
I appreciate all time your help.
-
Aug 24, 2008, 08:23 #41
About your Notepad++ question...if you're asking whether you can have many files open at the same time, then the answer is yes. I use Notepad++. I definitely like it. It's got lots of nifty features and is quite a lightweight application (by lightweight I mean it is quick - it doesn't take a long time to load up).
Get your heelys now at flywalk.co.uk - But what are heelys?
Heelys are simply shoes with wheels in the heels!
Flywalk.co.uk - The UK Heelys Retailer
-
Aug 24, 2008, 08:51 #42
Also, for your other question about register_globals (taken from the php.ini file itself):
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
Basically it is best to turn register_globals off and use $_POST and $_GET to retrieve the data received from a previous page. For example, in your case you might need $_COOKIE['username'] instead of $username although I'm not sure.
See http://www.w3schools.com/PHP/php_get.asp for more information on $_POST and $_GET.Get your heelys now at flywalk.co.uk - But what are heelys?
Heelys are simply shoes with wheels in the heels!
Flywalk.co.uk - The UK Heelys Retailer
-
Aug 24, 2008, 12:00 #43
no, I did not mean that, because I have this feature in Dreamweaver CS3, but my question concerning the MODIFICATION of many php files for example in one click.
Think for example you have about 50 php files, they include a php code and I want to modify it in all the files in one click, it's possible ???
-
Aug 24, 2008, 12:51 #44
hemmm I followed your advice to make the script working without turn register_globals ON, but no way ( I tried many solutions, replace $_GET by $_POST, or by $_REQUEST, and nothing changed ) . also I learned on w3schools.com about $_GET and $_POST, and I found that $_POST more secure than $_GET, and that $_REQUEST replace the both.
So, for that, I upload my php pages in a ZIP file ( attached to this post ), to ask you and ask all who like to help, if it is possible to make it run properly without turning register_global ON ???
ZIP file includes simple register and login script.
Best regards and thanks in advance for you and other php experts.
-
Aug 24, 2008, 13:02 #45
- Join Date
- Dec 2005
- Posts
- 16
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I really like Zend's PHP 101: PHP For the Absolute Beginner.
Those tutorials teach all the right things and in my opinion teach them well. I think the articles are very well written and easy to digest.
-
Aug 24, 2008, 14:59 #46
I checked the website and saved the link, give me few days or about one week to give you my feedback, because I found many lessons and I have to check some of them.
thanks for your help, and welcome to any other members help, comments and advices...really I like this forum.
-
Aug 25, 2008, 03:14 #47
Hi for all, a new question please :
How can I check the data in a form before post it to the database ??
there is a simple way to check if the form still empty and show message says ( form empty, please write something ) ??
-
Aug 26, 2008, 03:07 #48
hi,
I'm soooo happy to build my first script ( Add Your Link ), you can check it on the following link : www.beginfromhere.com/php/addyourlink/
bigenfromhere.com is a website that I created just to share my experience in PHP with all who try to learn it like me.
please let me know your feedback, and till now no body answer me about my question ( register_global ) or checked my script that I attached it to my post in Aug 24, 2008 12:51 , to know how can I build it without turning my register_global ON ???
Best regards to all, and thanks for each one answered me in this BEST FORUM and tried to make PHP easier for me.
-
Aug 26, 2008, 03:11 #49
sorry I forgot something important about my first script ( Add Your Link ).
I build also a page to DELETE a link, but I hide it because the website online and it's danger to make it available for public.
NB: I can send you the link by a Private Message if something interesting to check it.
-
Aug 26, 2008, 06:02 #50
- Join Date
- Jun 2007
- Location
- North Richmond
- Posts
- 495
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
A little late on the thread, but a fantastic resource site for video php is PHP Video Tutorials. The creator of the site is an Aussie guy by the name of LeighMac. This site is absolutely fantastic and he has free lessons (no catches). Highly recommended.
Regards,
BJ Duncan
Bookmarks