redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
Problem with membership and login script.......
redbullmarky replied to lssjg's topic in PHP Coding Help
[!--quoteo(post=365946:date=Apr 18 2006, 12:20 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Apr 18 2006, 12:20 PM) [snapback]365946[/snapback][/div][div class=\'quotemain\'][!--quotec--] The only thing I can see wrong in there is here... $sql = mysql_query("INSERT INTO users (username, email, password, signup_date) VALUES('$username', '$email', '$db_password', now())") or die (mysql_error()); you have now())'' try '" . now() ."' and see what happens. [/quote] NOW() is a mysql function not php, so as far as i can see, this line SHOULD work. 4 fields and 4 values... -
PHP Nuke, Table semi-transparent background?
redbullmarky replied to DjSiXpAcK14's topic in PHP Coding Help
[!--quoteo(post=365876:date=Apr 18 2006, 04:55 AM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ Apr 18 2006, 04:55 AM) [snapback]365876[/snapback][/div][div class=\'quotemain\'][!--quotec--] use css to style it, and set everything. [/quote] businessman is right. its not a php question - its CSS opacity. i learned what i needed to from here: [a href=\"http://cssplay.co.uk/opacity/index.html\" target=\"_blank\"]http://cssplay.co.uk/opacity/index.html[/a] -
[code] $date = str_replace('/', '', $date); [/code] should do the trick nicely cheers Mark
-
[!--quoteo(post=365664:date=Apr 17 2006, 09:29 PM:name=cmgmyr)--][div class=\'quotetop\']QUOTE(cmgmyr @ Apr 17 2006, 09:29 PM) [snapback]365664[/snapback][/div][div class=\'quotemain\'][!--quotec--] Nope I'm not doing anything special to it at all. It works fine in IE, Maxthon, and Opera...just not FF...I don't get it. WIERD! [/quote] as you say the code is too big to post, feel free to email it to me and i can take a quick look if you like. redbullmarky@hotmail.com
-
[!--quoteo(post=365644:date=Apr 17 2006, 08:43 PM:name=davey01)--][div class=\'quotetop\']QUOTE(davey01 @ Apr 17 2006, 08:43 PM) [snapback]365644[/snapback][/div][div class=\'quotemain\'][!--quotec--] Used PHP 4.1 / 4.3 (admitted in some places the code is old and would be difficult for another programmer to work on it) MYSQL 3.23 [/quote] anything php 4.x upwards is fine. i'm still on php 4 mysql at the moment. i'm on mysql 4, but i don't actually have any sql that wouldnt work on 3.23 (i initially developed most of my sites whilst still on mysql 3.23). depends how complex it is. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] MYPHPAdmin (something like that) - i think from the year 2003 [/quote] same here. most of the changes over phpmyadmins lifetime are for cleaning up/optimizing etc and cosmetic. otherwise, even the old version does its job well. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] PHP and HTML is mixed together? (if there was no spec does, does this a good excuise for programmer to go down this route of mixing HTML & PHP? - the site is a complex one) [/quote] there's nothing wrong with that. sometimes its unavoidable. if the idea is to make it modular, then as long as the functions that pull all the parts together are structured correctly as agreed (ie, the include files) then it shouldn't be too difficult to decipher what's going on for another programmer. if he hasn't left yet, maybe you should get him to do a handover/overview of what he's done so far. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Built on his machine which i think is a linux but when uploads to server he has to change a few things as the set up is different - should he be making these two environments the same? [/quote] again, there's nothing wrong with developing on a linux machine and uploading it to a windows server and vice versa, in which case certain adjustments may need to be made. quite often, i also have my local testing server different to the 'live' server in terms of setup, as my local server has all the error reporting turned on, which you don't necessarily want to have on a live server. TBH without seeing the code or the site, it's hard to answer your question properly. hope it helps a bit tho Mark
-
[!--quoteo(post=365634:date=Apr 17 2006, 08:02 PM:name=cmgmyr)--][div class=\'quotetop\']QUOTE(cmgmyr @ Apr 17 2006, 08:02 PM) [snapback]365634[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have a users.php file on one of my sites that does't seem to show up in foxfire. It's just one big switch with a lot of different functions. Since the file is WAY too big to post can you please give me some sort of insight of this? I have used and altered this file for some other sites that I made and those seem to work fine...so I don't know why this on isn't. The live version is: [a href=\"http://www.SyracuseBands.NET/users.php\" target=\"_blank\"]SyracuseBands.NET[/a] [/quote] that's odd. even viewing the source shows absolutely nothing in FF and works fine on IE...i can actually think of only two possible causes: - you have some firefox specific code/includes which is causing an error (that is php errors, not html/css specific stuff). - are you using any PHP specific functions for handling the entire output? otherwise - not a clue. the browser really shouldnt affect the request sent to the server unless youre using IE-only specifics or are targetting certain browsers with certain code. cheers Mark
-
the same principles apply to many things, but here's an idea. building blogs is relatively straightforward, but can appear tricky if youre new to PHP. what information do you want for each blog entry? you need to think about content, such as the title, main text, date/time, user id (if youre not the only person posting), pictures, etc. the blog i use only has these 5 fields in my MySQL database: id - the record key public - this is set to y or n, and determines whether it's just a saved entry or whether it has been published. date - a timestamp of when the blog entry was created title - simple title for the blog entry entry - the text that makes up the main blog entry. of course, you could also use a plain text file or even a XML file if you know much about them instead of a mysql db. the principles are very similar with each. in some ways too, using a text file or a XML-type file would be easier than also having to learn MySQL. once you've planned how youre going to store the data, the whole process of putting the blog together is fairly straightforward. if you're using MySQL, then ANY mysql tutorial will get you the basics you need, including using SELECT/ORDER BY (for getting blog records to be displayed), INSERT (for creating new entries) and UPDATE (for editing existing entries). you don't need to go any further than that for now. once you've got the grasp of that, all you need to do (in HTML) is design a 'container' where a single blog entry will go. wrap it in a PHP 'while' loop to read all of your SELECTed entries from the database, using the 'echo' function to display the information you've read from a blog entry. ok, i've not gone as far as posting the code for you, but if you can get a clear idea of what you need and how it should look, the amount of PHP you need to get the whole job done is very minimal. hope that helps a bit, Mark [b]edit[/b]: i do have bits and bobs of a simple blog script i use (have a look at it working here [a href=\"http://www.crashandburn.co.uk/blog.php\" target=\"_blank\"]http://www.crashandburn.co.uk/blog.php[/a] and here [a href=\"http://www.thedinnertimes.com/columns/\" target=\"_blank\"]http://www.thedinnertimes.com/columns/[/a] ). youre welcome to have the scripts to have a look although for the sake of getting to grips with things and figuring it out, youre better have a bash at it yourself. if you want them tho, just drop me a PM.
-
[!--quoteo(post=365555:date=Apr 17 2006, 04:37 PM:name=php111)--][div class=\'quotetop\']QUOTE(php111 @ Apr 17 2006, 04:37 PM) [snapback]365555[/snapback][/div][div class=\'quotemain\'][!--quotec--] Is there any C/C++ forums? Since this isn't the right place. I'm not any good with search engines to tell you the truth. What is the best book to buy from the bn store? Thanks for the info. [/quote] a quick google search gave this: [a href=\"http://www.cprogramming.com/tutorial.html\" target=\"_blank\"]http://www.cprogramming.com/tutorial.html[/a] looks fairly useful.
-
[!--quoteo(post=365551:date=Apr 17 2006, 04:26 PM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ Apr 17 2006, 04:26 PM) [snapback]365551[/snapback][/div][div class=\'quotemain\'][!--quotec--] I am studying a book over at [a href=\"http://www.hudzilla.org/phpbook/read.php/2_6_3\" target=\"_blank\"]http://www.hudzilla.org/phpbook/read.php/2_6_3[/a] On this specific page of the studying material I ran across a php command called heredoc. Allowing you to put whatever words you want to, I test it out using all forms of words, and it still worked, also his exampled worked as well, I tried searching the heredoc statement on php.net and it didn't come up, I also searched delimiter and couldn't find anything. I was hoping someone could point me in the right direction to find that heredoc I like cross referencing everything I go through with the manual. thanks. [/quote] it's not really a command but a general description/term for the method used to implement sticking free text into your code. [a href=\"http://uk.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc\" target=\"_blank\"]http://uk.php.net/manual/en/language.types....syntax.heredoc[/a]
-
[!--quoteo(post=365547:date=Apr 17 2006, 04:18 PM:name=php111)--][div class=\'quotetop\']QUOTE(php111 @ Apr 17 2006, 04:18 PM) [snapback]365547[/snapback][/div][div class=\'quotemain\'][!--quotec--] I really wanted to make computer programs and OS's. How long does it take to learn C? Is C+ still around? What is C++ used for? What do i need to learn before C? Would i ever need C+, C++, Assembly and everything else? Is there basic tutorials as beginners to advanced or do i need to buy books? [/quote] i'd say PHPfreaks is an odd place to come if you wanna learn C/C++, but: 1, [b]How long does it take to learn C[/b] - depends if you have any prior knowledge of programming. the most difficult thing for people to grasp it seems is the process that a program goes through to get things done. ontop of that, it's about understanding what you want to do and learning the functions to do it. C++ was taught to me to a pretty good level in a 2 year, 2 hours a week college course. 2, [b]Is C+ still around? [/b] if it's the same as C++, then yes. 3, [b]What is C++ used for?[/b] programs. both games and applications. Doom/Quake etc are written in C++ as are many web servers/packages/browsers. (isn't PHP written in C++?) 4, [b]What do i need to learn before C?[/b] patience. 5, [b]Would i ever need C+, C++, Assembly and everything else? [/b] you can safely knock up entire apps with C++ alone. Most C++ packages i've used actually support inline Assembly (allowing you to stick assembly language right into the code) but this is fairly unnecessary in the first instance. only when it comes to having a severe need for speed is assembly necessary, as C++ is a fairly low level language itself. 6, [b]Is there basic tutorials as beginners to advanced[/b]Google is your friend [b]or do i need to buy books?[/b] reading is good too.
-
how to get php on server to clear client screen
redbullmarky replied to gfridd's topic in PHP Coding Help
[!--quoteo(post=365401:date=Apr 16 2006, 10:15 PM:name=gfridd)--][div class=\'quotetop\']QUOTE(gfridd @ Apr 16 2006, 10:15 PM) [snapback]365401[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have a php process running on the server that generates a webpage for the client's browser, does some calculateions and lookups, then I want it to clear the client's browser window (same one) and replace it with what the php process calculated. The problem I can't solve is how to blank that window before sending a new set of HTML to create the new window. What happens with whatever I have tried is that the new HTML jsut tacks onto the HTML that's already there. Anyone know how to do this? Thanks! [/quote] 1, you say the new HTML tacks on to the end, but how are you currently sending the HTML to the browser? 2, is the process automated, or does it require the user to click/select/type something before the new page is requested? -
here's a list of books recommended in a previous thread: [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=58799\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=58799[/a] i personally recommend only a handful of sources: - Book - 'PHP and MySQL Web Development' by Luke Welling and Laura Thomson - Book - 'DHTML and CSS' - Jason Cranford Teague - [a href=\"http://www.php.net\" target=\"_blank\"]http://www.php.net[/a] - the manual - phpfreaks / phpfreaks forums - Google these five sources have taken me from a complete noob to fairly competent in just over a year. It takes alot of time and patience but it's more than possible. Cheers Mark
-
[!--quoteo(post=365505:date=Apr 17 2006, 12:41 PM:name=BrknPhoenix)--][div class=\'quotetop\']QUOTE(BrknPhoenix @ Apr 17 2006, 12:41 PM) [snapback]365505[/snapback][/div][div class=\'quotemain\'][!--quotec--] I need to get the properties of a PCX file, such as color depth, but php doesn't seem to have a lot of support for pcx files. Is there a way to do it? [/quote] if all you're after is the info of the file, then fopen/fread functions can be used to construct something to read the header of a PCX file. a quick google search for 'pcx file format' gave me this: [a href=\"http://courses.ece.uiuc.edu/ece390/books/labmanual/graphics-pcx.html\" target=\"_blank\"]http://courses.ece.uiuc.edu/ece390/books/l...aphics-pcx.html[/a] which although has nothing to do with PHP, it'll show you what each bit of info you retrieve with 'fread' means. taking a guess from that link, , it looks like the colordepth is 3 bytes in. so: [code] $file = f open($filename, 'r'); f seek($file, 3); $depth = f read($file, 1); f close($file); echo 'depth is '.$depth; [/code] [b]note:[/b] i've added a space in the fopen/fseek/fread/fclose functions in my example as it wasn't letting me post my reply. obviously just remove these first. if that works, it'd be easy enough to get the other info from the file you need. cheers Mark
-
[!--quoteo(post=365517:date=Apr 17 2006, 02:07 PM:name=MrWicked1)--][div class=\'quotetop\']QUOTE(MrWicked1 @ Apr 17 2006, 02:07 PM) [snapback]365517[/snapback][/div][div class=\'quotemain\'][!--quotec--] ok i see the left function its in the file called "left_mem.php" in the php file that uses the left function include_once "left_mem.php"; is at the top, why isent it working? [/quote] have you checked that 'left_mem.php' file is on the server and your 'include_once' path is correct? sometimes, depending on the error setting, you wont get an warning if the file fails to be included but will get an error if some of the functions required for your main script to run aren't found. worth a double check as i've had this problem once or twice in the past.
-
hi the error would be occuring as you have no check in the event that the picture is NEITHER format. add an extra trap to cater for the event that the picture is not of any valid format. cheers Mark [b]edit:[/b]also, this bit wont work anyway as far as i know: [code] @imagecreate($filename); [/code]as 'imagecreate' requires a width/height, not a filename.
-
Need help with mktime() error in functions.php
redbullmarky replied to Radzy's topic in PHP Coding Help
hmmm i tried your function out, as well as using strings, etc with mktime and couldnt reproduce your error. - what version of php are you using? - what is the level of error_reporting you have in your php.ini? you can find out with this if youre unsure: [code] echo ini_get('error_reporting'); [/code] apart from the warning, does the function still do its job? i think there's a function to force a datatype onto a variable, but not sure - you can use this though to force a numeric string into an integer - just add zero: [code] $number = "12345"; $now_numeric = $number + 0; [/code] [b]edit:[/b] function for forcing integer is 'intval' [code] $number = "12345"; $now_numeric = intval($number); [/code] hope that helps Cheers Mark -
[!--quoteo(post=365432:date=Apr 17 2006, 03:39 AM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ Apr 17 2006, 03:39 AM) [snapback]365432[/snapback][/div][div class=\'quotemain\'][!--quotec--] I had one more question. Is ajax worth learning, and if a website is built with ajax does it make it automatically load. thanks for the answers, I didn't expect anyone to answer them all, but all the answers helped, thanks. [/quote] yes it is, for definite. i'm not sure of the exact techniques used (ie whether it's AJAX or some other methods) but there are two particular examples i've seen recently that really demonstrate AJAX capabilities very well. 1, Yahoo Mail have an option when you sign in to use a 'beta' version, which works very much like a "normal" email client. instead of clicking a mail that loads a new page to display it, it shows the email in a pane at the bottom. granted, this could be done with iframes and JS, but it'll give you the idea. [a href=\"http://mail.yahoo.com\" target=\"_blank\"]http://mail.yahoo.com[/a] 2, google calender. probably the best online calender i've seen. i was playing around with it for a good 20 mins or so without so much as 1 page reload. the whole thing just feels like a proper application and not a web-based app. [a href=\"http://www.google.com/calendar\" target=\"_blank\"]http://www.google.com/calendar[/a] [b]edit:[/b] [!--quoteo(post=365432:date=Apr 17 2006, 03:39 AM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ Apr 17 2006, 03:39 AM) [snapback]365432[/snapback][/div][div class=\'quotemain\'][!--quotec--] 22. What is the height of php knowledge, how will I know when I can say I have mastered php. I have being using PHP for about 2 years now and I'm still learning but I have not mastered it as I havn't learnt every single function, configuration setting or developed enough apps to be a master. No one can really say they have mastered PHP. as i say - they may or may not use AJAX in its known form, but the way they work is a very good example of what can be achieved. [/quote] i've actually been working with php probably only half of what wildteen has, but i think i actually enjoy learning and earning as i go along. as with most things i've "mastered", i'm bored of them. whilst i'm still learning, i stay interested. an academic only properly masters their trade when they're hands on, not when they're studying. you have to make mistakes as well as doing things perfectly, else you'll be screwed if something goes wrong. i reckon the day you 'master' php is the day when you lose interest in it and go off to learn something else. now that would be a waste of time... cheers Mark
-
How to check the value of $_GET and see if its = to something?
redbullmarky replied to flamerail's topic in PHP Coding Help
it means that the file does not allow the required permissions to modify (ie, rename) the file. take a look at [a href=\"http://www.php.net/chmod\" target=\"_blank\"]http://www.php.net/chmod[/a] for more on permissions -
[!--quoteo(post=364926:date=Apr 14 2006, 11:26 PM:name=coldkill)--][div class=\'quotetop\']QUOTE(coldkill @ Apr 14 2006, 11:26 PM) [snapback]364926[/snapback][/div][div class=\'quotemain\'][!--quotec--] ::SOLVED:: [/quote] care to explain how? its a hit and miss one for me sometimes, as i'm sure sticking '!important' at the end of all my definitions is not necessarily the best way... cheers Mark
-
[!--quoteo(post=365362:date=Apr 16 2006, 08:05 PM:name=baber_abbasi)--][div class=\'quotetop\']QUOTE(baber_abbasi @ Apr 16 2006, 08:05 PM) [snapback]365362[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks. Can you tell me how an image size can be changed?? Like I have an image and I need to change its width/height, which function can do this?? and change without breaking its pixels. Thanks again. [/quote] imagecopyresized is the quickest way, imagecopyresampled is the neatest way. [a href=\"http://www.php.net/imagecopyresized\" target=\"_blank\"]http://www.php.net/imagecopyresized[/a] [a href=\"http://www.php.net/imagecopyresampled\" target=\"_blank\"]http://www.php.net/imagecopyresampled[/a] both functions take exactly the same parameters. only final difference is the quality. you'd be good to have a good look through the user notes and other functions whilst you're there as you'll be able to pick up quite alot in one go. hope it helps cheers Mark
-
[!--quoteo(post=365251:date=Apr 16 2006, 09:40 AM:name=shocker-z)--][div class=\'quotetop\']QUOTE(shocker-z @ Apr 16 2006, 09:40 AM) [snapback]365251[/snapback][/div][div class=\'quotemain\'][!--quotec--] Where are you getting the variables $collected, $change and $user from? [/quote] hi you can help yourself even more just by putting in one more bit on one of your lines: [code] mysql_query($query_1) or die("The change could not be made - ".mysql_error()); [/code] that will tell you what the error is as well as your 'change could not be made' message. try it and let us know what your result is.
-
[!--quoteo(post=365241:date=Apr 16 2006, 08:34 AM:name=AndieB)--][div class=\'quotetop\']QUOTE(AndieB @ Apr 16 2006, 08:34 AM) [snapback]365241[/snapback][/div][div class=\'quotemain\'][!--quotec--] Follow-Up question: In Sweden we tend to use the , (comma) as a separator for decimals. I've noticed that PHP will not accept me doing a calculation using the comman (,) sign. (ie 30000 * 1,25), I must do this (30000 * 1.25). Is this something one can change or do I have to live with it? Thanks 4 any kind of help! --Andreas [/quote] as far as i know, you have to live with it, just like all us non-americans have to get used to spelling the word 'colour' without the 'u' :)
-
can you not simply lift out the relevent code from the PEL/JPEG Toolkit, or at least use them to suss out how it works?
-
[!--quoteo(post=365153:date=Apr 15 2006, 09:23 PM:name=phileplanet)--][div class=\'quotetop\']QUOTE(phileplanet @ Apr 15 2006, 09:23 PM) [snapback]365153[/snapback][/div][div class=\'quotemain\'][!--quotec--] Google has finally released their web-based [a href=\"http://www.google.com/calendar/render\" target=\"_blank\"]calendar[/a] app; it's pretty cool! [/quote] i had a look at that when i heard about it the other day. had no real interest in using it but a big part of a site im doing at the moment revolves around diary/planning, so was interesting to see how they've got it so 'interactive'. seems that loads of sites are jumping on the AJAX/DHTML bandwagon (anyone seen the beta Yahoo mail?) and it's making life alot easier and interesting, without even a hint of Flash...
-
PHP code to copy a file from one directory to another?
redbullmarky replied to Dhira's topic in PHP Coding Help
[!--quoteo(post=365161:date=Apr 15 2006, 10:12 PM:name=Dhira)--][div class=\'quotetop\']QUOTE(Dhira @ Apr 15 2006, 10:12 PM) [snapback]365161[/snapback][/div][div class=\'quotemain\'][!--quotec--] What is the copy() function? ie what is the code I need to do that? [/quote] from the manual....[a href=\"http://uk2.php.net/copy\" target=\"_blank\"]http://uk2.php.net/copy[/a] [code] copy($source, $dest); [/code]