Jump to content

AV1611

Members
  • Posts

    997
  • Joined

  • Last visited

Everything posted by AV1611

  1. put this at the top of your script for a test: if(isset($_POST['password'])){ echo 'PW is set: '.$_POST['password']; }else{echo 'PW not set!';} echo '<br />'; if(isset($_POST['username'])){ echo 'USERNAME is set: '.$_POST['username']; }else{echo 'USERNAME not set!';}
  2. select * from table where field like '%linguist%' rss feel and searching are not the same thing in all cases. Do you want to filter the rss feed, or do you want to modify the rss feed? That makes a BIG difference...
  3. I have a site that pulls forum data via sql and based on various conditions, places it on another site. The site is working good, and I've been able to create filters like converting (some) bbcode back to html, etc... Anyways, What I want to do, and I don't know where to begin, is when the data string has something like this: $str = 'blah blah blah blah <img src="somepic.png" alt=''whatever" />'; is I want to somehow "thumbnail" that pic before it shows up on the site. I DON'T want to change it on the forum site... Dunno if this is a GD thing or whatever... I tried putting: img{ width: 200px; } in the css, but it makes pic's that are smaller than 200px bigger, which is a problem, but it did seem to fix the ones that were bigger than 200px though... Help?
  4. Thanks, That did the trick. Can anyone point me to a good NOOB tutorial? I STILL can't get my head around regex
  5. $pattern=array( "/\[link\](.*?)\[\/link\]/" ); $replace=array( "<a href=\"\\1\">\\1</a>" ); $str=preg_replace($pattern,$replace,$mystring); This is working good, but... How can I make the $pattern part case insensitive?
  6. I give up. The text is generated via a php script. how do I do the refresh on the DIV ?
  7. Trying to validate a page but get this error: (NOTE: I don't know js) Error Line 46, Column 120: document type does not allow element "object" here . …8856F961-340A-11D0-A96B-00C04FD705A2"></object>'; Here is the relevant part of the code - I put a print button on screen but use css to suppress the print screen button <p class="display_only" style="text-align: center;"> <script type="text/javascript" language="Javascript"> // This Script puts a Print Screen Button on the page function printit(){ if (window.print) { window.print() ; } else { var WebBrowser = '<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>'; document.body.insertAdjacentHTML('beforeEnd', WebBrowser); WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "; } } </script> <script type="text/javascript" language="Javascript"> var NS = (navigator.appName == "Netscape"); var VERSION = parseInt(navigator.appVersion); if (VERSION > 3) { document.write('<form><input type="button" value="Print this Page" name="Print" onClick="printit()"></form>'); } </script> </p>
  8. Thank you and I will try and implement what you suggest... Please note however I know ZERO js. None. Nada. I know PHP/HTML/CSS. I just have to do a client side not server side for this problem is the only reason I'm looking at js or ajax hints welcome!
  9. Hi, I wrote a shoutbox in PHP. It works very well except one problem: The box is a div that shows the posts and a textarea at the bottom. the whole thing uses a meta refresh at 30 seconds... Now, the problem is if you are typing in the box, it will refresh, and that's annoying cause you never really have enough time to finish your shout it seems like... So, keep in mind I know ZERO js or ajax, only PHP... The top DIV content comes from mysql and has a ton of filters for smileys, bad words, bbcode, etc... already in it... I would like the top div to refresh independently of the bottom... sure, I could put the top in an iframe... and put the meta refresh in there, but and iframe in and iframe(the shoutbox is part of a bigger page) that just seems kinda lame. Can someone help?
  10. *slap* AJAX has it's place, but it shouldn't be used unless it adds a lot of value to the application. Touche Ober! Ajax is VERY system intensive at times... just watch your system load when it's running
  11. one last question: $str="this is a BIG word"; echo preg_replace('/\[size.*?\](.*?)\[/size\]' , '\\1' , $str); //this is a BIG word What did I do wrong? I just wanna drop the bbcode in this case...
  12. Thanks. I guess I asked the wrong question though... I don't really wanna eliminate the link. I either want the part between the <a>THIS</a> or maybe href="THIS" That's a much harder problem... the second one is bad cause it may have " ' or other characters encapsulating the link...
  13. is there more than one return? while{ suggests there is more than one return. If{ would be better if you expect only one return. Also, select email,location from accountinfo where username='%s' is bad. % is a wildcard, and you have to use like not = but you want a single return, so you need a better query... Finally, just for fun do: )); $result=mysql_query($query) or die('Croaked: '.mysql_error()); and see if the query is valid.
  14. Don't remember the absolute time limit for a single script but it's kinda short... I did something similar and just had the script loop through in chunks. The limit is a SPECIFIC operation... so push the data up in 1000 line chunks ... the overall speed isn't that much differnet cause php loops pretty fast anyways.
  15. $str='this is a string with some <a href="whatever.com">Some Link< / a > to a site'; $str=somephpfunction($str); echo $str; // this is a string with ***LINK DELETED*** to a site How would I do that?
  16. Ah... I see it's new in PHP5. I haven't done a case insensitive replace in a long time so I guess I didn't ever notice that. I really do try and read the manual
  17. never heard of that command? is that new ?
  18. ok, I have written a shoutbox that seems to work ok so far. Now I need to make a language filter. I can come up with a word list but what I don't know how to do is make it not "case sensitive". so Frog FROG frOg froG are all the same. Do I need to use preg_replace? I SUCK at regex... Guidance? Thanks.
  19. If I create an hash and store in in the cookie that should make it plenty secure, ya?
  20. <?php if(isset($_GET['set'])){ setcookie('shoutbox','shoutboxdata',time()+60*60*24*365*10); header('Location: cookietest.php'); } else{ if(isset($_COOKIE['shoutbox'])){ echo "cookie is set"; } else{ echo "cookie is not set"; } } ?> Looks like that'll do it.
  21. your question doesn't seem to be in the code. post the revised code with the phone number part you added
  22. so, what is the syntax to see if they have the cookie set? if(isset($_COOKIE['cookiename'])){ do some cool stuff for the person } else{ tell them to log in } like that? I don't care about the info in the cookie but I guess I could put a sha1 hash of a keyword or whatever but I don't care I don't think... It's just a shoutbox...
  23. I have done some minor stuff with cookies in the past, but need some guidance. All I want to do is make a simple login that when completed it sends a cookie to the client that never expires, then everytime they come back to the site it checks to see if the cookie is present and if not then they login again. 1. Is that PHP only? 2. It's a low security site... I'm making a shoutbox from scratch is all. 3. I just need to know how to make the cookie not expire and how to check for it on return to the site.
  24. post your actual script section and your actual names on your database/tables and let's see what we can do.
  25. IMO Fedora is the easiest distro for a new person to LAMP.
×
×
  • 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.