School Map:
Home / Enroll
$ Student Records; Class
$ News @ LIVE
Tech Radio * Support/FAQ
| Store | FORUMS
Class / Forums / php101 ![]() |
Week #9 Basic To-Do Assignment, post here |
(#16 2003-08-07 16:52:36) Post Reply |
|
TDavid
|
Week #9 Basic TO-DO ASSIGNMENT: Write a script to enter urls using a form and save the unique urls in a cookie for the current browser session, and then display the urls that are saved using the same script as active hyperlinks opening in a target window.
Post this assignment here so that we can offer comment/critique for you, but also post a URL to the working copy of the script and the complete source code of the script in your post. scriptname.php <-- script name Good luck to you!
|
(#99 2003-08-27 13:00:56) Post Reply |
|
Sk8rRIMuk
|
I enjoyed this one :P
My working example is at: http://www.katikai.com/ee/assi...0Assignment.php As usual all my past assignment attempts are at: http://www.katikai.com/ee/assignment Finally heres my code =): |
(#100 2003-08-27 13:02:10) Post Reply |
|
Sk8rRIMuk
|
Correction:
//If it has frint the URL's from the cookies thats meant to be print not frint :S so its: //If it has print the URL's from the cookies |
(#246 2003-09-18 07:54:18) Post Reply |
|
Shrek
|
A very difficult Assignment
http://members.lycos.co.uk/jef...wan/class09.php |
(#306 2003-10-10 12:19:57) Post Reply |
|
Quicksaver
|
sorry my lil lack of activity... been a lil adicted to counter strike (its awesome ;))
anyways i still have my week 8 advanced problem and now i have another problem on this one, i wont be making any more scripts untill i fix both of them, so i kinda need help on them ok, here's my code
so basically this happens on my online server. could that error be because of some limitation of the server or something because if i try that code here (localhost) it doesnt write the urls on the code so anyone help... oh and if i seem to be a lil inactive on the next times, im not dead :P just playin CS |
(#329 2003-10-23 17:18:56) Post Reply |
|
Quicksaver
|
well finnaly working, but this one beated me out, specially the part where it says "save only the UNIQUE urls" :)
working url |
(#545 2004-03-10 14:35:53) Post Reply |
|
Cyb
|
It seems not many people are posting here.
I think though this is a very great course (best I could find) and I do want to post my script because the scripts posted here are 100% correct according to the assignment. It took me much effort ;) but eventually this should be right. It checks each url on being unique (incasesensitive), adds http:// only if it wasnt there yet, can enter as much urls as the cookie size limit lets you etc. etc. ow and it doesnt use fuctions not described in the courses 1 to 9 yet. :) |
(#546 2004-03-10 14:38:55) Post Reply |
|
Cyb
|
blah why each time that problem with the " " missing :(.
mmm lets try again... this is the working url btw http://www.members.lycos.nl/tw...ieurlscript.php |
(#742 2004-11-15 17:44:59) Post Reply |
|
lestat
|
By looking at the posted examples, I'm not quite sure if I've done whats been asked for here. Working url - http://tdurl.com//m
P.S. What is this 'explose' business? It's only been mentioned briefly in a past tutorial. |
(#787 2005-03-06 12:28:32) Post Reply |
|
zman
|
This is the first one that I had a VERY hard time writing without using others code virtually ver batim... However, I never used anyone's code without knowing what it does, but with this particular assignment, the course education is beginning to fall short.
My basic assignment #9: |
(#790 2005-03-21 11:31:59) Post Reply |
|
lestat
|
Looking good so far zman. From this point on, the tutorials DO get a bit more challenging (IMO)
Do you have a working url for us to see etc? It helps a lot. |
(#841 2005-06-23 10:41:56) Post Reply |
|
vegyta2004
|
MY assignment:
File week9_basic.html: <HTML> <BODY> <form method="POST"action="week9_basic.php"> URL1:<input type="text"name="url1"><br> URL2:<input type="text"name="url2"> <br> URL3:<input type="text"name="url3"> <br> <input type="submit"value="Send URL-s"><br> <input type="reset"value="reset data"> </BODY> </HTML> File week9_basic.php: <? if(eregi("http://www\..+\.(com|ro|net|org)",$url1)) { if(eregi("http://www\..+\.(com|ro|net|org)",$url2)) { if(eregi("http://www\..+\.(com|ro|net|org)",$url3)) { $url=array($url1,$url2,$url3); $pack=serialize($url); setcookie("cookie_set",$pack,time()+3600); if($cookie_set) { $url=unserialize(stripslashes($cookie_set)); foreach($url as $key=>$value) echo"<a href=\"$value\">$value</a>","<br>"; } else {echo"you do not have ani info in your cookie";} } else{echo"your url3 is invalid";} }else{echo"your url2 is invalid";} }else{echo"your url1 is invalid";} ?> |
(#919 2005-12-31 19:58:54) Post Reply |
|
Dylan
|
I thought this was sort of hard too, but feeling good about getting it.
My working script is at http://www.algore.org/~admin/cookie.php And here's the code: |
(#977 2006-03-22 03:00:15) Post Reply |
|
Russell
|
i dont know if this actually set any cookies. ill find out next lesson if i got this cookie setting thing right...
|
(#978 2006-03-22 05:33:59) Post Reply |
|
Russell
|
ok, that first one wasnt what i wanted - and i realized i was calling the urls out of the cookie wrong so it doesnt work anyways :/ this one is a bit more what i was aiming for. and much simpler. a couple mental notes, when you use a header redirect the variables ($formfilled, $url, etc...) disappear. that had me scratching my head for a while. another thing that stumped me was that the cookies couldnt be printed on the same page they were set. i mean i set the cookies in the script and then the next line i was trying to use if($cookiename) and that wasnt working at all. so... heres my updated code.
|
|
View Previous Thread Print This Page |
School Map:
Home / Enroll
$ Student Records; Class
$ News @ LIVE
Tech Radio * Support/FAQ
| Store
Advertising
| Link To Us | Privacy
Copyright 2000-2002 Script School Productions / KMR
Enterprises
No part of this website may be reproduced, copied and/or distributed
in any medium
without express written permission