hansford
Members-
Posts
562 -
Joined
-
Last visited
-
Days Won
4
Everything posted by hansford
-
reigning in my PHP script for completeness and security
hansford replied to RaceCarDriverGuy's topic in PHP Coding Help
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)){ } ?> -
you can google each one of these and they will tell you what each is for and how to set them up.
-
<?php include('yourpage.html'); ?>
-
Perfect - phpmailer is great and easy.
-
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
-
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]
-
why not just make the class extend the other class and you'll have full access.
-
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
-
this is going to be a javascript function. http://tool-man.org/examples/edit-in-place.html
-
try fopen() fgets() and then iterate through each line of the file trying to find a match with strpos()
-
some client side scripting would be best - Javascript.
-
the periods(.) are whats holding the string together. Try replaceing the \n with <br> if displaying in html pages.
-
use && instead of || but if your DB returns a null value then you'll have to check for that as well.
-
Changed html_output.php, now cant log into admin console..help!
hansford replied to newblet007's topic in Third Party Scripts
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); } -
Ok, post what code you have now and where the problem is and we'll be happy to assist you.
-
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-]+)/"
-
add this to your style. margin-top: -15px;
-
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>
-
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'; } ?>
-
has to be double quotes around single quotes. $sql = "DELETE * FROM vote WHERE hidden = '48' AND number = '$vote' AND ip = '$ip' LIMIT 1";
-
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); ?>
-
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); ?>
-
congrats. I see that you were in-fact echoing it out. any more questions just post.