TeddyKiller
Members-
Posts
1,056 -
Joined
-
Last visited
Never
About TeddyKiller
- Birthday 06/10/1993
Profile Information
-
Gender
Male
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
TeddyKiller's Achievements
Advanced Member (4/5)
0
Reputation
-
I used a noscript html redirect to go to nojs.html Can anyone explain why this won't work. What should happen is, if javascript is enabled, it'll run whats in the script tags, hide the lblWarning and show lblMistake but this doesn't work. It just keeps lblWarning on display at all times. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="horble"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-language" content="en" /> <meta name="description" content="Horble is a social networking community targetted for people of all ages. Horble allows you to make a profile, look for your friends, and meet loads of fantastic new people! It'll target a more wider range of people than the common social networks. So get joining!" > <title>Horble Social Network - Javascript is not enabled!</title> <link rel="shortcut icon" href="assets/images/favicon.ico"> <link rel="icon" href="assets/images/favicon.ico"> <style> body { background:#cccccc; font-family:verdana,arial,sans-serif; font-size:12px; margin:0; padding:0; color:#000000; margin:0; padding:0; text-align:left; direction:ltr; unicode-bidi:embed;} #lblMistake { display:none; } a, a visted, a active { color:#e11919; font-weight:bold; text-decoration:none; } a:hover { color:#e11919; font-weight:bold; text-decoration:underline; } </style> <script type="text/javascript"> function valid() { document.getElementById('lblWarning').style.display = "none"; document.getElementById('lblMistake').style.display = "block"; } valid(); </script> </head> <body> <div style="text-align:center; padding:40px;"> <div id="lblWarning"> <strong>Javascript must be enabled to be able to run this site.</strong> <br /><br /> <h3>Microsoft Internet Explorer 6.0+</h3><div><ol><li>Click the <strong>Tools</strong> menu.</li><li>Select <strong>Internet Options</strong>.</li><li>Click the <strong>Security</strong> tab.</li><li>Click the <strong>Custom Level</strong> button.</li><li>Scroll down until you see the 'Scripting' section. Select the 'Enable' radio button for 'Active Scripting.'</li><li>Click the <strong>OK</strong> button.</li><li>If you see a confirmation window, click the <strong>Yes </strong>button. </li></ol></div> <h3>Mozilla Firefox 3.6+</h3><div><ol><li>Click the <strong>Tools</strong> menu.</li><li>Select <strong>Options</strong>.</li><li>Click the <strong>Content</strong> tab.</li><li>Select the 'Enable JavaScript' checkbox.</li><li>Click the <strong>OK</strong> button.</li></ol></div> <h3>Safari 2 or 3</h3><div><ol><li>Click the <strong>Safari</strong> menu.</li><li>Select <strong>Preferences</strong>.</li><li>Click the <strong>Security</strong> tab.</li><li>Select the 'Enable JavaScript' checkbox.</li></ol></div> <br /><a href="nojs.html">Reload</a> </div> <div id="lblMistake"> <strong>Your javascript is enabled, you must be here by mistake!</strong> <br /> Go back to <a href="http://www.horble.com">Horble</a> </div> </div> </body> </html> whats wrong? thanks.
-
I've heard the easiest method to displaying something if the users JavaScript is not on, is using no script tags. I want to display something to show the users JavaScript is off, rather than displaying the page. What can be done? I have used styles, so display: none; for the container of the site.. this worked but problem with this is you can view the source in the source code, it is likely you could edit the css and be able to gain access to the site. This is what I want to avoid. So, I could use the "exit;" command in PHP, although this exits even when JavaScript is enabled... so what it is doing, is running the php that's inside the no script tags anyway. So what I want to do, is display a message "Your JavaScript is turned off" and make sure that nothing else gets displayed and main site isn't in the source code. Can it be done? --- Sorry about it being in the wrong place, it's just.. well I was attempting to use PHP, so I thought it'd be php.
-
Yeah.. that does make sense. Which means my directory would have 4 directories with sub-directories inside them. Looks rather tidy. By doing what KingPhilip stated, it ends up being.. - public_html > - assets > - css > // CSS Files - images > // Site Images - js > // JS Files - cgi-bin > // CGI Dump - includes > // Config file, and necessary other includes - modules > // All site modules * Page names * Anyone else got any suggestions, opinions, advice etc?
-
My directory is full of clutter, and sometimes its hard to find what I need. My first question is: Does splitting things apart into separate directories where its more easier to read.. and find make performance better than cluttering it all together, or is it just personal preference? My directory layout is as follows - Public_HTML > - assets - cgi-bin - ima - include - js - languages - modules - profile - styles - template Assets and JS, both have JavaScript files in only. Modules have folders inside, of the modules on the site. eg: Admin Panel, Friends, User Messages etc which inside them folders would have necessary information and php files needed. Template, is basically.. junk. It's not needed at all. Profile, is again.. junk, because all profile related code, would go into the modules folder. Styles is CSS. I'm not sure how you'd lay it out.. but I would go something like.. - Public_HTML > - assets - css - cgi-bin - images - includes - modules Styles becomes css, JS goes into assets. "profile" ends up in modules, and so does languages... My second question is: Is there any advice you can give with laying out a site directory, also.. how would you lay out what I have gotten so far, using the directories mentioned at the top. Thank you!
-
Reading SITE NAME and Transferring Data SITE NAME
TeddyKiller replied to TeddyKiller's topic in PHP Coding Help
Sorry, I don't think I understand. Is there like a more detailed thread about this? -
Reading SITE NAME and Transferring Data SITE NAME
TeddyKiller replied to TeddyKiller's topic in PHP Coding Help
Viaing doing that, would have the transferring data from, or reading.. whichever? I read that loading images a directory.. eg: "images/" is quicker than going "images.site.com/images" or whatever. So why would splitting up content be.. better for high traffic sites? I understand dynamic content is like.. PHP, etc. Although what is Static? -
Reading SITE NAME and Transferring Data SITE NAME
TeddyKiller replied to TeddyKiller's topic in PHP Coding Help
You're right, sorry, didn't think. I don't really have any traffic at all, maybe about 50 unique a month. Though this will increase and I'd rather prepare myself before hand seeing as I'm redoing the plan of the site. I don't want it to be all cluttered you see. So, if they split up their content.. how are they using it? -
Transferring data from sub-domain.site.com Reading sub-domain.site.com What is this all about? I'm going to put all .. images into a separate sub-domain eg: images.site.com. This would create a folder inside my public_HTML called "images" Now when sites have that Transferring data, and Reading... is this .. something relating to what I want. Facebook also does it, and they get their images for the site from a sub domain, how is it all done? I'm not sure if its entirely PHP, but I hope someone can help. Thanks
-
Hide and Display using "style.display =" problems
TeddyKiller replied to TeddyKiller's topic in Javascript Help
Now if I uncomment all the lines, and have userEdit = document.getElementById("userEdit" + I); as userEdit = document.getElementById("userEdit1");, it actually hides every other information, but no textbox is displayed.. then when i click it again, the other information hides, and the hidden one from the last click gets displayed. Which.. makes no sense. I'm only using the ID userEdit1 once. It's set in a loop with $i so it can't possibly have it twice. Confused? -
I cannot read your code, it doesn't have the use of CODE or PHP tags. Also, please change all your "<?" opening tags to "<?php" Stop being lazy Notices, are quite often not very important, they can be turned off via having error reporting off. Although, in your notices, you are using a constant that isn't defined. Is this the following line in which the notices you are getting are occurring? if ( isset($_SESSION['url']) && $_SESSION['url'] != $SITE_URL ) { Shortening the above, it could be used as.. if($_SESSION['url'] != $SITE_URL) { because, if the session isn't set, well then it still wouldn't equal the site URL. Now as I can't read your code, I can't find out the exact problem. connect.php has the mysql connection, defines $SITE_URL, and does your code have session_start() anywhere? Other than them... I can't exactly find a fix with the code being so hard to read.
-
Comment these lines at the start out if ((!$_POST["topic_owner"]) || (!$_POST["topic_title"]) || (!$_POST["post_text"])) { header("Location: addtopic.html"); exit; } And do as Mchl stated with the echo. If this works, but doesn't work when the above line is uncommented.. then theres your problem. If the echo does get displayed, then it might be that Mysqli is having issues somewhere... (Sorry for reviving old post, it hasn't been noted if the problem has been fixed)
-
Hi. This uses PHP too. So basically I have a table of users, with a toggle button. The toggle says "edit" to start with. This should hide the users information, replacing it with textboxes. I'm not sure if its the best method to do it... but it's the only one I could think of. The toggle button after clicking changes to 'cancel' to cancel the editting. Okay so, the problem, I can get the information to disappear, but the textboxes don't get displayed, and I'm not quite sure why, it's like it isn't getting the right ID... This is my code. <style> <?php for($i = 0; $i <= 8; $i++) echo '#userEdit' . $i . '{display:none;} '; ?> </style> <script type="text/javascript"> function editUserData(AMOUNT) { TOGGLE = document.getElementById("toggle"); if(TOGGLE.innerHTML == "Edit") TOGGLE.innerHTML = "Cancel"; else TOGGLE.innerHTML = "Edit"; for(I = 0; I <= AMOUNT; I++) { userInfo = document.getElementById("userInfo" + I); //userEdit = document.getElementById("userEdit" + I); // Problem with if/else statement if(/*userEdit.style.display == "none" && */userInfo.style.display == "") { userInfo.style.display = "none"; //userEdit.style.display = ""; } else { userInfo.style.display = ""; //userEdit.style.display = "none"; } } } </script> echo '<div style="text-align:right; width:500px; margin:0 auto;"><span id="toggle" style="color:#e11919; font-weight:bold; cursor:pointer;" onclick="javascript:editUserData(\'' . $amount . '\');">Edit</span></div>'; echo '<table style="text-align:left; margin:0 auto; width:500px;" cellspacing="0" cellpadding="5" border=1>'; $i = 0; foreach($values as $field => $value) { echo '<tr><th width=150>' . $field . '</th><td><div id="userInfo' . $i . '">' . $value . '</div><div id="userEdit' . $i . '"><input type="text" name="' . strtolower($field) . '" value="' . $value . '" /></div></td></tr>'; $i++; } echo '</table>'; It works on a query, and an array of fields and answers, I didn't include that as that isn't the problem. My method is changing the display on the div, but it won't. Any ideas? EDIT - The commented lines in the javascript are what is breaking. What I have here, with those commented lines, works fine - but ofcourse, no textboxes get displayed as they are commented. If I uncommented them, the first click does nothing, the second click then hides it, but of course, by that time, the information is disappeared and "edit" is displayed, it should be cancel. So basically.. I believe the ID that the JS is retrieving, is an ID that is not used, not set, and neither has any css. So first of all, the if statement wouldn't work and would return the else, which will set a css for that ID as "none", meaning the next click... it will display, so the if statement is valid. So basically.. there is no CSS set for the ID the javascript is getting, and it won't even be displayed, because the ID it's getting is not used? If that makes sense...
-
Display and save last XX lines of a .txt file
TeddyKiller replied to TeddyKiller's topic in PHP Coding Help
Can you explain this code please, so i can understand it. Thanks -
Display and save last XX lines of a .txt file
TeddyKiller replied to TeddyKiller's topic in PHP Coding Help
Any help... still can't figure it out, or find anything on the web. -
Display and save last XX lines of a .txt file
TeddyKiller replied to TeddyKiller's topic in PHP Coding Help
It doesn't keep the last 100 lines.. it only keeps the last 1. It removes them.. i think one by one.. and boom.. only one remains, and yeah... it is working as words, instead of lines