Jump to content

hansford

Members
  • Posts

    562
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by hansford

  1. well you could let client side scripting validate all of this before wasting the servers resourses. If you let php do this then $HTTP_POST_VARS is depreciated use $_POST instead. If you're wanting to just check that the field isn't empty, then.. <?php if(strlen($name)){ } ?>
  2. you can google each one of these and they will tell you what each is for and how to set them up.
  3. <?php include('yourpage.html'); ?>
  4. Perfect - phpmailer is great and easy.
  5. Crayon is right. You'd need to echo out the entire script and then you can even echo out a call to the function. php doesn't know anything about javascript, but we can trade values through $_POST and $_GET using form values and appending strings to the ends of URL's
  6. try checking that the files exists where you tried to save it to. <?php if(file_exists(){ echo "file exists"; } ?> [code] if it does exist, then it's your FTP programming not updating. close it out and reopen and you'll see your file. [/code]
  7. why not just make the class extend the other class and you'll have full access.
  8. javascript code will be within the html. when the function has finished it will submit the form. You should post your form, so maybe someone will take the time to show you the necessary javascript function
  9. I don't believe file_exists() would in any case return false when is_readable() returns true. visa-versa = 'yes' because is_readable() wants to know not only that the file exists, but that it's readable as well.
  10. this is going to be a javascript function. http://tool-man.org/examples/edit-in-place.html
  11. try fopen() fgets() and then iterate through each line of the file trying to find a match with strpos()
  12. some client side scripting would be best - Javascript.
  13. the periods(.) are whats holding the string together. Try replaceing the \n with <br> if displaying in html pages.
  14. use && instead of || but if your DB returns a null value then you'll have to check for that as well.
  15. Restore your server space the way it was and stop playing with things you know nothing about. - joke. Maybe 'password' is suppose to be $password in the following. I dunno. //// // Output a form password field function tep_draw_password_field($name, $value = '', $parameters = 'maxlength="40"'){ return tep_draw_input_field($name, $value, $parameters, 'password', false); }
  16. Ok, post what code you have now and where the problem is and we'll be happy to assist you.
  17. well i dont know what's the limit on characters is in their username, but I guess we could look for anything that's not whitespace "/http:\/\/www\.imeem\.com\/\S+\/video\/([_A-Za-z0-9-]+)/" if its just numbers and letters and possible a hyphen or underscore then we could do "/http:\/\/www\.imeem\.com\/[A-Za-z0-9-_]+\/video\/([_A-Za-z0-9-]+)/"
  18. add this to your style. margin-top: -15px;
  19. here's an example that would provide you enough info. to get it figured out. <form name='form1' method='post' action='mextpage.html'> <select name='country' onchange='check_country(this.form);'> <option value='usa'>usa</option> <option value='mexico'>mexico</option> <option value='italy'>italy</option> </select><br> <select name='language'> <option value='english' selected>english</option> <option value='spanish'>spanish</option> <option value='italian'>italian</option> </select> </form> <script language="JavaScript" type="text/javascript"> <!-- function check_country(frm){ var selected = frm.country.options[frm.country.selectedIndex].value; switch(selected){ case'usa': frm.language.options[0].selected = true; break; case'mexico': frm.language.options[1].selected = true; break; case'italy': frm.language.options[2].selected = true; } } //--> </script>
  20. sounds complicated. why not just check what page you're on and then include or echo out. But then again, maybe I'm not following you. <?php $page = $_SERVER['REQUEST_URI']; switch($page){ case '/page1.php': include('whatever'); echo 'whatever'; break; case '/page2.php': include('whatever'); echo 'whatever'; } ?>
  21. has to be double quotes around single quotes. $sql = "DELETE * FROM vote WHERE hidden = '48' AND number = '$vote' AND ip = '$ip' LIMIT 1";
  22. ok I now have !==false and it can only find 1 out of the possible 4 it should find. If it were a problem with the double quotes, then it wouldn't find anything. If it were a problem with the way chars are compared, it wouldn't find anything. Baffling or maybe just buggy, but I couldn't find any reports for this. <? $logs=fopen("logs2.txt", r); while (!feof($logs)) { $tLogs=fgets($logs); $text=fopen("files2.txt", r); while (!feof($text)) { $tText=fgets($text); if(strpos($tLogs,$tText) !==false){ echo("Found {$two}"); break; } } fclose($text); } fclose($logs); ?>
  23. I have (2) text files. The code is suppose to open logs2.txt and read a line from the file, it then opens files2.txt and iterates through each line to see if theres a matching substring. If one is found then it just echos out what was found. The code doesn't work as expected. It finds 2 occurenses of matching strings, but I know there's at least 4. I've tried addslashes(), preg_quote() with no luck. I've checked each value of the 2 variables before they enter str_pos() and they should find a match, but they don't. I know I can use preg_match for this, but I'm curious as to why this is not working. http://www.modernterrain.com/files2.txt http://www.modernterrain.com/logs2.txt I have the follwing code ------------------------- <? $logs=fopen("logs2.txt", r); while (!feof($logs)) { $tLogs=fgets($logs); $text=fopen("files2.txt", r); while (!feof($text)) { $tText=fgets($text); if(strpos($tLogs,$tText)){ echo("Found {$two}<br>"); break; } } fclose($text); } fclose($logs); ?>
  24. congrats. I see that you were in-fact echoing it out. any more questions just post.
×
×
  • 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.