Jump to content

rhock_95

Members
  • Posts

    120
  • Joined

  • Last visited

    Never

Everything posted by rhock_95

  1. Thanks for all the replies and all your time It works great and I learned some useful php... thanks again... BTW, the second part of the problem worked itself out in the mean time...the numbers display as a link and if viewed on a cell phone it will dial the number or as it to the contact list etc...
  2. I was only using "(xxx) xxx xxxx" to show the formatting of the data in the db the script sees the data as: $phone= ' <td>'.$data['phone'].'&nbsp</td>';
  3. some success with the following: (I commented out the first line) //$phone = '(foo) - o'; $phone = preg_replace('([\(|\)\-])', ' ', $phone); echo $phone; however the output is xxx xxx xxxx how can I get rid of the spaces?
  4. all the html is generated by the php ............................................................. sorry but I don't have a clue how to use this...can you show me using the variables from the code I have posted?
  5. thanks for the time... not getting any errors but the numbers are still being displayed with the "(),-" characters...??
  6. thanks for the quick response...getting this: Warning: Unknown modifier '-' on line 144 lines 143,144: $replacement=""; preg_replace($pattern,$replacement,$phone);
  7. hope this is a simple problem... I have a couple of different scripts that display results from mysql DB queries and they work great on the regular web...but I am offering the same content for mobile browsers...specifically cell phones....So I am having to edit the (regular web) applications down to work on the micro browsers... I am having good success with the scripts but I need some help with some fine tuning...I am currently hung up on two related problems... 1.) I need to strip some characters from a particular column result "(xxx) xxx-xxxx" to xxxxxxxxxx 2.) "(xxx) xxx-xxxx" being a telephone number...I need to hyperlink it so the phone will dial the number when selected...here is the second part of the problem. Either of the following work on one script ...although the number still needs to be stripped of the (,),- echo "<td><a href=\"wtai:$phone\">$phone</a></td>\n"; echo "<td><a href=\"tel:$phone\">$phone</a></td>\n"; however the other script using the following displays the numbers but they are not hyperlinked??? echo "<td><a href=\"wati:$phone\">$phone</a></td>\n"; first things first...how can I format the numbers ($phone)from (xxx) xxx-xxxx to xxxxxxxxxx as $phone ? any ideas why either of the first examples work on one script for hyperlinking the numbers but not the second script? TIA
  8. can you show me how this is done?
  9. other than user agent what else should I look for in the http header logs ?
  10. not getting any errors...is there a special function to echo cURL errors?
  11. I am trying to use a curl script to retrieve a map based on form input my form passes the data to the script and retrieves the map page but no map...however the URL is valid...i.e., if I take the same URL string following the "?" and paste it into the originating page the map displays in the example below... after submitting the form (No Map displays) but if I copy the "coordinate string" and paste it over the coordinate string in the second example the map displays [example] mysite.com/curl_script.php?coordinate string No map Displays mapsite.com?/search.php?coordinate string Map displays here is the code I'm using: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.mapsite.com/search.php?"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); echo "$result";
  12. thanks for nothing...obviously you as a php coder you have no idea how hard it is trying to grasp something from the manual without hands on experience... telling someon to go read the manual is about the lamest advice that anyone can give... effing worthless if anyone else can help me I would much oblighed...I am not asking anyone to write a script I am just asking for some hands on syntax examples that the manuals fail top provide...
  13. can you show me an example? can you show me the syntax how to strip tags then echo a substr ?
  14. ok thanks for your help and insights...one more question... what is the easiest way to get the character count of any given string? thanks again
  15. believe me I have been through the manual but not be a fluent php coder I am lost... what does the "start" integer define ? is it the number of characters or what?
  16. ok thanks... but I need to specify a point in the string to start and stop what gets printed... how do I define the the beginning and the end points? can it be done using character counts? or something?
  17. can you digress a bit on using substr() can you show or link me to an example of getting a line of text from the middle of a string?
  18. lets say I have a block of text... I want to echo a single sentence from about the middle of the string what is the easiest way to do this? to clarify...the "block of text" is the $result of curl script TIA
  19. ok thanks for the reply... not being a php coder pre se'...can you tell me how to use preg_match() to remove unwanted content from the "$result" string ?
  20. can someone direct me to a source or explain how to get specific content from a page returned from a curl script?...i.e. if the page submits a word (via curl ) to a dictionary site...how can I get get just the requested content in the output display? do I have to strip everything or is is there a way to just grab the targeted content without retriving and stripping the rest of the page (images, text etc etc)
  21. what does this mean?>>>"whatever your captcha is" am I supposed to paste the whole script ?(see above code) likewise with "// Add your search code here. search for $_POST['query']" if I paste both the scrips it throws endless line erors after some hacking I can get the from to display with a single submit button...however it does nothing...if I assign the form action to the search script it ignores the captcha function...
  22. Captcha Script: <?php /**************************************************************************************** Audio & Visual CAPTCHA v1.3 By Nicklas Swärdh - nick@nswardh.com www.nswardh.com (Please respect the author, do not remove these lines!) ****************************************************************************************/ session_start(); // Bake a session-cookie. Will be used in audio.php to validate the download of the generated mp3 file! $_SESSION['downloadprotect'] = md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR']); // Recieve the form... if (isset($_POST['submit'])) { $code = trim($_POST['code']); // Compare the entered code with the CAPTCHA using md5() hashes if (md5($code) == md5($_SESSION['sess_captcha'])) { echo "<p style=\"color: #00ff00\">Yup, the code is correct!</p>"; } else { echo "<p style=\"color: #ff0000\">Hey, listen up and try again!</p>"; } } /* NOTE: A few chars has been removed, to prevent confusion between the letters. The removed chars are: Bb - could be confused with number 8 and spoken Pp I - could be confused with number 1 l - could be confused with number 1 Nn - could be confused with the spoken Mm Zz - could be confused with the spoken Cc */ $_SESSION['sess_captcha'] = substr(str_shuffle("0123456789acdefghijkmopqrstuvwxyACDEFGHJKLMOPQRSTUVWXY"), 0, 4); ?> <p><a href="http://www.nswardh.com/shout">Audio & Visual CAPTCHA - v1.3</a></p> Having a hard time to read? Move your mouse over the speaker...<br /> (The following chars has been removed to prevent confusion: <i>Bb, I, l, Nn and Zz</i>) <div style="float: left; margin-right: 10px"><img src="visual/visual.php" alt="" title="Cant read the numbers? Move the mouse over the speaker and listen..." style="border: 1px solid #000000" /></div> <div style="float: left"> <object type="application/x-shockwave-flash" name="movie" data="audio/voice.swf" style="width: 50px; height: 57px"> <param name="movie" value="audio/voice.swf" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="menu" value="false" /> <param name="quality" value="high" /> </object> </div> <div style="clear: both; padding-top: 15px; padding-right: 15px"> <form method="post" action="" style="margin: 0px;"> <input type="text" maxlength="4" name="code" id="code" /> <input type="submit" name="submit" value="Verify" /> </form> </div> Existing search script form: <form action="<?php echo $self; ?>" method="post"> <input type="text" name="query" /> <input type="submit"> </form>
×
×
  • 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.