Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. ** This was a quick write up and is just a quick attempt to get you something up and running. <?php if (isset($_POST['submit'])) { // make sure submit is set $errorhandler = ''; if ($_REQUEST['email'] == "") { $errorhandler .= 'email is required.<br />'; } if ($_REQUEST['name'] == "") { $errorhandler .= 'Name is required.<br />'; } if ($_REQUEST['to'] == "") { $errorhandler .= 'To field is required.<br />'; } if ($_REQUEST['message'] == "") { $errorhandler .= "message is required.<br />"; } if ($_REQUEST['subject'] == "") { $errorhandler .= "Subject is required.<br />"; } if ($errorhandler != "") { echo '<span style="color:red;">'; echo $errorhandler; echo '</span>'; } if ($errorhandler == "") { $email = $_REQUEST['email'] . ', user@example.com'; $name = $_REQUEST['name'] ; $to = $_REQUEST['to'] ; $message = $_REQUEST['message'] ; $subject = $_REQUEST['subject'] ; mail( $to, $subject, $message, "From: $name <$email>", $headers); header("Location: http://www.example.com/thankyou.html"); } } ?> If this code gives you too many problems then we'll right up something OO style using a class so it'll be easier for you to keep up with and make changes too.
  2. If you do <a href="http://www.phpfreaks.com" title="Freaks">The PHP Freaks</a> and <?php echo '<a href="http://www.phpfreaks.com" title="Freaks">The PHP Freaks</a>'; ?> the search engines look at both of those exactly the same. However with javascript (if you were building link with javascript for example) they are ignored by search engines. As well as flash (to an extent).
  3. Post the entire code from your original page. From top to bottom.
  4. I like 1and1 for linux. They have some really good servers.
  5. What are the system specs for your laptop. The first thing is to make sure your system meet's the minimum (if not recommended) settings to install the server and everything that goes with it. They can take quite a lot to run. After that, step me through the installation process you used to get it working on your desktop then your laptop (in detail),
  6. If you have done those previous languages as you listed. And you are semi-fluent in some of them. Then chances are you can learn enough php to do what you are wanting in about 1 good dedicated week (giving it a decent amount of hours per day). You already know programming concepts, all you need to do is learn the syntax and langauge specific theories behind php. Which isn't too hard with prior experience it's meant to be one of the easiest languages to learn.
  7. What you are trying to do will throw syntax errors. <?php echo "<a href='http://thewebpageforthislinkhere'>I am text link 1 that leads to another page. When I am clicked on two other text links appear</a>"; if (<a href='http://thewebpageforthislinkhere'>I am text link 1 that leads to another page. When I am clicked on two other text links appear</a>) { echo "<a href='http://thewebpageforthelinkhere'> I am text link 2 that appears only when the first one was clicked on</a>"; echo "<a href='http://thewebpageforthelinkhere'> I am text link 3 that appears only when the first one was clicked on</a>";} ?> this whole thing is messed up. Create your links like normal and use php around htem as needed. Now you need to restructure the code as that's nothing that is going to run. Now as far as google, it's going to follow them just as standard links. Whether they are echo'd/printed in php doesn't matter. They still are given to the end user the same (as xhtml/css output only). The php is server side and does not affect search engines.
  8. http://www.zend.com/zend/spotlight/code-gallery-wade8.php?article=code-gallery-wade8&kind=sl&id=4791&open=1&anc=0&view=1#Heading10 I don't see anything here that would conflict with php 5. Install it, and give it a try. Report any error messages that come up, and we'll sort through them. I read through it, and it looks to be php 5 safe. Tell me what kind of odd behaviour it's giving you when ran in 5, as opposed to 4, they probably won't be too hard to implement. To be honest if it's giving you a lot of problems below is a link to another very well developed session handler that was built specifically to utilize the power of php 5. http://www.nateklaiber.com/2006/05/10/custom-php-session-handler/
  9. In 2 weeks you could put something together very low level. A programming language (with no prior programming experience) isn't meant to be learnt in a few weeks time. I re-read over what you mentioned and it's possible to gaint hat knowledge within the time period, but I think you are getting involved in something you are not expecting and expecting a better time period than you know. Unless I am mistaken and you ahve prior php or other programming experiences. KNowing xhtml/css already will help a lot however.
  10. I meant leave everything you ahd but change that part. Try this <?php $email = $_REQUEST['email'] . ', user@example.com' ; $name = $_REQUEST['name'] ; $to = $_REQUEST['to'] ; $message = $_REQUEST['message'] ; $subject = $_REQUEST['subject'] ; $headers = "Location: http://www.example.com/thankyou.html \n" ; if (!isset($_REQUEST['email'])) { header( "Location: http://www.example.com" ); } elseif (empty($email) || empty($to)) { ?> <html> <head><title>Error</title></head> <body> <h1>Error</h1> <p> Oops, it appears you forgot to enter either your email address or your recipient's address. Please press the BACK button in your browser and try again. </p> </body> </html> <? } else { mail( $to, $subject, $message, "From: $name <$email>", $headers); } ?>
  11. It is great that you post your opinion here. However you need to acknowledge the fact that it's your "opinion" Ever developer that is reading this post of yours is getting mislead and taken down the wrong road. You are taking new developers that will have lot's of questions, and confuse them making them have even more questions. Aside from that it's in the wrong post, it should be under misc. I have nothing against your argument but your going around acting as if it's law, and that your right and everyone else is wrong. You have your views, but to be honest, it is going to do nothing but to confuse and mis-inform younger/beginning developers who are trying to understand the world of css adn the difference between xhtml/html. I have even seen 1-2 of the developers who responded and you gave them your views as law, and getting them away from what they should be learning.
  12. Based off php.net <?php $_foo ='/server/public_html/path/'; function s_glob($dir){ $files = array(); if(is_dir($dir)){ if($dh=opendir($dir)){ while(($file = readdir($dh)) !== false){ $files[]=$dir.$file; }} } return $files; } print_r(s_glob($_foo)); ?> is going to be faster than using the glob function.
  13. If you were dillegent (This totally varies from person to person). You can have a good working knowledge of mysql and intermediate CSS in about 4-6 weeks. Then you can have a decent php/mysql programming knowledge (with some assistance) in about 2 months (enough basics to do basic/intermediate db calls, and form/processing). Spend some time getting alright with them before you start, other wise you would be better off getting a friend. Unless it's a personal project that isn't as important. New programmers tend to make alot of security mistakes, which isn't good for live sites.
  14. or use the function rename() (check php.net for function information). It's a lot easier than the long way.
  15. It's not too hard. Simply when they sign up create a random variable with a random combination of letter's, number's and possible some symbols (keep them url safe). Then email that link over to the email address and save the code in the db. In the link have auth=code (whatever the code was) on te website, just grab the url and parse that variable auth and check to see if it's in the databsae. HAVE THEM enter the email address/auth code BACK into the system (with captcha) for security and then they are validated into the system and can login. On the login page check if they are activated (just set activated to 0 at first and 1 after they are validated.
  16. PHP 4 is dying. On there official website www.php.net it is stating that support for php 4 is going away very shortly (development on it). You might want to focus on 5 & 6 for the time being. Because within 3 years php 4 is going to be as scarce as php 3. (Not 100% sure on this just guessing).
  17. <html> <!-- make sure you put a proper doctype and everything --> <head> <title>page title</head> <!-- CSS LINK HERE --> </head> <body> <?php /***************************************************************************** Enthusiast: Fanlisting Management System Copyright (c) by Angela Sabas http://scripts.indisguise.org This script is made available for free download, use, and modification as long as this note remains intact and a link back to http://scripts.indisguise.org/ is given. It is hoped that the script will be useful, but does not guarantee that it will solve any problem or is free from errors of any kind. Users of this script are forbidden to sell or distribute the script in whole or in part without written and explicit permission from me, and users agree to hold me blameless from any liability directly or indirectly arising from the use of this script. For more information please view the readme.txt file. ******************************************************************************/ require_once( 'config.inc.php' ); $show_form = true; $message = ''; if( isset( $_POST["email"] ) && $_POST["email"] != '' ) { $email = $_POST["email"] ; $show_form = false; // create password $password = ''; $k = 0; while( $k <= 10 ) { $password .= chr( rand( 97, 122 ) ); $k++; } // create sql query $query = 'UPDATE ' . $db_table . ' SET password = PASSWORD( "' . $password . '" ) WHERE email = "' . $email . '"'; $db_link = mysql_connect( $db_server, $db_user, $db_password ) or die( 'Cannot connect to the database. Try again.' ); mysql_select_db( $db_database ) or die( 'Cannot connect to the database. Try again.' ); mysql_query( $query ); $affected_rows = mysql_affected_rows(); if( $affected_rows > 0 ) { $show_form = false; $to = $email; $subject = $fanlisting_title . ' FL: Password reset'; $headers = "From: " . $fanlisting_title . " <" . $fanlisting_email . ">\r\n"; $lostpass_file = $backend_dir . 'emails/lostpass.txt'; $lostpass_email = fopen( $lostpass_file, 'r' ); $body = fread( $lostpass_email, filesize( $lostpass_file ) ); fclose( $lostpass_email ); require_once( $backend_dir . 'parse_email.php' ); $body = parse_email( $body, $to, $password ); $success_mail = mail( $to, $subject, $body, $headers ); if( $success_mail ) { ?> <p> Your password has been successfully reset and an email has been sent to you containing the generated password. </p> <?php } else { ?> <p> Your password has been successfully reset, however, there was a problem sending you an email regarding this. Please contact us instead by <a href="mailto:<?= str_replace( '@', '{ at }', $fanlisting_email ) ?>">email</a>. </p> <?php } } else { ?> <p> There was an error in your request to reset your password. This may be because there is no member recorded in the <?= $listing_type ?> with that email address. Please check your spelling and try again. </p> <?php $show_form = true; } // end of if email and password is present mysql_close( $db_link ); } // end of if update = yes if( $show_form ) { ?> <p> If you have lost or forgotten your password, you can reset your password using this form. The new generated password will be sent to you, and we advise you to immediately change/update your password once you receive this. </p> <p> Enter your email address on the field below to generate a password. </p> <p> <b><?= $message ?></b> </p> <form method="post" action="<?= $lostpass_url ?>"> <p class="noindent"> Email address:<br /> <input type="text" name="email" /> <input type="submit" value="Reset my password" /> </p> </form> <?php } ?> </body> </html>
  18. I don't fully understand what you are asking could you please rephrase your question?
  19. There are a few ways. Based on the ip address (without being fully accurate) a php script can make a good guess at what region they are coming frmo (example demonoid.com detects canadian ip's and blocks them). Same idea. http://www.google.com/search?hl=en&q=get+users+location+with+php the first link will tell you everything you will need to know.
  20. You need to be careful using + instead you want to do something like tihs to guarantee no issues arise. Also your code is scary <?php <?php // check if it is a weapon, armor, or vehicle if($item_type == 'weapon') { $type = 'weapons'; }elseif ($item_type == 'armor') { $type = 'armors'; }elseif ($item_type == 'vehicle') { $type = 'vehicles'; } // run the queries for you - give you your weapon $type = $type . ',' . $item_id; $update = "UPDATE `cf_users` SET '$type' = '$type' WHERE `id`='" . $player_accountid . "' LIMIT 1"; $query = mysql_query($sqlll) or die('Query:<br />' . $sqlll . '<br /><br />Error:<br />' . mysql_error()); ?>
×
×
  • 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.