Jump to content

cody7

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cody7's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi Gurus Please help me figure this out $filter = array("just","very short", "long", "two words", "other"); // this list is about 400 array content $str1 = "This is just a sample text, a very short one"; $str2 = str_replace($filter, "", $str1); So when I echo $str2 "This is a sample text, a one" My Question is. what is the best way to know what word(s) from $filter is present in $str1, since str_replace will only return the changed value. for this example ("just","very short") are the words I want to store in an array Array ( [0] => just [1] => very short ) Please note that I am only using PHP4. Feel free to change the technique if you have other method of extracting the words given above. Thank you for all your help
  2. Hi guys i can't get this to work this is the onclick function function process() { // only continue if xmlHttp isn't void if (xmlHttp) { // try to connect to the server try { var firstNumber = document.getElementById("firstNumber").value; var secondNumber = document.getElementById("secondNumber").value; // ($_POST) var params = "firstNumber=" + firstNumber + "&secondNumber=" + secondNumber; xmlHttp.open("POST", "compute.php", true); xmlHttp.onreadystatechange = handleRequestStateChange; xmlHttp.send(params); } // display the error in case of failure catch (e) { alert("Can't connect to server:\n" + e.toString()); } } } and this will be the compute.php my problem I tried the GET approach and I make it to work so now Im trying the POST approach but $firstNumber and $secondNumber is not getting any value. can't figure out what went wrong. please help
  3. Hi What is the best way to detect the URL where the form has been submitted, here’s an example "www.domain.com/page1.php" has a form that will be submitted to "www.domain.com/page2.php". I need to be sure that all variables that will be submitted to page2.php are from page1.php of the same domain or else I have to deny the request. Thanks you for your help
  4. <script type="text/javascript"> function CheckForm() { var count = 0; //Please place the code here } </script> <form name="myform" onSubmit="return CheckForm()"> <input type="checkbox" value="red" name="check1" />red<br /> <input type="checkbox" value="green" name="check2" />green<br /> <input type="checkbox" value="blue" name="check3" />blue<br /> <input type="checkbox" value="yellow" name="check4" />yellow<br /> ..... <input type="checkbox" value="gray" name="check100" />gray<p> <input type="checkbox" value="1" name="other1" />1<br /> <input type="checkbox" value="2" name="other2" />2<br /> <input type="checkbox" value="3" name="other3" />3<br /> <input type="submit" value="Submit"> </form> Ok heres what i need. please complete the form validation on top. But : 1. checkbox name must not change (it must be check1 up to check100 or more) 2. the validation MUST be some kind of a loop checking every checkbox if they are checked so that i dont have to write hundred lines of codes just to check each. 3. when a particular checkbox is checked. count will increment. count++; 4. take note of the other 3 checkboxes, they must NOT be included in the validation. only checkbox having a word "check" on their names will be validated <input type="checkbox" value="1" name="other1" />1<br /> <input type="checkbox" value="2" name="other2" />2<br /> <input type="checkbox" value="3" name="other3" />3<br /> 5. at the end of the validation maybe we can put an alert() containing the value of count Thank for any help
  5. i got it! i just use Content-type:  text/plain instead of Content-type: text/html anyway thank you for posting your help  avo.
  6. Hi i'm having problem sending an HTML code in emails here is my code [code]$message = "<html><head><title>My Title</title></head><body>The Body</body></html>"; $message = htmlentities($message); // my line of code that send this message on my yahoo email[/code] when i check my email heres what i see <html><head><title>My Title</title></head> in case you don't notice the text starting from the <body> tag is gone can anyone help me with this, i just want to see the exact html code treated as text in my email like this: <html><head><title>My Title</title></head><body>The Body</body></html> Thanks for any help you can give me
  7. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Whats happening is because i cant retrieve the image size it blows the javascript pop up function out because it requires them parameters to work ie height and width of the image.[/quote] please check getimagesize() function to retrieve image size.. hope this helps.
  8. Hi guys i have here a working email function [code]function autoemail($fromname, $fromaddress, $toname, $toaddress, $subject, $message, $emailHeaders) {            $headers  = "MIME-Version: 1.0\n";            $headers .= "Content-type: text/html; charset=iso-8859-1\n";            $headers .= "X-Priority: 3\n";            $headers .= "X-MSMail-Priority: Normal\n";            $headers .= "X-Mailer: php\n";            $headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";            $headers .= "CC: <". $emailHeaders. ">\n";            return mail($toaddress, $subject, $message, $headers); }[/code] but this email function only show 1 reply to email address, can someone edit this function so that it will do multiply reply-to email, or if anyone has already a code for that can you please post it in this forum. If you know some article regarding this issue please post it also. thanks for any help.
  9. here is an exmple myfunction.php (resides in my server: [a href=\"http://mydomain.com/myfunction.php)\" target=\"_blank\"]http://mydomain.com/myfunction.php)[/a] [code] <? function give_name(){ return "Joe"; } ?> [/code] remote.php (resides in my clients server: [a href=\"http://clientdomain.com/remote.php)\" target=\"_blank\"]http://clientdomain.com/remote.php)[/a] [code] <? include("http://mydomain.com/myfunction.php"); echo "NAME = ".give_name(); ?> [/code] RESULT: Fatal error: Call to undefined function: give_name() in /home/../../../remote.php on line 2 So idea here is that i can use my function without giving it to my client. i just want to see NAME = Joe as the output Thanks for any idea you can give me. [!--quoteo(post=367048:date=Apr 20 2006, 06:55 PM:name=freakus_maximus)--][div class=\'quotetop\']QUOTE(freakus_maximus @ Apr 20 2006, 06:55 PM) [snapback]367048[/snapback][/div][div class=\'quotemain\'][!--quotec--] Yes you can do this type of include. I have several clients setup on their site/page/server to include a script from my server, which processes requests to the database and returns what is needed. This is all I do where I need the script to included. [code]<?php include ('http://www.yoursite.com/yourscript.php'); ?>[/code] This works fine and there is no need to allow remote requests my database. [/quote]
  10. Hi i have here a file containing all my functions (myfunction.php) i have created a program on my clients server and i need to use (myfunction.php). my tendency is to include(http://mydomain.com/myfunction.php); but if i do this the function inside it will not be valid right? i can't put myfunction.php to my clients local machine because it contains queries of my tables. so my question is how will i include() myfunction.php as if im just including a file in his local machine? hope my question is clear. Thanks for any help!!!
  11. can anyone give an input about this matter. thankyou for any help you can give me.
  12. [!--quoteo(post=356496:date=Mar 19 2006, 03:53 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 19 2006, 03:53 PM) [snapback]356496[/snapback][/div][div class=\'quotemain\'][!--quotec--] Does he have cookies enabled for IE? [/quote] where can i find that setting? is it in the Internet Option then Privacy and the privacy setting? i ask him to set it to Accept All Cookies but it still not working. does the certiticate of the site has to do with this?
  13. Hi guys, heres my problem [code] <? if($_POST['submit']){     $_SESSION['sample_session'] = $_POST['name'];     redirect("sample2.php"); } ?> <form action="" method="post"> <input type="text" value="" name="name"> <input type="submit" value="Submit" name="submit"> </form> [/code] then in sample2.php [code] <? if($_SESSION['sample_session'] == ""){ // i do not use isset() for this example     echo "ERROR<br>"; }else{     echo "Your input = ".$_SESSION['sample_session']."<br>"; } ?> [/code] both my page has session_start() on top. heres the issue, when i tried this code (for IE, firefox) its working fine, but when i ask my friend (his in another location) to try it both for IE and firefox heres the result. its working in firefox but NOT in IE. we have the same setting for the both browsers. what could be the cause of this? any suggestion or inputs that you can give me? thanks
  14. Hi can you point me in a direction where i can find a FREE script similar to this one? i already post this in the javascript forum but i want to try my luck here. [a href=\"http://codethat.com/editor/pallete_ex.html\" target=\"_blank\"]http://codethat.com/editor/pallete_ex.html[/a] Im planning to create a text editor for my website creator program.. thanks....
×
×
  • 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.