Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. php cannot execute after the php engine has exited and output the data to the client. Therefore php cannot work with Javascript, but you can echo javascript from php. You're probably going to want AJAX. more so XMLHttpRequest, and in your php you're going to echo out the stuff you want to show inside your select box, and with javascript you're gonna send what is selected and receive the new options and place it inside with a simple innerHtml call on the select box's html element. writing up your script to show you how would be a waste of time, however, I can point you in the right direction .
  2. why don't you just create pseudo variables.. like.. {name} {email} {age} {sex} etc and just replace those with the variables for example $emailTemplateData = str_replace(array('{name}','{email}','{age}','{sex}'),array($name,$email,$age,$sex),$emailTemplateData); this way your users creating the template just need to draw up the template as follows: Dear {name}, You're now {age} have you ever thought about joining the military? If you are considering it, please send us an email from {email} to our email address recruiter@military.gov.
  3. sorry.. use this: eval("\$sum = $first$method$second;"); my original code doesn't work ^^ edit
  4. number one.. don't give your FTP details online.. spiders crawl these forums and index the data they find.. second.. add me to msn or aim RussellonMSN@hotmail.com RussellCrevatas ^^ in respective order
  5. eval.. $sum = eval("$first$method$second");
  6. echo "<a href='cart.php?productid={$productid}'>Add to cart</a>";
  7. $rovers = array( 'uk' => '7826-238971-1237861', 'us' => '87562-2367-6723' ); and then just o $code = ((!($code = $rovers[$geocode]))? $rovers['uk']); ^^ that will select it from the list if it exists.. if it doesn't exist it defaults to the uk code
  8. the php redirect should be used if Javascript isn't enabled on the client's browser.. otherwise the backbutton will push them back to the redirecting php page meaning they'll go back 1 history element then get redirected again.. over and over.. a very huge inconvenience to the client.
  9. could also be your connection fails and you set your warning level really low so you're not getting warnings from failed query and result grabbing
  10. yeah.. put the image inside of a div and give it overflow: hidden;
  11. well.. what would be the difference with a table?.. why don't you just make the lis 350px wide then and the ul 700px wide.. it makes no sense to fill your html up with a million redundant tags
  12. you know.. you could probably take what you made last time.. and just modify the css.. for example.. ul { width: 200px; margin: 0; padding: 0; } ul li { width: 100px; float: left; display: block; }
  13. lol I'm really not SUPPOSED to advertise my services, so I won't.. but I do have a lovely signature. But that would probably be freelance more than phphelp
  14. In most XSS attacks the attacker sends the victim a XSS modified URL to a site the Victim trusts (e.g. slaterino's site) . It's the Victim's output which is changed .They see the site but the Attacker can then potentially gain access to the Victims user credentials and/or cookie info for that site - In this example I just showed an injection of a visible image the Injection could be a javascript program. The wikipedia page on XSS is well worth reading http://en.wikipedia.org/wiki/Cross-site_scripting no no no I understand what XSS is I was just saying, I'd understand if the url was passing thru php or sumfin.. but the scenario in which a user is being directed to this site is a different story, I can understand the worth of it because your users ate the ones that'd get hurt. anyway, thanks
  15. exec('mogrify -resize 468.75x200 /home/deathdefyer2002/imageA.jpg'); try that
  16. what exactly could sum1 do by xss injecting into html.. they could only really modify their own output.. but I hear what you mean
  17. feel free to add me to MSN or AIM to ask me questions directly based on this topic.. the open tags are going to stay open but what you CAN do is remove all possible tags besides the img tag.. from the preview not the whole thing.. so like.. $preview = theFunctionIshowed($content,40); $preview = str_replace(array("<b>',"</b>","<i>","</i>"),'',$preview);
  18. You need to put his at the very top of the page and no white space around the php tags.. the javascript example I showed you should work.
  19. header("Content-Type: text/xml");
  20. actually this will remove the image tags.. you'd want to make your own function to avoid them then.. or use regex but back tracking in the Regular Expressions engine is alot laggier than just moving forward.. so heres what I've put together for you. <?php function getValidChars($data,$enum) { $inTag = false; $returning = ''; $num = 0; for ($i = 0; $i < strlen($data); $i++) { $current = substr($data,$i,1); if (!$inTag) { if ($current == "<") $inTag = true; else $num++; } else { if ($current == ">") $inTag = false; } $returning .= $current; if ($num >= $enum) return $returning; } } $i = getValidChars("a b c <b>d</b> e f g h i j k l m n o p q r s t u v w x y z",25); echo "<div>{$i}</div><div>".strlen($i)."</div>"; ?> but you see.. the above code doesn't take into consideration whether or not there is any open tags which need to be closed.. so bear that in mind.. but its tested and works
  21. ok... what you'd WANT to do.. is count anything not inside of the html tags.. so when you're getting the previews.. do this: $preview = substr(strip_tags($content),0,40);
  22. you're better off doing it the way you're planning on doing it, otherwise you'd be calling fread 200k+ times instead of just buffering the whole content and working it out.. BUT what I can say is.. close every file resource you create or that will set flags off on your webhosting that you'd using too much cpu time and they'll lock your account..
  23. add me to MSN my MSN is in my signature.. or I have my AIM on the left hand panel.. on topic though, you'd PROBABLY want javascript as there must be a reason for the htaccess usage there.. I'd do something like this: <form onsubmit="function12()"> function function12() { top.location.href = "http://www.domain.com/proofs/album/"+document.getElementById("theInput'sID").value; } and! in the rare event if sum1 actually has javascirpt disabled.. set the form to go to whatever.php and in whatever.php put this code <?php header('Location: http://www.domain.com/proofs/album/'.$_POST['theInputsID']); ?>
×
×
  • 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.