-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Zane
-
Maybe I'm wrong or just going out on a limb, but would it not save more database space if you just created an array of all custom titles/values, serialized them, and base64'ed them.....then put that in its own column? Example or rows UserID - cFields 10 - fsdfg4564sd122fdd56d5f5454df5987799 11 - qdsafsda586455c15h5456f4e545r454f5 12 - m1c2v12t1v21251gfg212v121bh21jh21d Etc Note that isn't a real base64 hash
-
Vertically centering a Div in any screen resolution
Zane replied to departedmind's topic in CSS Help
if you use margin:0px auto; on a div it will be centered. -
why would your computer not boot from a Windows CD? your BIOS is set to boot from CD first, right? Well, if all else fails....and you have a spare working computer with a CD burner on it. I would download Hiren's Boot CD http://www.youtube.com/watch?v=jb5zYMaCnm8 click the More Info button when you get there
-
[SOLVED] Textarea info put into separate rows
Zane replied to shakingspear's topic in PHP Coding Help
$textarea = mysql_real_escape_string($_POST['textarea']); $array = explode("\n", $textarea); $i=0; $value = trim($array[$i]); if (!empty($value)) { foreach ($array as $value) { mysql_query("INSERT INTO random_prompts (prompt) VALUES ('{$array[$i]}')") or die(mysql_erorr()); $i++; } } ?> Your are using mysql_real_escape_string which I believe will turn \n into \\n so try exploding by \\n or \\r\\n but really, you should first explode it and THEN run mysql_real_escape -
It's just bad practice. This page describes it pretty well http://en.wikipedia.org/wiki/Global_variable
-
your best bet in this would be to return your $row array ... from collect like so function collect(){ $Get = mysql_query("SELECT Username from users WHERE UserID='{$_SESSION['UserID']}'") Or die(mysql_error()); return $row = mysql_fetch_assoc($Get); } $stuff = collect(); echo $stuff['Username']; Also since you're only searching for one thing in the database, you might as well just use mysql_result so .... function collect(){ $Get = mysql_query("SELECT Username from users WHERE UserID='{$_SESSION['UserID']}'") Or die(mysql_error()); return $theUsername = mysql_result($Get, 0); } $thePersonsUsername = collect(); echo $thePersonsUsername
-
you can make them global...not the most secure of programming strategies, but it will work function collect(){ $Get = mysql_query("SELECT Username,Level from users WHERE UserID='{$_SESSION['UserID']}'") Or die(mysql_error()); $row = mysql_fetch_assoc($Get); global $Username = $row['Username']; global $Level = $row['Level']; } collect(); Echo $Username;
-
you're going to need to put session_start(); at the very beginning of every page you want authorized...or restricted. Also you're login pages will need it too, even though they aren't restricted, session_start allows your login page to actually USE the session.
-
How to put the code inside post?
Zane replied to php_guest's topic in PHPFreaks.com Website Feedback
do you mean like this echo "Use the PHP tags"; ?> use the PHP BBcode tag [code=php:0]Your code here [/code] -
Ok, first off...yes....I'm straight up asking for homework help. But don't fret, it is nothing more than an interview. I am supposed to go find local business or check out my school's IT department or whatever. Either way, I'm supposed to hunt down a Tech Support person and interview them. Unfortunately, I'm snowed in, my car's out of gas and my license is revoked so I figured I'd get better responses out of the forums anyway. So..on with it. Ok, verbatim from the book it says I feel like I've committed a sin by asking for homework help, but this is honestly something I can't do on my own, as you can see. I feel as though I'm a tech support person myself being a part of the forums and all, but I don't think that counts and I really doubt I would be allowed to write about myself. So if you're a "tech support person", share you're input.
-
Yeah, you should be able to boot from a Windows CD regardless of whether or not you have Linux installed or not. Most likely you're CD is just...not good
-
You should be able to use the hover pseudo class on the TR tag. for instance in your CSS tr:hover { background-color:white; } you may or may not have some IE problems though, but if you did you could very well use a javascript fix to set the class of the particular TR tag to something else. then you can have tr.over, tr:hover { background-color:white; } Or if you please you could change only the background color. I suggest changing the class though
-
in PHP to get the current time, you simply use the function time from that you can store a list of unix timestamps, which you can convert to regular dates and times or you can use SQL to get the current time. For instance, in your INSERT query you can use the NOW() function which will give you something like this in your database 2009-01-08 23:50:26 so for example. you can go INSERT into tableName (col2, col3, col4, thetimecolum) VALUES ('stuff','stff','styff',NOW())
-
Awesome, was playing around with position and got it to work Customer's Full Name Select Builder ▼ style=" display:none; padding: 0px; margin: 0px; list-style-type: none; height:400px; overflow:scroll; position:absolute; top:30px; left:0; border:thin solid black; z-index:300; background-color:white; " > Suggestion Suggestion picture below Thanks for you guys' 2 cents, it helped me out. [attachment deleted by admin]
-
ok, so I did what you said blueboden. My idea at first was to have them like that. where the dropdown doesn't push everything down, but I'm having trouble with that. I got the textbox attached successfully, but I try to make the "containing divisions" relative, and the contents absolue I get the following attached image I'm not too up to snuff on how position works. I have a slight idea but, I couldn't consider it a sound one. I have to divs now, directly beside another. each of them are floated left and positioned relative. Inside each on is an absolutely positioned div. Nevertheless, the divs smash together. My HTML Customer's Full Name Select Builder ▼ Suggestion Suggestion and a little bit of the CSS #selectbuilder, #namespace { float: left; margin: 0px; padding: 0px; } #selectbuilder { border:thin solid; padding:2px; padding-right:3px; position:absolute; top:0; left:0; } #selectbuilder:hover { background-color:white; cursor:pointer; } #suggestions { position:relative; background-color: white; width:100%; margin-left:6px; border:thin solid #809FB3; border-top: none; } #suggestions ul { padding: 0px; margin: 0px; list-style-type: none; } #namespace { width:42%; margin: 0px 0px 0px 8px; } Any ideas why the divs are pressing together like they are in the attachment EDIT: I attached another image showing what happens if I click the sliver of the "Select Builder" button. It seems position absolute is working, but namespace and selectbuilder's container are colliding [attachment deleted by admin]
-
Simple button, for changing a single table value
Zane replied to xwishmasterx's topic in Javascript Help
I would use AJAX myself, if of course you're going to have a lot of these buttons. function startAJAX() { try { xmlhttp = new XMLHttpRequest(); } catch(e) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } } return xmlhttp; } function action(x, target) { var ajax = startAJAX(); var url = "update.php?id=" + x; ajax.open('GET', url); ajax.onreadystatechange = function() { if(ajax.readyState == 4) { target.value= "1"; } } // ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); ajax.send(null); } then have update.php do your updating and return the update, based on $_GET['id'] then make your buttons -
That's right, attach. I"m having a problem figuring out this secret of attaching this box to another box above whilst the above box has something floating beside...yeah that didn't make any sense to me either. So I took a snapshot(s). ..check them out Now you see I have a Select Builder dropdown and then a textbox beside it. my code for that looks like this Select Builder ▼ AJAXX Textbox Suggestion My question is now. What kind of CSS magic am I looking to do to get the AJAXX suggestion box to appear directly under the textbox (all the tme)...no matter if the dropdown is clicked or not. Because now when I click it. Well you can just see from the picture. [attachment deleted by admin]
-
Simple button, for changing a single table value
Zane replied to xwishmasterx's topic in Javascript Help
function changeCell(o, n) { o = document.getElementById(o) o.innerHTML = n; } </pre> <table> </table> <br><inut type="'button'" name="'change'" value="'Change" cell onclick="changeCell('2a', 'New Value')"></inu -
the files have to be in a virtual server where any MIME types are exempt from it....i believe. I could be wrong though, but that seems to me what the solution is. Otherwise if you try to have someone download a PHP file or an HTML file then they will be parsed by the server rather than sent as a file. your best solution: Google Virtual servers, and MIME type exemptions one example http://docs.sun.com/app/docs/doc/820-5704/6nh35mdbc?a=view
-
going on a limb here but try utf8_encode
-
This question is as broad as asking someone how to make soup. Show us your code, share your ideas, explain your environment. We're not making your soup for you.
-
you didn't need to change the title of your topic to have it moved. editing your post was sufficient.
-
I put a bitwise operator thread in the code repository a long while back. Pretty informative. Although it isn't a tutorial. Here it is http://www.phpfreaks.com/forums/index.php/topic,113143.15.html
-
Who, what, when, where, why and how. The key things. Minus the who of course since we know it's you, but What caused this error? Why do you need so many concurrent connections? When did this occur? was it random. Did you just upgrade to mysql 5 or something How did you solve this and not know where the problem came from?
-
It's not about having too many tables. Although the ideal thing is to have as few tables as possible while having the utopia of a management system running, you'e still going to end up with some "table overhead" regardless. The key thing is organization. 2 fields per table sounds horrible. Especially for 70 of them. That's a nightmare it seems like. I'm not SQL genious or anything, but yeah. gives me chills. The answer? Organize better. It's just like moving out of your home. Sure, it's great to have 70 boxes on hand, but you're not just gonna put to types of items per box. Hats and shirts in one box. socks and deodorants in another (mind you they're all the same sized boxes). I hope that made sense or I'm just too tired to make analogies now.