redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
[!--quoteo(post=359057:date=Mar 27 2006, 11:53 PM:name=Masna)--][div class=\'quotetop\']QUOTE(Masna @ Mar 27 2006, 11:53 PM) [snapback]359057[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hey everyone. I just bought an Intel-based 20 inch iMac. So far, I really love this thing. And I may never go back to Windows. I was just wondering, does anyone else here use Mac OS? And if so, what do you think of it? Thanks in advance. [/quote] I'm torn on this one. After years of owning a PC, I bought a Mac PowerBook G4 (not Intel) for music recording at home and on the move. Aside from how it looks, which is never short of perfect, it's been a godsend. Easy to use on the surface, rock solid Unix under the bonnet, no need for drivers for most things, and loads OS X up in no time without then having to wait for the drive to stop motoring before you can resume some sort of normal activity, etc, etc However, about a month back, things went wrong. Not with warning, but one night I logged out as normal. The next morning I got BAD disk errors. Took it to the nearest Mac 'doctor' about 20 miles away. Was told that the problem is not uncommon for Macs, and I might have lost everything (I never took backups). Two years worth of song demos, company information, etc, lost for no apparent reason. However, I did get it all back using Disk Warrior, and managed to get everything backed up, but it has made me worry a little. Whilst it was getting fixed (takes almost a whole day for DiskWarrior to get a bad drive repaired) I got back into my Windows XP PC for work, and actually started to like it again. Not to mention the fact that it forces me to work in my office (and hence get some work done) as opposed to anywhere and everywhere i can take my powerbook which is normally where the distractions are... So I'm torn on this one still. If I can be reassured that these disk problems are indeed not common for a Mac, and maybe with more warning before the drive goes, then I might revert back 100% to my Mac for work, and not just music. Cheers Mark
-
Someone told me about this, not sure if it's been posted before. This is actually MICROSOFT'S OWN CSS SHEET: [a href=\"http://connect.microsoft.com/Styles/GeneralStyles.css\" target=\"_blank\"]http://connect.microsoft.com/Styles/GeneralStyles.css[/a] [code] /* fix for the IE 1px-off margin error */ * html .StupidIEMarginHack { margin-right: 1px; } * html .StupidIEWidthHack { width: 100%; } [/code]
-
Why Can't I Open PHP Files on My New Mac?
redbullmarky replied to Devious Designs's topic in PHP Coding Help
the terminal, unfortunately, is there to stay and you'll eventually become its best buddy. however. open a Finder window. go to your home directory. you see a directory called 'Sites'? this is where you create your sites. to answer your bonus question first: open a browser. type in [a href=\"http://localhost\" target=\"_blank\"]http://localhost[/a]. if you get an apache splash screen, it works. in a previous link, i gave you an OSX php installation. install it. create a PHP file in your 'Sites' directory containing: [code] <?php p h p i n f o ( ); ?> [/code] (remove the spaces in my code - for some reason, it wouldnt let me post this reply without them...) and run it. if youre using dreamweaver, then you don't even need to set up remote info, just local and testing server, using Local/Network where it says 'Access' where youre settign up your site. That's really all there is to it, unless something drastic is going wrong. Cheers Mark -
Please Help! Trying to create a football league system
redbullmarky replied to aaarrrggh's topic in PHP Coding Help
[!--quoteo(post=358966:date=Mar 27 2006, 06:32 PM:name=Samad)--][div class=\'quotetop\']QUOTE(Samad @ Mar 27 2006, 06:32 PM) [snapback]358966[/snapback][/div][div class=\'quotemain\'][!--quotec--] I think the only way to do that is to create a table for each user, you can specify table name to member's id so server would work faster and more reliable,also let user's to create just one table from a pc so you're dbs would be much,You can achieve this via storing member's ip address while creating a table for first time,and for next times check if this ip is stored on you database or not,if not let visitor to create a table, through a simple script,nothing much! grab informations and create a new table with leagues info. Samad For more info contact me: SamadBox@gmail.com [/quote] ? with all due respect: a) i think you've overcomplicated the problem b) you've introduced things such as IP addresses which aren't necessary and just make it even more complicated. c) what if aaarrrggh has a few hundred or a few thousand users? are you suggesting that he should have a complete new table for each user? d) isn't posting your email address taking the "post a request for help/recieve help+suggestions" idea away from phpfreaks? apologies to everyone if i seem a little narky and Samad if i've got you wrong, but surely keeping things as simple as possible is the best way? -
change from yyyy-mm-dd hh:mm:ss to yyyymmddhhmmss format
redbullmarky replied to JonathanAnon's topic in PHP Coding Help
[!--quoteo(post=358971:date=Mar 27 2006, 06:46 PM:name=JonathanAnon)--][div class=\'quotetop\']QUOTE(JonathanAnon @ Mar 27 2006, 06:46 PM) [snapback]358971[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi, i pull a timestamp from my mysql database and it is formatted as yyyy-mm-dd hh:mm:ss automatically. How can I convert this to yyyymmddhhmmss easily? regards, J [/quote] you mean just without the - and : ?? if so, this'll do it: [code] $date = "2006-03-27 18:54:31"; $date = preg_replace('/[\-\:]/', '', $date); [/code] -
Please Help! Trying to create a football league system
redbullmarky replied to aaarrrggh's topic in PHP Coding Help
[!--quoteo(post=358953:date=Mar 27 2006, 06:02 PM:name=aaarrrggh)--][div class=\'quotetop\']QUOTE(aaarrrggh @ Mar 27 2006, 06:02 PM) [snapback]358953[/snapback][/div][div class=\'quotemain\'][!--quotec--] The main thing I really need to know is how I can allow users to create new league tables using php/mysql. I've thought about this, and I think it might be possible to have one table with information about what league people are in and the name of the leauge, and another table that holds all the points information etc. I just don't know whether this is a good way of doing it or not, like, will I find the site slows down a lot when I get a larger number of people creating leagues on there? [/quote] a couple of tutorials may help here. the only good way for a new starter is the way that works. by the time your site builds up its popularity, you'll have built up your expertise to be able to make the correct judgements and adjustments to your scripts. [!--quoteo(post=358953:date=Mar 27 2006, 06:02 PM:name=aaarrrggh)--][div class=\'quotetop\']QUOTE(aaarrrggh @ Mar 27 2006, 06:02 PM) [snapback]358953[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm also going to have to work out the fixture list, which I can already see is going to cause me headaches... [/quote] this, believe it or not, will be the easy task. the first clue is that the working out has nothing to do with PHP, and the good news is that the code to work out the fixtures is (or should be) relatively easy compared to some of the other bits youre looking at. -
[!--quoteo(post=358949:date=Mar 27 2006, 05:57 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 27 2006, 05:57 PM) [snapback]358949[/snapback][/div][div class=\'quotemain\'][!--quotec--] However in most cases, if I wanted to edit a document that I had on your server, I'd just pull out my old copy, edit it, and upload it again, replacing the current one. [/quote] hi ober I'm beginning to realise that, apart from going down the WYSIWYG road as has been suggested, that this is going to be the only way around it, unless in the meantime someone discovers something as useful as AJAX has been that has been there all along... Still. I managed to sort my other problem out by being a stubborn git, so I've not given up just yet. If there are any more possible solutions to consider tho, I'd be very grateful to hear them, as ultimately it's going to be the simplest (for the end user) solution that wins. Cheers Mark
-
Please Help! Trying to create a football league system
redbullmarky replied to aaarrrggh's topic in PHP Coding Help
[!--quoteo(post=358931:date=Mar 27 2006, 05:32 PM:name=aaarrrggh)--][div class=\'quotetop\']QUOTE(aaarrrggh @ Mar 27 2006, 05:32 PM) [snapback]358931[/snapback][/div][div class=\'quotemain\'][!--quotec--] Nobody able to help?? [/quote] to be honest mate, it's a hefty project. and whilst it may not be that hard to do, it's a mixture of god-knows-how-many different things that all need looking at seperately. best bet? have a crack at it yourself and see where it takes you, as you're asking quite alot in one go... good luck Mark -
[!--quoteo(post=358927:date=Mar 27 2006, 05:03 PM:name=shocker-z)--][div class=\'quotetop\']QUOTE(shocker-z @ Mar 27 2006, 05:03 PM) [snapback]358927[/snapback][/div][div class=\'quotemain\'][!--quotec--] wysiwyg sounds like an editor that should do what your wanting.. [/quote] it is, but wysiwyg is very fickle depending on the browser, and most recruitment companies i have worked in generally ALWAYS use word. getting them to change their ways and methods could pose quite tricky, so i'm looking for ways around it. again, as with my previous problem, it must be as easy for my users as possible. expecting them to download, update and then re-upload is a tall order, so i need to make things as simple as possible. even if, in windows, it's possible to use PHP to force a Windows Explorer folder to open showing the FTP site where the CV's are kept. Just keen to get thoughts of anyone that's tried anything like this before... Cheers shocker
-
your problem as far as i can see is here: [code] if (mysql_num_rows($result > 0)){ [/code] what PHP does is evaluates the equation in the brackets first ($result>0) and then runs mysql_num_rows on it. $result>0 will return true or false, and mysql_num_rows(true) or mysql_num_rows(false) will both return errors. what you need: [code] if (mysql_num_rows($result) > 0) { [/code] hope that helps
-
[!--quoteo(post=358880:date=Mar 27 2006, 02:46 PM:name=Essjay_d12)--][div class=\'quotetop\']QUOTE(Essjay_d12 @ Mar 27 2006, 02:46 PM) [snapback]358880[/snapback][/div][div class=\'quotemain\'][!--quotec--] i need to use php to split code into two ways... if there are rows found from the search query then echo 'found' if there are no rows then echo 'not found' thanks d [/quote] [code] if (mysql_num_rows($result)) { echo 'found'; } else { echo 'none found'; } [/code] [b]EDIT:[/b] whoops beaten again. this post says 'delete me!'
-
Hi all Back to basics again.... I'm trying to come up with the best solution for laying out a table of an unknown height. My tables are currently being used for presenting a list, with x amount of columns. The table has a <TH> header. Now - whether my table has 2 rows or 1000 rows, I want it all restricted into a 100%x200px box. I've thrown my table into a 200 pixel high <DIV> which works to an extent. However, I want my TH to stay visible. The only way I can get it to work is to split the list into two tables - one for the header, and one (contained in a DIV) for the data, however, even if i specify column widths, the column labels in the header to not align properly (or neatly) with my data. THEAD, TBODY, etc worked to an extent, but no matter what i did, i got an ugly horizontal scroll bar which I really don't want. if i could get rid of the scrollbar along the bottom and keep the one on the right, then TBODY would be perfect. does anyone have any ideas? my target client is using a mixture of FF1.5 and IE6 so as long as it works in those, i don't mind for general compatibility. Cheers Mark
-
[!--quoteo(post=358864:date=Mar 27 2006, 01:56 PM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Mar 27 2006, 01:56 PM) [snapback]358864[/snapback][/div][div class=\'quotemain\'][!--quotec--] good arnt i lol [/quote] lol i've actually considered an online document editor but there can be no room for error - and whilst i'm not a microsoft fan, i'm not gonna knock the fact that MS Word is definitely the weapon of choice for my end users to edit the documents. Cheers though
-
yep it's not just you. any problems/suggestions/comments are all here: [a href=\"http://www.phpfreaks.com/forums/index.php?showforum=11\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showforum=11[/a]
-
set the 'action' of your form on your first page to the filename of the second page.
-
Hi all I'm developing a back-end recruitment package, and one of the features is the ability to attach a CV file (DOC, RTF, TXT, etc) to a persons record. This bit I can do, as well as the handling of the downloads, etc. What I want to know - is it possible to automate the process if someone wants to alter these files directly. The process at the moment is: 1, click the file to download 2, user edits the file 3, user has to re-upload the file to replace the one on the server. what i'm aiming for is the ability to edit the file and have it automatically update the version on the server, much the same as if the file was on someones desktop. is this possible at all? Cheers Mark
-
decimal/float numbers don't get rounded off unless you specify. [code] $a = 1.23; $b = 2.89; $c = $a+b; echo $c; // output is 4.12 [/code]
-
Help!!! How to show single image from mysql database
redbullmarky replied to jacobs's topic in PHP Coding Help
[!--quoteo(post=358807:date=Mar 27 2006, 09:42 AM:name=jacobs)--][div class=\'quotetop\']QUOTE(jacobs @ Mar 27 2006, 09:42 AM) [snapback]358807[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hello, thanks for the reply. Well above the random character, I did not see any error. Once I removed the changes I made the picture will be shown on the screen but in a really simple page format (white background and the picture itself). Do you think I have to encode the image ( I am using longblob type - I am saving the image into mysql database)? Do you have a simple example of how to load data from mysql? thanks in advance [/quote] youre pretty much doing it right, but remember that this script should only be used by calling it from elsewhere, and should not be embedded into your main scripts. so if the file you have got here is, eg, image.php, then you will need to call it via: [code] <img src='image.php?id=3' /> [/code] if you have this script inside a page that also draws other items, notably Tables, etc, then it will not work as Headers need to be sent BEFORE any other content goes to the browser. change $_POST to $_GET in your file, and call it as i shown you above. -
[!--quoteo(post=358789:date=Mar 27 2006, 07:44 AM:name=WillWill)--][div class=\'quotetop\']QUOTE(WillWill @ Mar 27 2006, 07:44 AM) [snapback]358789[/snapback][/div][div class=\'quotemain\'][!--quotec--] does no one know why my script doesn't work? [/quote] not exactly, but you can help us/yourself more by adding to this line: [code] $result = mysql_query($sql) or die(mysql_error()); [/code] the error youre getting is a result of a query failing, so $result is not being given the sort of value that stuff like mysql_fetch_row, mysql_num_rows, etc need. put: or die(mysql_error()); and it should reveal the source of your problems, and my money is on your query syntax. cheers Mark
-
Help!!! How to show single image from mysql database
redbullmarky replied to jacobs's topic in PHP Coding Help
hi there are a couple of things to check. 1, above all the random characters, can you see any error messages? 2, before this section: [code] Header( "Content-type: $type"); echo $data; [/code] type: [code] echo 'results: '.mysql_num_rows($result); echo '<br>'; echo 'type: '.$type; exit; [/code] you're looking for a non-zero number for result, and a correct MIME type (if $type is set from when the file was first uploaded from $_FILES['myfile']['type'] then it should be fine. -
Password Strength / User Availablity Scripts ?
redbullmarky replied to itssami's topic in PHP Coding Help
[!--quoteo(post=358545:date=Mar 26 2006, 05:15 PM:name=Hooker)--][div class=\'quotetop\']QUOTE(Hooker @ Mar 26 2006, 05:15 PM) [snapback]358545[/snapback][/div][div class=\'quotemain\'][!--quotec--] Try googling for some tutorials on ajax :) [/quote] Hooker is right. The first can be done with AJAX. The second (password strength) can be done with javascript, usually by calling a function with the onChange method. As for AJAX - [a href=\"http://www.ajaxfreaks.com\" target=\"_blank\"]http://www.ajaxfreaks.com[/a] is a good start... -
[a href=\"http://uk.php.net/stripslashes\" target=\"_blank\"]http://uk.php.net/stripslashes[/a] stripslashes (opposite of addslashes) generally will sort out all your slash problems. use it on a backslashed string before you output it to the browser and voila
-
output correct but repetitive code.
redbullmarky replied to OriginalSunny's topic in PHP Coding Help
[!--quoteo(post=358330:date=Mar 25 2006, 07:53 PM:name=OriginalSunny)--][div class=\'quotetop\']QUOTE(OriginalSunny @ Mar 25 2006, 07:53 PM) [snapback]358330[/snapback][/div][div class=\'quotemain\'][!--quotec--] I am trying to use that but it doesnt seem to work. The page doesn't load and just crashes. Am i using it wrong? while($row = mysql_data_seek($result,0)) { echo "<td>"; echo ''.$row['title'].''; echo "</td>"; } echo"</tr>"; [/quote] yes you're using it wrong here. what data seek does is returns the internal pointer to 0 or wherever you specify. so for example: [code] $query = "select * from thistable"; $result = mysql_query($query) or die('Whoops - '.mysql_error()); while ($row = mysql_fetch_assoc($result) { echo $row['Name']; } mysql_data_seek($result, 0); while ($row = mysql_fetch_assoc($result) { echo $row['Name']; } [/code] the above will print the same set of information twice without using two seperate queries/results. on a sidenote, the reason why your browser crashed with the code you used is because mysql_data_seek returns true if it's successful. As it had no problem working, it was always true so your while loop carried on going...and going... Hope that helps Cheers Mark -
$_POST[]; i want $_POST[$id]; like this
redbullmarky replied to blazing_bruce's topic in PHP Coding Help
[!--quoteo(post=358351:date=Mar 25 2006, 07:54 PM:name=ShadowOfSilence)--][div class=\'quotetop\']QUOTE(ShadowOfSilence @ Mar 25 2006, 07:54 PM) [snapback]358351[/snapback][/div][div class=\'quotemain\'][!--quotec--] I would have thought it would be like placing any other variable into it? [code]$_POST[$filName];[/code] [/quote] it is [code] $foo['bar'] = 'test'; $a_key = 'bar'; echo $foo[$a_key]; [/code] -
output correct but repetitive code.
redbullmarky replied to OriginalSunny's topic in PHP Coding Help
if you've already gone through all the results with a while loop, then you can just use mysql_data_seek to go back to the start. [code] mysql_data_seek($result, 0); [/code] [a href=\"http://www.php.net/mysql_data_seek\" target=\"_blank\"]http://www.php.net/mysql_data_seek[/a]