Jump to content

xnowandtheworldx

Members
  • Posts

    89
  • Joined

  • Last visited

    Never

Everything posted by xnowandtheworldx

  1. To #1: That is referred to as skinning and isn't part of the PHP forum. You would find better help in the HTML section, and reading up on the documentation for the Simple Machines Forum on how to skin your forum. (http://docs.simplemachines.org/index.php?topic=233.0) To #2: We need to know what the name of the addon is in order to try and help you out with that.
  2. It's not a text field, people are just able to make posts which everyone is able to see. We just don't want anyone typing in their address in the text and giving it out to whoever. Thanks businessman I'll be sure to check that out! Thread will be marked as complete.
  3. Hey guys, we have a website where people are able to post things, and we don't want to allow anyone to be able to post their street address, for obvious reasons. I'm really stuck on this one, I've looked for some regular expressions to no avail...one idea we did have was to check a text for an address then check to see if it was a valid address with the google maps API but then again...it goes back to having a regular expression for capturing the street address. I was wanting to know, is there any way I will be able to catch whether a user has posted an address? I was going to post this in the regex section but I'm not sure if I should use any regex's or if there might be another way. Put basically I need to be able to strip a street address from the text if a user posts one. I'm pretty sure it's probably not possible, but I figured I'd ask first. Thanks for any help anyone can provide!
  4. Awesome! Thanks for this! Should help immensely!
  5. I have a new project coming up, and one of the functions that this person wants is to convert word documents/pdf/html etc. to the ePub format. I've googled, but i haven't been able to find any code references for getting this accomplished...has anyone had any experience with this? Any suggestions? Any help would be appreciated! Also, I wouldn't mind an API if there even is one...
  6. Okay, I'm just about done developing a website, and I have it set up to where after the paypal IPN shows that the transaction has been completed, the users serial number for the application is delivered to their email. This works great, except with ATT.NET. I've read that AT&T automatically deletes any emails that they believe have forged headers. Do you guys think there is anyway that I can get around this? Or will I just have to make it to where they are not allowed to use ATT.NET emails? Such a pain in the ass... I'm open to any suggestions!
  7. <?php $mystring = "Some apple is eating my orange but not my watermelon about."; function notInList($string) { $frags = array('as', 'is', 'about', 'us', 'at'); $words = explode(' ', strtolower($string)); $replace = array(',','.','\'','!'); //replace common punctuation so that it can still recognize words $count = 0; foreach($words as $word) { if(!in_array(str_replace($replace, '', $word), $frags)) { //All you had to do was add an ! in front of the in_array, so essentially, it is now trying make sure that the words in $frags are NOT in the string...if that makes sense? echo str_replace($replace, '', $word) . '<br/>'; $count++; } } return $count; } echo notInList($mystring) . " words."; ?> I believe this is what you wanted, if it's not just let me know, and I'll see what I can do.
  8. Ah, okay, sorry about that, well, if you can't figure out how to change it post here, and I will post the updated code and let you know how I set it up.
  9. <?php $mystring = "Some apple is eating my orange but not my watermelon about."; function notInList($string) { $frags = array('as', 'is', 'about', 'us', 'at'); $words = explode(' ', strtolower($string)); $count = 0; $replace = array(',','.','\'','!'); //replace common punctuation so that it can still recognize words foreach($words as $word) { if(in_array(str_replace($replace, '', $word), $frags)) { echo str_replace($replace, '', $word) . '<br/>'; $count++; } } return $count; } echo notInList($mystring) . " words."; ?> I commented where you had made your mistake. EDIT: I also made it to remove punctuation so that it can still recognize the word even if it has an ',!. at the end of it.
  10. Yeah, I'll do a little investigation to see if there might be a better way to accomplish this. Unfortunately, not atm(to my knowledge). It sucks that they don't provide an API. EDIT: Wow, now I see what you're talking about. Didn't know that Sony changed the trophy layout. DAMN YOU SONY! lol ya. I'd actually devote some time to developing this if it was worthwhile but being these two large companies they aren't going to keep stuff right longer than a few months.
  11. Unfortunately, not atm(to my knowledge). It sucks that they don't provide an API. EDIT: Wow, now I see what you're talking about. Didn't know that Sony changed the trophy layout. DAMN YOU SONY!
  12. Set up a query that grabs the users data from the database with the given id. example: $id = mysql_real_escape_string($_GET['user_id']); //Lets say it equals 1 $query = "SELECT * FROM users_table WHERE id = " . $id; $result = mysql_query($query); $data = mysql_fetch_array($result); echo $data['username']; //if the row is a username, it would echo that username I tried to explain as best as possible, I'm not good at explaining. Hope I was at least able to help a little. EDIT: I think I may have misunderstood what you meant. If I did, I apologize.
  13. Sorry for the bump, but I have actually written a class for doing this. http://www.phpclasses.org/browse/package/5886.html Mods, if you view this as advertising, then please, by all means remove the link. I just didn't want to have to post all of my files in this topic.
  14. The name for the gender boxes are, 'dgender' not 'gender'. $dgender=$_POST['dgender']; //Don't forget to wrap dgender with ' same goes with the rest of your post vars too
  15. <form action="http://localhost/Processorder.php" method="post"> <table border="0"> <tr bgcolor="#cccccc"> <td width="150">Item</td> <td width="15">Quantity</td> </tr> <tr> <td>Tires</td> <td align="center"><input type="text" name="tireqty" size="3" maxlength="3" > </tr> <tr> <td>Oil</td> <td align="center"><input type="text" name="oilqty" size="3" maxlength="3" > </tr> <tr> <td>Spark Plugs </td> <td align="center"><input type="text" name="sparkqty" size="3" maxlength="3"> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit Order" </td> </tr> </table> </form> And the PHP script it calls is: <html> <head> <title>Bob's Auto Parts-Order Results</title> </head> <body> <h1>Bob's Auto Parts</h1> <h2>Order Results</h2> <?php echo '<p>Order Processed.</p>'; $tireqty = $_POST['tireqty']; $oilqty = $_POST['oilqty']; $sparkqty = $_POST['sparkqty']; $totalqty = 0; $totalqty = $tireqty + $oilqty + $sparkqty; echo "Items ordered: " , $totalqty , "<br>" ; define('TIREPRICE', 79.95); define('OILPRICE', 5.98); define('SPARKPRICE', 4.95); $tireprice = ($tireqty * TIREPRICE); $oilprice = ($oilqty * OILPRICE) ; $sparkprice = ($sparkqty * SPARKPRICE); $taxrate = 0.06; //Sales tax is 6% $totalbill=0.00; $tirebill=0.00; $tirebill=$tireqty*$tireprice; echo "Tires: " , $tireqty , " at $" , $tireprice , " = $" , number_format($tirebill,2) , "<br>"; $oilbill=$oilqty*$oilprice; echo "Quarts of Oil: " , $oilqty , " at $" , $oilprice , " = $" , number_format($oilbill,2) , "<br>"; $sparkbill=$sparkqty*$sparkprice; echo "Spark Plugs: " , $sparkqty , " at $" , $sparkprice , " = $" , number_format($sparkbill,2) , "<br>"; $totalbill=($tirebill+$oilbill+$sparkbill); echo "Total Taxable = $" , number_format($totalbill,2) , "<br>"; $totalbill*=(1+$taxrate); echo "Total with Tax = $" , number_format($totalbill,2) , "<br>"; ?> </body> </html> You were trying to use PHP's globals. NEVER use PHP globals with the forms. I know there is a name for them but it slips my mind atm. So basically, when you need info from the forms use $_POST['form_input_name_here']; to get your data. EDIT: Ah HAH! I remember now, it's called Register_Globals. Read about it at http://ca.php.net/manual/en/security.globals.php
  16. I also needed the same solution. The best way, for pure PHP is to get the users IP and also their ISP name and authenticate from that, but seeing as how alot of people have dynamic ips and this information is easily spoofed its not very foolproof. One suggestion that I have seen is using flash cookies. For an average user they will usually have no clue how to clear those cookies. Either way its up to you. Hope I've provided you with a little bit of information. Edit: Woops, stated the dynamic IP thing and what not like you did sorry had another thread on my mind lol. Wish their was an easier way to do this in PHP.
  17. Your welcome don't forget to click "Topic Solved!" down at the bottom. Glad I could help.
  18. <form action="file:///Users/alan/Desktop/feedback.php" method="post"> do you have the file in which the data posts on your server?
  19. Well I tested the code on my server, and the PHP code seems to be running fine, it could possibly be the apache configuration. I would make sure that your file has the correct file extension....other than that I don't really know what to tell you. Hopefully someone else can provide some input as well as I'm a noob when it comes to PHP/Apache configuration.
  20. Wow....I can't believe I didn't even think of that, as I'm using that very system on one of my other sites haha! Thanks for reminding me Mchl, I appreciate it!
  21. Well for one, you need to format your code when you post here within the php tags. two its fragmented code...do you not have the full code? without the full code it can't be much help, but I have a feeling you forgot an opening PHP tag. is_valid) { header( "Location: $errorurl" ); exit; } } if (empty($email)) { $email = $mailto ; } $fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ; if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $fullname\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; $headers = "From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.15.0" . $headersep . 'MIME-Version: 1.0' . $headersep . $content_type; if ($use_envsender) { mail($mailto, $subject, $messageproper, $headers, $envsender ); } else { mail($mailto, $subject, $messageproper, $headers ); } header( "Location: $thankyouurl" ); exit; } //missing a closing bracket too ?>
  22. One of my customers wants his website to only be accessed by people in which they bought the website membership from on their computer. He's afraid that the users might share their login's with their colleagues, in which, he loses money. I don't want to base this off of IP's as it's not reliable enough. Is there anything in which I can do to achieve this? Or am I going to have to tell him we have to scrap that idea. In case it was a little weird to follow along here's an example. A user comes to the website and buys a membership. He logs in and the membership is set so that they can only log in from that computer. If he attempts to login from another computer, it will flag that account, in which the user has 3 warnings, and then their username is removed. Sounds like a longshot but i figured I'd ask before I ruled it out. Thanks for any help. I love this forum...
  23. Yes, I know it's standard stuff. The point was I had tried to figure out on how to do it, but, of course, I didn't know until about...5 days ago that you could create new variables on the fly inside of a class. There were no other explanations for this, so if it could help someone out that was stuck, like me, then that's all I wanted to do.
×
×
  • 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.