Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. That is how it should be done if that is what you want. Way to solve your own question
  2. PHP Curl Send Post Data
  3. Look into curl as that will allow you to send data via POST to an outside website.
  4. strtotime would be the function to look into. You may have to convert that date into a different format however using explode or a similar method to re-construct into a format that strtotime will take.
  5. Your code is honestly a mess. You have the whole HTML in the body, however you go in and out of PHP inside of the string variable. This is not kosher, look at the code you posted on reply #6, you will see where the highlighting goes haywire and yea. I would suggest using ob_start and remove the string definition of the $body. You will have to unescape all the " quotes but it will make it work for you. $subject ="SRC: Invoice"; ob_start(); ?> <!-- your html/php code here --> <?php $body = ob_get_contents(); ob_end_clean(); if(!mail($to, $subject, $body, $headers)){ die("Error sending message"); } ?> You should also look up into variable definitions and proper syntax as well. As it is just a massive mess and clear that you do not fully understand how it should work.
  6. Ok, so what exactly are you asking here? $result = mysql_query("SELECT * FROM table_name WHERE uid = " . $userid); while ($row = mysql_fetch_row($result)) { $newSQL = "INSERT INTO table VALUES ('', {$row[0]}, '{$row[2]}', {$row[3]}, '{$row[4]}', {$row[5]}, {$row[6]}, '{$row[7]}')"; mysql_query($newSQL); } Is that what you are looking to do?
  7. // perform query $result = $mdb2->query($sql); $apps = array(); // get results if ($result != null) { // build app array while ($row = $result->fetchRow()) { $apps[] = $row; } print_r($apps); } Should produce a multi-dimensional array.
  8. ODBC are the functions you want to look into. Particularly the odbc_fetch_row function.
  9. lol I do not get paid that much. It would be nice, but oh well. And actually this forum is run off of donations, so I just donate my time here.
  10. To answer why you would use sessions to store user data over a cookie is that session files are stored on the server. Thus you have to authenticate to that sessionid in order to retrieve that data. With Cookies anyone can potentially steal the cookie with a trojan or spyware and use that to authenticate to the site and viola they have all your information. So it is generally better to store the data on the server, where it is less likely to be hacked etc. But as neil suggested, cookies should be used to provide a means of authenticating a user and then you can store the user data in session for that session.
  11. Post the code where the data is entered into the DB. get_magic_quotes_gpc if that returns true magic quote are on, if false they are off.
  12. When you view the source of the page that the iframe is on, what is the html code returned?
  13. Change this: <?php echo (!$sitestyle)?'orange':$sitestyle ?> To be: <?php echo $sitestyle; ?> Because you set the default value with the code ignace provided to you. See if that gets you up and working.
  14. Nope, your script will know where the temp folder is. To use the move_uploaded_file function you need the temp filename, which on your processing part should be something like $_FILE['tmpname'][0] or something similar, this can be looked more in depth at PHP.NET File Upload for the proper calling/usage. I am sure the user contributions will answer most of your questions. Your best bet to get answer to your questions is setup your script and try it. I honestly do not know what happens on a duplicate, cause I rename any files uploaded to a hash and store that hash in the DB with it's name to avoid issues like this.
  15. <iframe frameborder="0" src="http://clients.mindbodyonline.com/ws.asp?studioid=<?php echo $_GET['studioid'];?>&stype=<?php echo $_GET['stype'];?>&sView=<?php echo $_GET['sView'];?>" title="Gentle Journey Online Booking System" width="915" height="1000" align="middle"> </iframe> Try that. Notice you were echoing the assignment. Not sure why it would work sometimes and not others, but hopefully that fixes your issue.
  16. To me it sounds like a Caching problem on the box where you are noticing this issue. Clear your browsers cache and temporary files and see if that helps.
  17. The point is, you strip out/replace all non-numeric characters. What this will do is give you just the numbers. If someone enters something like you have above, it would be valid, and it would just pull the numbers. It would be the exact same if they just typed in 1234432565 which would be valid. They key is the honest people will enter in the number how they want without fuss and the ones who do not want their number entered will enter in a fake number anyway. This way accommodates both people and does not tick off the honest person because they have to follow a set mask, which is annoying. However, the field should be limited to x characters on the form side so like 15 or 16 characters max. But as long as you get 10 digits out of it, thats a phone number and it is validated. EDIT: I mean honestly how are you going to tell if the phone number is truly a number? Find a webservice or database of numbers/area codes and match them to their zipcode ??? I highly doubt it. Entering phone numbers is more on the lines of the "honor policy" than anything.
  18. If register_globals was turned off, which it would be a good thing if it was, then you are going to have to convert any item that comes from a form/cookie/get/server variable to the new standard: header("Location: {$_SERVER['HTTP_REFERER']}"); Would be the correct way to write that statement.
  19. I always use sessions. The way users block sessions is by having cookies turned off or disabled. I do not think you should worry about this, at that is a small amount of users and they tend to know it is an issue. Alternatively, you can configure apache/.htaccess to append the sessionid to GET data, which is not SEO friendly but would allow anyone browsing to not have cookies turned on. But as stated above, it is really not an issue at all.
  20. You have 2 href's inside of that one anchor tag. You are using single quotes within single quotes, which will cause a syntax error in Javascript. $link = "<a href='javascript:void(0);' onclick=\"window.open('xxx.php?rec=$record', '', 'width=800, height=1000, scrollbars=no')\" class='CT'>View Record</a>"; Should fix it.
  21. $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; $headers .= "From: Admin <admin@salmonsreach.org>"; You were missing the .= on the 3rd header statement. Also I find that \r\n is better for sending header information. Why it was not working as the 3rd header statement was wiping the previous, so it was not sending the right mime-version or content-type.
  22. Not exactly. It should be used on any textual user input. If the input is suppose to be numeric, you should check for that and make sure it is the type that it should be.
  23. Well your form is not setup properly as you do not have a <input in it. It seems like you may want to read up on some HTML Form Basics. I would recommend looking at one or a few tutorials on PHP Contact Form to help get you rolling.
  24. If you are not receiving the mail, and you are using GMail, Hotmail, Yahoo, AOL etc, they are simply filtering it as SPAM. I highly doubt you can get around it, but you should contact your host and ask them what they suggest for you to use as headers etc for the mail function. If wipro.com is your domain name, I have had issues on my server of mail not being sent to any address @mydomain.com. I still have not found a resolution, but yea. Maybe your host will know why.
  25. hw.php <?php echo "<?xml version=\"1.0\" ?> <title>Hello World</title>"; ?> On the remote site call: <?php $hw = simplexml("http://www.othersite.com/hw.php"); echo $hw->title; ?> I am unsure if that works, but that is the basic gist of what I know of a webservice. simplexml is how you would read it out, and I do not know if I setup my XML right or echo'd the object property right. So yea. The above is a real rough example that is untested. WebService on Wikipedia EDIT: For a more (much more) advanced webservice look into soap. The method I have shown, is not really a "webservice" per say. But for something simple, that would work. If you are looking for a real-world solution SOAP is definitely what you are going to need to use/look into.
×
×
  • 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.