Jump to content

keldorn

Members
  • Posts

    340
  • Joined

  • Last visited

    Never

Everything posted by keldorn

  1. That part would be the conspiracy, the math/numbers of how it operates is not however. Money really does only get into circulation from loans. That can be easily verified by reading the economic books.
  2. Yep. I already seen that. I actually knew the gist of it when I 14 how money works, becuase i was interested in economics and was reading collage economic books. Money is released as loans, with interest, the money to pay the interest doesn't exist. So the only way to pay the interest is take out another loan. Hence why everyone has huge credit card debt, and the national debt in the US is at 11 Trillion, that debt will only get larger. The money in your wallet isn't actually money, its debt that someone else borrowed or maby you borrowed it. The monetary system is a scam. Its funny that something everyone uses everyday and nobody can be aware of this!, Its not conspiracy, just read the economics books its there in fine print how it works, lmao! You might also like this video, http://www.youtube.com/watch?v=vVkFb26u9g8
  3. I did not want to use cms like Wordpress or Joomla neither, I make my websites from scratch. Its not that hard to make a simple website that pulls up your content from a DB. Create a database and create a table that holds some stuff like the id, title, body. Then create page thats using something like fckeditor and you post to it, and then create a php file to take the post and insert into the database. Then create a file called like article.php and it takes a $_GET like aritcle.php?id=1, which then you grab the stuff in the database where the incrementing ID = 1, then you put the details into the page. For basic concept its really that simple. Except next you will probably want to protect the file with a login and create some more stuff that allows you edit a existing article or save it as draft and also delete article and maby create some categories and recursively name them threw another table that hold a number and a name while the article table will hold just the number. blah blah, its kinda complicated with all the small details. But its really not complicate just get few thousand lines of code it should take more the 8-10Hrs a day for a week. xD
  4. I wouldn't discredit yourself. Really it is something that is not common. Most people who run websites can't code, some people say they know PHP, but they dont. They think bcuase they change a variable in a pre-made PHP script their automatically a programmer. I would venture to say most webmasters are using opensource scripts or paid scripts. Really the fact their running a website is only becuase of genius of some other person.
  5. I remember the days when you would go onto Google or Yahoo and search something and lots of the geocities sites would be up, or just those "Homemade" pages someone put their heart into and made, maby their were knowledgeable on the subject. Today, there gone, instead now when I search. I get pages with nice templates but with more often then not, crappy content squieezed in around an Advertising block like Adsense, they call em Adsense spam sites.
  6. I used host my own server when I was learning. haha no-ip.com. and whole installing the lamp stack and figuring it all out. I don't think now it would be possible. Can you push a few TB threw a home cable modem a month? I think if it were my ISP would be a bit worried of my bandwidth consumption.
  7. So are you hosting your own dedicated server or not? You seem to be contradicting yourself. Or are you saying you own fdcservers.net? Own a datacenter, I wish. Maby you dont understand how hosting works. A datacenter is a facility hooked up to a internet backbone. A hosting company could be just a person renting or collocating a few boxes in that datacenter, Most shared hosting businesses are exactly that. So saying, I'm my own hosting company, is just mostly a joke or sarcasm. Although datacenter themselves also offer hosting, but not in the form of shared hosting, they can rent you a dedicated server or VPS, alternatively you can drive there too and bring your own hardware and they hook it up. Yeah colocated is more cheaper, but I'm not doing that. I'm renting a box that I do not own either.
  8. $3108/year isn't exactly free...259$ a month? That isn't exactly a trivial fee. How can it cost so much for hosting your own server? After you bought the initial (computer), what more is there? Electricity, place to house the computer, and internet. Internet is ...80$ month which should be plenty fast for you unless you have a huge website/using tons of bandwidth. Electricity? Really can't make up for the other 179$. Yeah 259 a month, its in a datacenter in Chicago,United States @ www.fdcservers.net . The bandwidht there is so cheap is like water! Really I'm not kidding. It not a trivial fee though is it, but my websites make enough to pay for themselves. So its good.
  9. lmao! You got suspend for doing a math problem and hogging all the cpu or something. That is hilarious man! This is why I have a Dedicated server, I can't shared hosting, can't even stand VPS. Basically I can't stand being limited, I need full access and run of my environment. Core 2 Quad Q6600 8GB ram 1TB harddrive. Costs, $3108/year I am my hosting company.
  10. You ain't kidding man, what the hell. This is valid? "first\\last"@example.com The request for comments idea of what a valid email is border on crazyness. Well along as they provide the insane validation function, all is good.
  11. $email = "foo@example.org"; preg_match('/^[^@]+/', $email, $match); echo $match[0]; // foo This will also match this. &#(*$&(*#&$(&(#&$(&(#&$&@example.com I would only use that if you pulling the email from a database and are already sure it was validated before being put into the database.
  12. ahem, I borrowed that one from Codeignitor. Been keeping it my can of things for awhile. What you probably dont understand is your missing the logic of the () Every () will create a new index in the array. You could have this. preg_match('#(.*)@(.*)#',$email,$matches) $matches[1] would be the first () and would contain everything up to the @. (But dont use that regex its really bad.)
  13. $email = "big.nobody@example.com"; if( preg_match("/^(([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*)@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $email,$matches)) { print_r($matches); } Prints: Array ( [0] => big.nobody@example.com [1] => big.nobody [2] => big [3] => .nobody [4] => example. )
  14. Windows as I've said many times to people, is made to be idiot-proof. Maby it would better to make our programs less idiot proof, then we wouldn't have so many idiots on the internet.
  15. Most people are in a hurry period. In our society everyone expects instant results. It took me 2 years to learn PHP. This is where people just quit when they hear that. Editing premade scripts is a good way to learn. This is how I learned, really the comments in php source code and the php manual is better then tutorials! I also picked up HTML,CSS and bit of javascript doing that too. My knowledge of all those is also quite extensive. I would suggest when your ready create some website for a project, I did this about 1 year ago with Codeignitor, it was really hard and probably spent like 3 weeks on it, the site worked, but the code was just really bad, I think It only worked because codeignitor framework makes it really easy not to screw up. lol O'Rielly books are good, I've bought 2 of them at chapters but there really expensive like 50 dollar a book. Watch out though some them are old, make sure to get books that cover PHP 5 +. Some of them are still talking about PHP 4 and there still selling at full retail.
  16. That code is not for c/p. It just an blueprint. But it already has validation. Thats what the functions are being used around the $_POST's and assigning them to a variable. and also the if(empty($var) checks are validation to check if its not empty.
  17. Here is a contact form I wrote awhile ago. Feel free to dissect it and learn from it structure. It uses smarty however, so dont pay much attention to the $smarty things, unless you want to use smarty. But smarty allows me to create user friendly error message, alot better then exit; or having to invent some error message functionality. include 'config.php'; include 'securimage.php'; // some stuff // If a post then it means there submitting the form if($_POST){ $error_msg = false; $contact_email = trim($_POST['EmailAddress']); //Allow max 35 characters in subject $contact_subject = substr(strip_tags($_POST['Subject']),0,35); // Allow max 25 characters $contact_name = substr($_POST['FullName'],0,25); // Strip html tags, and trim the content to max 600 characters $contact_message = substr(strip_tags($_POST['Message']),0,600); $contact_captcha = trim($_POST['cap_code']); //Validate Email if(!empty($contact_email)){ if(!valid_email($contact_email)){ $error_msg .= "<li>Please use a valid email.</li>"; $contact_email = false; } } else { //---Show this message if they left is blank $error_msg .= "<li>Your forgot to fill out your email.</li>"; } if(empty($contact_message)){ $error_msg .= "<li>You forget to fill out message!</li>"; } if(empty($contact_name)){ $error_msg .= "<li>You forget to fill out your name"; } if(empty($contact_subject)){ $error_msg .= "<li>You forgot to fill out your subject line</li>"; } if(!empty($contact_captcha)){ $img = new Securimage(); $valid = $img->check($contact_captcha); // Validate captcha if != true is bad if($valid != true) { // If capctha is wrong. $error_msg .= "<li>Sorry the captcha was wrong. Are you Human? </li>"; } } else { // They forget to fill out the captcha $error_msg .= "<li>You forgot to fill out the captcha</li>"; } //ERROR? Send error message and back any of the message they did fill out if($error_msg){ $smarty->assign('contact_email',$contact_email); $smarty->assign('contact_subject',$contact_subject); $smarty->assign('contact_name',$contact_name); $smarty->assign('contact_message',$contact_message); $smarty->assign('error_msg',$error_msg); $smarty->display('contact.tpl'); exit; } // No error? Continue... $mydate = date ( 'l, F d Y g:i A',time()+240 ); // e-mail subject $subject = "Message submitted using Contact Us form"; // e-mail message $message = "You have received a contact message:\r\n" ."----------------------------------------------------------------\r\n" ."Contact Name: $contact_name\r\n" ."Subject: $contact_subject\r\n" ."Submitted: $mydate\r\n" ."From IP: {$_SERVER['REMOTE_ADDR']}\r\n\r\n" ."Message: $contact_message\r\n" ."Form Address: {$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"; $headers = "From: $contact_name <$contact_email>\n" ."Reply-To: $contact_email\n" ."X-Mailer: PHP/".phpversion(); mail("{$admin_email}","Website Contact Form:{$contact_subject}", $message, $headers); // Set Success message $smarty->assign('success_msg',"<strong>Thank you, your inquiry was sent to the administrator of Website!</strong>"); } // end of if($_POST)
  18. That code might work, but there few things to consider since Nothing is validated. I can send, 0. Email message with unlimited message body,name,month,day,year,name character text. 1. Email messages with html in them 2. Post messages to your contact form with a bot and annoy you. 4. Send email with unvalidated email. Here is a function you will want to limit text with. Substr(); Prevent bots with a good free captcha. http://www.phpcaptcha.org/ Remove html from message with. strip_tags(); Email validation function. function valid_email($Email) { // This regex works pretty well. if(! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $Email)) { // Were here? Its bad. return false; } return true; }
  19. Never mind I just went ahead and created a little loop that recreates the array the way I want it. $bar = array(); $lorem = array(); foreach($foo as $bar){ $ipsum = $bar['cat_name']; if(!array_key_exists($ipsum,$lorem)){ $lorem[$ipsum] = $bar['recursive_id']; } }
  20. Hey guys, I have a table looks like this +- Cat_Name (primary) - + recursive_id(int11) - ----------------------------- programming 1 xml 2 This is the Array that is returned from mysql_fetch_assoc(); Array ( [0] => Array ( [cat_name] => programming [recursive_id] => 1 ) [1] => Array ( [cat_name] => xml [recursive_id] => 2 ) ) I want to use it for recursive naming for categories. For example I have another table called "articles" inside it will say category= "1" or "2" etc, which I will compare to this array to get its name. How I can pull the array out to look like this?. So this makes more sense then quering the database multiple times to check the database table for its recursive name. Array ( [programming] => 1 [xml] => 2 ) Then I will be able to do this this to get the name easily.. $cat_name = $article['category']; // Is 1 $cat_name = $recursive_array[$cat_name]; // Sets to "programming" I can't to this with the array from mysql_fetch_assoc();
  21. \r\n means a new line. $input = htmlentities($_POST['var'],ENT_QUOTES); that will turn things like ' and " into &quote; which will appear in the browser as a ' or " If its not sql injection you may have deep security holes in your script. A lot of the time sometimes you can send posts or gets via cURL or fputs and do stuff you can't normally with a browser, Remember validate all user inputs. All scripts make sure there logged in to access them if there protected.
  22. Parse error: syntax error, unexpected 'need' in Re: Is its important that we have to close MYSQL Connection on post 2, assuming 'no' xD
  23. Did you type 2 "needs" by accident or was the 1st meant to be no? You have 2 needs there. Keep in mind if need or no, both can have the effect to drastically alter the meaning of your sentence. I think you should clarify.
  24. Yes but when we say seperate the code, what does that really mean? To me it means removing the mysql database connection and creating arrays, and assigning variables, all that stuff. In the template the most I have is just {$var} and maby a loop if I am generating a bullet list or something like that from an array. It also has a great caching feature which lends itself to be very useful in cutting down your mysql queries. These days in my code you wont ever catch a html tag in in it. I make good effort to never put put html in my php code unless absolutely necessary. Using a template engine doesn't necessarily separate your business logic from the template any more than writing good code does in the first place. All it does is adds overhead and another syntax to learn.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.