Jump to content

Jack McKalling

Members
  • Posts

    1,606
  • Joined

  • Last visited

Everything posted by Jack McKalling

  1. I strongly recommend NOT passing multiple lines via the url. Infact, it CANNOT at all. :)If you want various lines to be posted/sent to the action page of the form, you must use POST method instead :)So replace the javascript with a multiline value in the url by just the url of the next page, but only open it after the data has been submitted instead of added to the url.
  2. JavaScript cannot access the server :)The only way to access them is to convert them into .js (javascript files) and add a reference to it at your document, or use PHP instead (like fopen(), fwrite() and fclose())
  3. take a look at the tutorials, there is a JavaScriptal ImageMap, explanation of <map> and an explanation of <area>.
  4. Fair enough :(You should insert session_start() at the top of the document, before everything, after the opening PHP tag <?php. After that, connect to your database. I take it you already have a table in it with member data? It should be there before you do this, and have at least a table with usernames and their passwords. And third, place the loginsystem. (Maybe you already have some code in your login document before the loginform, it goes between the system and the comment at its very bottom, the long green lines).1 Look for the added comment at the bottom of this code, and remove it after you carefully read it. Then write the two forms according to the notices, as follows. Do you understand these codelines? Notice the reds, they refer to the same reds in the loginsystem.2 If this document is not the only one that should be able to have the user logged in,Then split (in mind) the loginsystem into three parts: two times if(){} and one elseif(){}. Copy the third part,and past it again at the top of the document that also should have the login, always after session_start() and the connection with your database. Remember to replace elseif(){} by if(){} when it is left alone.3 When you're done doing these things, start thinking of replacing the remaining green parts by what they represent in your situation. Such as this_file, which should be myloginpage.php when the containing document is called "myloginpage.php". For those conditions at the login, it is dependant to what you have in your database. You can also check for age (if you don't let users under 13 years login), a certain username (give only permission to certain users), usersfunction (let only admins and moderators login), and many more. If you don't like to use this more advanced way, the condition could be as follows: ==========If this is still complicated, just give a yel :)When done you can use $_SESSION['logname'] in a php-section for the name of the logged in user. Also more values may be set after login, just add more $_SESSIONs at the top of the loginsystem, where you find them. You can then call them too at every logged in page (such as the age, the prefered skin color, etc)Edit: I forgot explain some greenlines
  5. You are right, it must not become unvisited at al costs.I wasn't aware of the allowance to request a post of a script at the site, why I only asked it for the forums.I PMed Kaijim with the question, awaiting response
  6. Whaha lol, just use my system (PM me any questions or problems)
  7. No really, I would like that too. If you consider doing so, I would be honoured to supply one or more PHP (or other language) scripts.Wherever they end showing up, if it is the site or the forum, I don't mind, in fact, the site would be better anyways :)But I assumed you (or kaijim) won't do such :)I'll send him something, thanks
  8. It would be nice if there was an area for PHP examples, here at the forum :)Not at the site in the tutorial, but here. (Also a link to this at the tut)It could be a subforum, or an 'important (stickied) topic' with a list.As a begin, I have an example already: many people want a login system, so I wrote mine, which I allow them to use as an example. (it can be found here)
  9. This is my homemade login system, you should not use it unless you specify your preferences Note: this in ONLY an example! /* ## Loginsystem by Dan The Prof © ## */if (@$_GET['login'] == "yes") /* ## Start Login (user input has been submitted) ## */{ $User = @$_POST['[color="red"]User[/color]']; $Pass = @$_POST['[color="red"]Pass[/color]']; $logsquery = "SELECT [color="blue"]Username[/color] FROM [color="blue"]Memberslist[/color] WHERE [color="green"]some conditions according to your preferences[/color]"; $logresult = mysql_query($logsquery); $loginrows = mysql_num_rows($logresult); if ($loginrows == 1) /* ## If username and password give permission ## */ { $_SESSION['permission'] = "Yes"; $_SESSION['logname'] = $User; $_SESSION['password'] = $Pass; header("Location: [color="green"]this_file[/color]"; } else /* ## If no permission is acquired ## */ { $errormessage = "Your haven't permission to log in here."; }} /* ## End Login script ## */if (@$_POST['[color="red"]Logout[/color]'] != "") /* ## Log out script (User clicked logout button) ## */{ session_destroy(); header("Location: [color="green"]this_file[/color]"); }elseif (@$_SESSION['logname'] != "") /* ## Update script (between pages check) ## */{ $User = $_SESSION['logname']; $Pass = $_SESSION['password']; $logsquery = "SELECT [color="blue"]Username[/color] FROM [color="blue"]Memberslist[/color] WHERE [color="blue"]Username[/color]='$User' AND [color="blue"]Password[/color]=password('$Pass')"; $logresult = mysql_query($logsquery); $loginrows = mysql_num_rows($logresult); if ($loginrows != 1) /* ## If account of logged in user has been updated ## */ { [color="green"]Error page display to your preferences[/color]; session_destroy(); exit(); }} /* ## End Loginsystem ## */ (...) // Lateron in your document, at the display of the login formif (@$errormessage) { echo $errormessage; }echo "[color="green"]Login form, where user should login (again).When submitted, variable 'login' is added to the url, with value 'yes'.Another form where you can logout, should be echoed here when someone is logged in.On logout submit, 'Logout' submitbuttonname should be posted to the next location.[/color]"; Blues are the database's datas,Greens are your preferences,And Reds are your login form inputnames.----Because I don't think this code is very easy, I'll supply a short explanation.This system is a program that should be loaded into the document that would be called when the user submits its login. It could be the same page, and that is what I did.The system is devided into three parts. Every part is a IF construction. The first is the part that logs a user in, the second logs the user out, and finaly the third part checks the users login after each page revisit.Remember the system is only at one page when it is needed at only that page. When more pages use the system you don't have to copy the whole thing to every page that requires it, but for security check, do add only the third part at every page (change the elseif into if in that case).
  10. Don't forget $_SERVER too, it holds information about some of your server settings such as the requested URI, the current URI or the name of your domain. (this comes in handy if you use the same script on different locations, and want to target a certain location variable to each current)You can read more about it at www.php.net
  11. Have you read the MySQL tutorial? It is about storing members data into a database for example, which you should use to have a login system (is there difference with it to a password system? )
  12. No, you probably have done something wrong then, this DOES enable everything Take a closer look at the tutorial, it is written there
  13. You'd definately need serverside languages when storing data of all users (and when having all accessible for other users).Check out the forums SQL and PHP :(Html can't DO anything, only view something. So you won't be able to store userinput by that language alone. You should take some lessons of the available tutorials They are very easy to read and learn, won't take much time, and, if you're interested in more there are always other tutorials :)To have a login system, you'd need HTML (or Xhtml) to make a page structure, if you want you could apply CSS on the page to have better control over the layout, you'd need at your server support for both PHP and MySQL, which are to script at the server in a safe way and communicate with your database.:blink:Alternatively, you can also use ASP instead of PHP for your serverside language, and Xhtml instead of Html. And finally you might choose for a clientside (at the user's browser) scripting language such as JavaScript or VBScript. Your choice :DI suggest you should begin with only Html and PHP, next start with MySQL
  14. Jack McKalling

    too many spans?

    But if you're planning making more 'buttons' inside a division or inlining, you should use classes because of the repeatedly having the same styles for different items.I also suggest not to use a span for the outer border, but instead, a block-level element like <div>. It can have width specified that is why (when no with can be assigned, e.g. when it is an inline element, alignment cannot be assigned either.)Besides, there are always alternates, you definately won't have to use so many spans, at least not inside eachother. :)Instead, something like: With this, you are able to have a division with class "whatever_border" that can have any style, and inside a number of real buttons, class "whatever_button", that also can have any style.It is just like the bar at the bottom of this topic, with the buttons "Repost", "Top", "Quote" and "Reply"
  15. According to my reading skills, you actually enabled everything :)But I still not really understand. There are two possible meanings of what you say, Shinta, the first is the left windowpart if the favorites/bookmarks is enabled and permanently visible in the window. On the other hand, there also is the menu option at the top of the window, like "File", "Edit", "View" and "Help". The first thing I cannot say anything about because I suppose it is different for every browser (and for IE I don't know script to close the bar)The second thing is something that cannot be shutdown, unless you shut down the entire menubar with all the buttons like "File", "View" etc (or the variants in another language).Edit: Even I don't know it is there, there may still be script that en- or disables the bar at the left side of the window, by the frame name.I hope this helped..
  16. Jack McKalling

    i need help

    Yes there is, it is just the way you use your html.Don't use a table for the sub or text, but use a table for (sub and text) field :)Some like this: Note that the use of <tbody> is not necessary unless you use <thead> too
  17. I suppose settype() is what you're looking for.You want to change a "string" into an "integer". That would be: (Nothing more nothing less )
  18. Jack McKalling

    DHTML

    Huh? whats the use of this?
  19. Jack McKalling

    i need help

    Then, the menu you pointed out, are in the examples of the Dhtml tutorial, if you are OK with the fact that most of them are Internet Explorer only :)Go have a look around here
  20. You can store the article in a file, but then its only needed to save its url in the database, while it is unique already :(What I meant was to both store the articles content and URL into the database, which is easier than creating files, in my opinion.That way, you can easily limit the size of the article, by simply defining a maximum of characters in a MySQL database table column.Your table could look like this: Author | Title | URL | Content--------------------------------...... | ..... | ... | ............. | ..... | ... | ....... But I suggest also storing the date(/ -time / time), and if you want some more statistics, you might need them later on :)But as far as I think, having all the data of each article stored in your database, will be safer and easier. After all, files that are creatred the way you describe, are not completely safe :)Are you OK with the idea of storing everything in the database?
  21. JavaScript cannot manage databases at all. It is client-side, and a database is server-side.So you'd have to use a server-side language too, like PHP or ASP
  22. Jack McKalling

    i need help

    If this is your first website, think of first read some of the tutorials at the site. Without, we can only code for you without you understanding it at all. You should actually be able to understand at least a bit of our code before we can make it for you:Else you can't enhance the code for yourself. We couldn't make you a complete site, could we
  23. @~Shinta:The favoritesbar or just the menuoption "favorites"?Of a favorites bar I've never heard, and collapse only one menu option is not possible :)By the way, all the disables of toolbars, menubars etc, will not work in FireFox; its bars work differently to Internet Explorer.
  24. You would have to own a database to store it because the alternate flat file would be awful in this case.Have a try at the MySQL tutorial for your database, after you checked if your server supports it (btw, I do can help you write the program if your sure you'd understand it)
×
×
  • Create New...