GingerRobot
-
Posts
4,082 -
Joined
-
Last visited
Posts posted by GingerRobot
-
-
Unfortunately, the recession hit somewhat hard here, and I face an uphill battle with employment anyway because of my disability (who's more likely to get hired: the guy who relies on other people for transportation, or the guy who can drop everything and work overtime if necessary?). Still, I'm working at it.
Sounds pretty nasty. How are discrimination laws over in The States? Here in the UK, it seems things have swung the other way a little; it seems to be quite common now for job averts to promise to interview any and all people with a disability for fear of appearing discriminatory. Now, im not being funny, but would they really interview you if you applied to be a brain surgeon, just because you had a disability?
-
All the while the teachers and ANYONE that could login using a password was able to view all this stuff. This is when I made a my first real program that did anything remotely productive. In this day and age that program would be called phishing. Basically I sent out a mass e-mail to all the teachers on Presidents Day (with the From header forged for the principal's email) with a link to a greeting card .. somewhere. It then immediately redirected to my script on my server (I know.. pretty insecure and retarded. but so were they) that resembled an incorrect login page that EVERYONE in the school was so used to. As you can imagine I programmed it to e-mail me their input and within a day I had at least 30 user/passes for my own personal unrestricted internet access at schoo
Brilliant, lol.
Did you get caught for that one?
-
What do you mean by 'combine'? Do you with your player array to contain two cars afterwards? If so, you need to make your player array a two dimensional one. I.e:
$playerSelected = array(); $playerSelected[] = array( 'manufacturer' => 'Toyota', 'model' => 'Celica', 'modexp' => '1200000', 'traction' => '500000', 'aerodynamics' => '3000000', 'acceleration' => '1500000', 'styling' => '6000000' );
You can then add a new car in the same vain as above;
$playerSelected[] = $carList[$key];
-
In answer to the question, the default visibility of attributes is public; if you do not say otherwise they will be accessible from outside the class. IMHO, PHP should throw a notice if you use a class attribute without having previously defined it. In fact, I was pretty surprised to see that it doesn't.
-
What is it that you are actually hoping to achieve? Writing object-oriented programs is more than just moving your procedural code inside a class. If you do that, all you are achieving is a higher level of "wrapping" of your code (by that, i mean your code is inside a function which is inside a class). The point of the object-oriented paradigm is to allow you to more easily build extensible self-reliant code. A class should (at least in theory) be an entity in it's own right; it should make sense and have a purpose. It should represent something. It shouldn't (as much as is possible) be dependant on another class or another piece of code.
In terms of writing classes for database interaction, one of the key points of this is usually to abstract away the particular RDBMS. For example, it shouldn't (in theory) matter if you are using a MySQL database, or PostgreSQL or whatever; the usage of your class should be the same. It should (again, in theory) facilitate the movement of RDBMS in the future. Ideally, it should handle errors and exceptions in your database, and should (probably) deal with cleaning your data before input.
The whole point of this spiel? There's no point writing a function that simply calls mysql_**** and putting it in a class.
-
It has an error. "There is no database selected" on this line
trigger_error(mysql_error(),E_USER_ERROR);
So...
What do you think you need to do?
-
@Mchl
I tried to replaced 'this' with 'regName'.
That will still not work for the reasons outlined by Andy-H.
@Andy-H
I tried your code. There were no error but still the values were not inserted.
Did you connect to the database first? In any case, add some debugging to your query:
mysql_query("INSERT INTO `table1` (id, fname) VALUES (1, '" . $regName . "')") or trigger_error(mysql_error(),E_USER_ERROR);
-
This is a simpler version of the procedure outlined in this FAQ: http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
Basically, use a counter in a loop and add the tags where necessary.
-
What do you mean by breaks? What actually happens? Also, you should be setting the content type with the header function if you're outputting to a browser.
-
I've not done this before, but i think what you're going to have to do is download the file using ftp_get to a temporary file on your webserver before offering it to the user for download.
-
That looks like you've overcomplicated the issue. Why are you executing the same query for various users. What is it that you're actually trying to do?
-
Well it's a similar kind of process to a hotel room-booking system, albeit on a smaller time-scale. I'd expect that you're more likely to find information on how to do this if you look into that problem instead -- it's more common.
-
REBUMP, I know this is probably against the rules but I really need help. I've waited for a month on different forums and am loosing my patients.
If you can't be bothered helping at least tell me what it is so I can google it.
Well that is because you appear to be asking for someone to do this for you. If that is what you want, i suggest you pay someone. If you want to do this yourself, i suggest you start learning a little PHP. Read some tutorials. Find out how to interact with a database from PHP. Find out how to process a form with PHP. You could try the tutorial section on this website: www.phpfreaks.com/tutorials
-
Without root access it's a bit difficult for me to do it. But in any case, i've arranged for a group to be created for this. Thanks anyway!
-
Do I need to set up an array, read the files into it, the somehow search for the word, delete it and rewrite the file without the missing word.
Err, yep. Pretty much. These are the tools you'll need: file, array_search, unset and fwrite
-
How are you planning on storing the data? You could either put the title and content into a database, or you could use a template and write the content to a file. Whichever method you choose, you'll need some basic form handling to do this -- do you have any experience of PHP already?
-
...and i dont waste any more time than is necessary, but im productive and have contributed lol
You do, unfortunately, waste everyone else's time owing to them having to spend twice as long deciphering your posts and, ultimately, ignoring what you've written because they can't read it anyway.
So if we consider the overall time spend on your posts, it would be much lower if you used a spell checker.
-
I tried to add those lines at the beginning of file to /etc/bash.bashrc but gedit didn't allow me to make any changes to this file. Save wasn't available, only Save As:
# Added by me to enable Apache Ant
EXPORT PATH=$PATH:/home/mainacc/tutorial/apache-ant-1.7.1/bin
EXPORT ANT_HOME=/home/mainacc/tutorial/apache-ant-1.7.1
If you want to add to the system-wide bashrc file (i.e. the one in /etc/) you'll need root access so you'll have to use sudo:
sudo gedit /etc/bash.bashrc
But I dont think you should need to make changes to this -- just use the one located in your home directory. This will mean the changes that you make will only apply to that user:
gedit ~/.basrhc
As for your java problem -- do you have any network access? You're obviously not going to be able to download a package if you're wireless isn't working and you don't have a wired network...
-
Long story short, i'm pretty sure the only way to restrict access to a folder to a bunch of users would be to add them to a group and set the group of the folder, which requires root access. Is this correct?
Full explanation, i'm just starting a group project at university and it was my intention to set up a Subversion repository on my university's server. Given that there is another group doing a similar project, I'd like to make sure that they couldn't get desperate and copy the entire repository over and view/steal our files. However, i don't have root access(obviously!) so I cannot create a group for the members of our team. Do I have any options?
-
Brilliant, reminds me of a story (on digg maybe) where some guys hacked a road-side sign to say something like "ZOMBIES AHEAD".
Haha. Yeah, i remember there was something like that on a welcome sign in the UK..."Welcome to wheverer. Now f*** off"
-
What are the A. and Z. before the terms?
They are aliases for the tables. It just means you don't have to write the full table name each time. You can specify a table alias in the FROM clause.
-
mrMarcus, i'm assuming that those are example values for various parts of the URL.
To the OP: you'll need to use regular expressions. You can use the preg_replace function to do what you want.
-
So what is your question? Does the above not work? What does it do? What doesn't it do?
-
Bit of a bizarre input format, but you could use ltrim with the optional second parameter to remove the 0s from the left side of the string, then divide by 100 and use the number_format function.
Shameless imitation
in Introductions
Posted
So continuing with the trend of an update from my original post:
I guess quite a lot of that's changed. For starters, i've not done much running at all this year. Mostly because i've had problems with my knees but also because i've been being pretty lazy.
I'm now actually at University, studying Computer Science. Not at Oxford, but Bristol. I guess maybe it's a shame I didn't make it into Oxford, but hey, I really like it here. Plus, I've a feeling the course at Oxford was a bit too theoretical for my liking. I'm in my second year now and really liking it. In terms of languages, we tend to focus on C and Java. Though, as i understand it, my next lecture will be to introduce us to some horrible, esoteric language called Occam. It's supposed to help with parallel computation I believe. Fortunately I think we only use it once!
To be honest, I spend much less time with PHP then i used to. I still try and drop in here as and when. It's usually when I really should be working :s In fact, right now I'm supposed to be writing up some coursework for my algorithms unit. Whoops.
Outside of my uni work, I spend quite a lot of time with my girlfriend. We've been together for just under a year now and things are going great. Plus of course the general university cycle of: drinking, lecture, hangover, sleep. Unfortunately not always in that order though.