Stripslashes function in PHP? Doesn't seem to work...

I've been trying to get the stripslashes() function in a PHP script to work but I'm not having any luck.  It seems like a very straightforward function but I'm still ending up with slashes in my comment/text area data.  Can anyone help?  I have some PHP books but they barely touch on the functionality.  (I'm new to PHP).  Thanks!  (BTW...  I removed the various attempts at calling the stripslashes() function).  The field I'm trying to remove the slashes from is the 'comment' variable.
Here is my short php script:
<?php // Script 1.0 - contactlist.php
if (isset($_POST['submit']) && !empty($_POST['submit'])) // Test if submit button named submit was clicked and not empty
          if (!empty($_POST['first']) && !empty($_POST['last'])  && !empty($_POST['email']) && !empty($_POST['phone']) && !empty($_POST['comment'])) {
                    $body = "First Name: {$_POST['first']}\nLast Name: {$_POST['last']}\nEmail Address: {$_POST['email']}\nContact Phone Number: {$_POST['phone']}\nContact Preference: {$_POST['contactvia']}\n\nBest Time To Contact: {$_POST['timepref']}\n\nComments:\n {$_POST['comment']}";
                    $body = wordwrap($body, 70);
                    mail('[email protected]', 'NEW Customer Inquiry Submission',$body, "From: {$_POST['email']}");
                    header('Location: index.html');  //Redirect to new url if form submitted
?>

I agree with you about the host not being able to install (or at least don't want to install/upgrade) their servers to php5.4...  Unfortunately, I can't change that...  but by shutting them off took care of all the quotes (single & double) and any other characters which would basically function like an addslashes() command.  I'll paste the script below...  It's still pretty much the same as when you helped me out with the script...  Just minor adjustments:::  If you can show me (even though I fixed the problem) how I would integrate the stripslashes() function to the comment field it would be helpful to know for future reference.
<?php // Script 1.0 - contactlist.php
if (isset($_POST['submit']) && !empty($_POST['submit'])) // Test if submit button named submit was clicked and not empty
          if (!empty($_POST['first']) && !empty($_POST['last'])  && !empty($_POST['email']) && !empty($_POST['phone']) && !empty($_POST['comment'])) {
$comment=stripslashes($_POST[comment]);
                    $body = "First Name: {$_POST['first']}\nLast Name: {$_POST['last']}\nEmail Address: {$_POST['email']}\nContact Phone Number: {$_POST['phone']}\nContact Preference: {$_POST['contactvia']}\n\nBest Time To Contact: {$_POST['timepref']}\n\nComments:\n {$_POST['comment']}";
                    $body = wordwrap($body, 70);
                    mail([email protected]', 'NEW Customer Inquiry Submission',$body, "From: {$_POST['email']}");
                    header('Location: index.html');  //Redirect to new url if form submitted
?>

Similar Messages

  • What is going on with the scroll function? It doesn't seem to work in any applications, now that I downloaded the new Mountain Lion?

    What is going on with the scroll function. It doesn't seem to work ever since I downloaded Mountain Lion.

    I've noticed this too...when I'm in Safari, scrolling is a bit jerky and sometimes it stops even though I'm still scrolling...my fingers go right off the trackpad.  I just downloaded the new updates onto my brand new macbook air- had to do it manually as "power nap" doesn't work, even after the SMC reset.  Lamesauce.

  • My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    Thank you both for your responses but my daughter was reassured by the salesman in the iStyle store (official Apple store in the UAE) that iMessages would work but conceded that FaceTime wouldn't. My iTunes account is registered in the uk and my daughter's iPhone has iMessages even though she bought it (and uses it) in Dubai. Can anyone else throw any light on this?

  • Numbers application on Ipad, the 'VALUE' function doesn't seem to work correctly on the string/text I want to convert to a value.

    Hi, I would appreciate if someone could assist with the following.  On the Numbers application on my Ipad, the 'VALUE' function doesn't seem to work correctly on the string/text which I want to convert to a value.  It gives me an error (in my example: 'VALUE requires a string specifying a number, but found "-14308.65" instead.'
    The exact same document (if converted from Numbers to excel), displays the converted string/text correctly in MS Excel as a value though.

    click on the cell then in the formula bar and use the arrow keys to move the cursor to see if there are any other characters in the cell that could confuse the function.  Also make sure the localization for your country is correct in System Prefs.
    Maybe copy the EXACT contents of the cell and post here.

  • I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?

    I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?    

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Pdfmark code in MS Word 2008 doc doesn't seem to work properly to create Named Destination

    Hi all,
    I've been having trouble with creating Preview-compatible Named Destinations in Acrobat 9.x (see http://forums.adobe.com/thread/770470?tstart=0).  Distiller, on the other hand, appears to create compatible Destinations, so as a last-ditch effort, I tried to go back to my original source file (Microsoft Word 2008 document) to use Distiller's pdfmark functionality, to see if maybe I could finally get a PDF with Preview-compatible Destinations.
    Following instructions found elsewhere on this forum, I went into Word and inserted the following field into a test location in my document:
    PRINT "[ /Dest /testdest /View [ /XYZ null null null ] /DEST pdfmark"
    This field code is supposed to then cause a pdfmark to be inserted into the resulting PostScript and/or PDF files.  Distiller is supposed to understand this and turn it into a Named Destination called "testdest."  However, it doesn't seem to work - I don't see the pdfmark code in the PS file, and the PDF file doesn't have any Named Destinations in it.
    I'm using Acrobat 9.x on Mac OS X 10.6.5, so I tried this two different ways:
    1) Using the "Print to Adobe PDF" workflow (which replaced the "Adobe PDF Printer" from previous OS/Acrobat versions) - this automatically generates a PDF via (presumably) an API call to Distiller... and
    2) Using the "Print to Postscript" workflow to generate a PS file, which I then ran through Adobe Distiller.
    In neither case did I end up with a named destination in the PDF file, as I was supposed to.  In case #2, even the Postscript file didn't have a pdfmark embedded in it.  Thus, I'm assuming that perhaps this is particular issue may be a problem with MS Word 2008 rather than with Acrobat... but I'm hoping someone might have a clue as to how to fix it.
    I welcome ideas on how to get Word 2008 to properly output pdfmark code, so that Distiller will pick it up and properly embed a Named Destination into the PDF...
    Thanks in advance.
    (If anyone has ideas about the Preview-compatible problem, linked above, that would also be great!)

    You're suggesting that it was never fixed from Word 2004 to 2008?  Possibly.  I wonder if it's fixed in Word 2011?  Anyone know?  But is it really a Word problem, rather than a Distiller issue?
    I appreciate your offer, though I do have access to Word on Windows (2003, I think), so I could try Distilling there... I only worry about formatting, since there are minor differences (e.g. font kerning, etc.) between Mac and Windows that are subtle, but sufficient to create formatting issues for very long documents (e.g. pushing figures onto the wrong pages, etc.).  That would be a rather big problem.
    The question remains whether this is an issue with Word or Distiller, though... and whether it's fixed in Distiller X and/or Word 2011.
    Adobe, care to comment?
    I'd really love to find a proper Mac solution, if one exists... it would be rather a slap to Mac users if a solution doesn't exist.

  • Oraenv doesn't seem to work

    Version : 11.2.0.3
    Platform : Oracle Linux 6.3
    oraenv doesn't seem to work as shown below. I haven't set ORACLE_SID in the .bash_profile as this server is going to have multiple DBs in future. So, I need to use oraenv script to set env variables.
    Trying to source oraenv file.
    $ . oraenv
    ORACLE_SID = [oracle] ?
    Ideally, it should prompt the SID listed in /etc/oratab file. So, in this case it should be something like
    $ . oraenv
    ORACLE_SID = [oracle] ? GRCFMS
    Here are the contents of my /etc/oratab file and .bash_profile
    # su - oracle
    $
    $
    $
    $
    $
    $
    $ whoami
    oracle
    $ pwd
    /home/oracle
    $ cat .bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi
    # User specific environment and startup programs
    #PATH=$PATH:$HOME/bin
    #export PATH
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1
    #export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/bin
    $
    My oratab file
    $ cat /etc/oratab
    # This file is used by ORACLE utilities.  It is created by root.sh
    # and updated by either Database Configuration Assistant while creating
    # a database or ASM Configuration Assistant while creating ASM instance.
    # A colon, ':', is used as the field terminator.  A new line terminates
    # the entry.  Lines beginning with a pound sign, '#', are comments.
    # Entries are of the form:
    #   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
    # The first and second fields are the system identifier and home
    # directory of the database respectively.  The third filed indicates
    # to the dbstart utility that the database should , "Y", or should not,
    # "N", be brought up at system boot time.
    # Multiple entries with the same $ORACLE_SID are not allowed.
    GRCFMS:/u01/app/oracle/product/11.2.0.3/dbhome_1:N
    $
    $
    $

    Max wrote:
    Version : 11.2.0.3
    Platform : Oracle Linux 6.3
    oraenv doesn't seem to work as shown below. I haven't set ORACLE_SID in the .bash_profile as this server is going to have multiple DBs in future. So, I need to use oraenv script to set env variables.
    Trying to source oraenv file.
    $ . oraenv
    ORACLE_SID = [oracle] ?
    Ideally, it should prompt the SID listed in /etc/oratab file. So, in this case it should be something like
    $ . oraenv
    ORACLE_SID = [oracle] ? GRCFMS
    Here are the contents of my /etc/oratab file and .bash_profile
    # su - oracle
    $
    $
    $
    $
    $
    $
    $ whoami
    oracle
    $ pwd
    /home/oracle
    $ cat .bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi
    # User specific environment and startup programs
    #PATH=$PATH:$HOME/bin
    #export PATH
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1
    #export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/bin
    $
    My oratab file
    $ cat /etc/oratab
    # This file is used by ORACLE utilities.  It is created by root.sh
    # and updated by either Database Configuration Assistant while creating
    # a database or ASM Configuration Assistant while creating ASM instance.
    # A colon, ':', is used as the field terminator.  A new line terminates
    # the entry.  Lines beginning with a pound sign, '#', are comments.
    # Entries are of the form:
    #   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
    # The first and second fields are the system identifier and home
    # directory of the database respectively.  The third filed indicates
    # to the dbstart utility that the database should , "Y", or should not,
    # "N", be brought up at system boot time.
    # Multiple entries with the same $ORACLE_SID are not allowed.
    GRCFMS:/u01/app/oracle/product/11.2.0.3/dbhome_1:N
    $
    $
    $
    if in fact you did exactly as posted above, the su - oracle established a new process which knows nothing about the previous invocation of oraenv
    BTW - never use OS "root" when dealing with Oracle DB

  • LR5 's Adjustment Brush doesn't seem to work-does the New Radial Filter have priority?

    So why in the world would I update Lightroom in the middle of a job.?
    Before I was able to do in and touch up shadowy areas using (K) adjustment brush, but now it doesn;t seem to work. The radial brush does a good job for a defined area but for SPOT touching I have always used the the adjustment brush?
    Is there a setting or am I missing something or is this a bug?

    The presence of the Radial Filter in the tool set should have no effect on the Brush. It continues to work just as it always has. In fact, even if the RF is open (I sometimes hit it by mistake when I really want the Brush) and you click on the Brush icon, the RF closes and the Brush opens. If your Brush is not functioning properly, it is very unlikely that the RF is the reason. The usual first aid for any LR misbehavior is to close LR, remove the Preferences file from its folder and relaunch LR, allowing it to make a new preferences file. Not guaranteed to solve the problem, but worth trying.

  • Using a jQuery list box placed onto a tab control doesn't seem to work for posting?

    Hello,
    I developed a U.I. in Dreamweaver for a  product and have several list boxes that use the onChange modifier to collect what the user selects from the list. I use the onChange=this.form.submit() function to grab the user's selection from the list box..
    When this dropdown list box code is placed onto a form, it posts properly and I can retrieve the user's list selection.  If however I place the list box code onto a Tab page from a jQuery Tab Control, developed in Dreamweaver, the posting doesn't seem to work.
    I must be missing something because identical code is working fine when the list box code is placed on a form yet when the code is repeated from within a Tab, it isn't working.
    The code is simple, and shown below).  The list values are coming from a MySQL table.
    $MyQuantity_query="SELECT * FROM Quantity_Table";
    $MyQuantity_Result=mysqli_query($cxn,$MyQuantity_query) or Die ("Cannot connect");
    echo"<select name='ThisQuantity[$RowCounter]' value='ThisQuantity[$Rowcounter]' onChange='this.form.submit()'><option value='-1' selected>Qty</option>";
    While($MyQuantity_Row=mysqli_fetch_assoc($MyQuantity_Result))
       extract($MyQuantity_Row);
       echo"<option value='$Qty_Number'>$Qty_Number</option>";
    echo"</select>";
    Any suggestions would be appreciated.  Thanks.
    Joel
    [email protected]

    Thanks you.
    I tried placing the selection list inside of
    tags but posting still doesn’t seem to be working? 
    Regards,
    Joel

  • My iPhone 5 randomly shutdown and rebooting doesn't seem to work for me, what should I do?

    It also happens when I'm charging my phone, and also the battery percentage doesn't show that correct battery level not unless I turn off and on.. I tried rebooting the phone but it doesn't seem to work for me, random shutdown still happens..

    Will not turn on, will not turn on unless connected to power, or unexpected power off
    Verify that the Sleep/Wake button functions. If it does not function, inspect it for signs of damage. If the button is damaged or is not functioning when pressed, seek service.
    Check if a Liquid Contact Indicator (LCI) is activated or there are signs of corrosion. Learn about LCIsand corrosion.
    Connect the iPhone to the iPhone's USB power adapter and let it charge for at least ten minutes.
    After at least 30 minutes, if:
    The home screen appears: The iPhone should be working. Update to the latest version of iOS if necessary. Continue charging it until it is completely charged and you see this battery icon in the upper-right corner of the screen . Then unplug the phone from power. If it immediately turns off, seek service.
    The low-battery image appears, even after the phone has charged for at least 20 minutes: See "iPhone displays the low-battery image and is unresponsive" symptom in this article.
    Something other than the Home screen or Low Battery image appears, continue with this article for further troubleshooting steps.
    If the iPhone did not turn on, reset it while connected to the iPhone USB power adapter.
    If the display turns on, go to step 4.
    If the display remains black, go to next step.
    Connect the iPhone to a computer and open iTunes. If iTunes recognizes the iPhone and indicates that it is in recovery mode, attempt to restore the iPhone. If the iPhone doesn't appear in iTunes or if you have difficulties in restoring the iPhone, see this article for further assistance.
    If restoring the iPhone resolved the issue, go to step 4. If restoring the iPhone did not solve the issue, seek service.

  • How do you reset/repair javascripts? Enabling doesn't seem to work

    When I enter various websites, they list an advisory message that I must enable javascripts in order to use their sites. When I enable javascripts from the contents section from tools in firefox, it doesn't seem to work. How can I reset or repair the javascripts function in the firefox program to allow me to access and use various websites?

    The website you mentioned http://www.arbitersports.com is opening fine (see attached screenshot) without any error messages or warnings on my Win Xp & Firefox 9.0.1..
    -> [[JavaScript]]
    * http://kb.mozillazine.org/JavaScript
    -> [[Using the Java plugin with Firefox]]
    -> Perform the suggestions mentioned in the following articles:
    * [https://support.mozilla.com/en-US/kb/Template:clearCookiesCache/ Clear Cookies & Cache]
    * [[How to clear the cache#w_clear-the-cache|Clear the Network Cache]]
    * [[Troubleshooting extensions and themes]]
    Check and tell if its working.
    -> Update Firefox to the latest version (9.0.1)
    * [[Updating Firefox]]
    -> Update All your Firefox Plugins
    * https://www.mozilla.org/en-US/plugincheck/
    * '''When Downloading Plugins Update setup files, Remove Checkmark from Downloading other Optional Softwares with your Plugins (e.g. Toolbars, McAfee, Google Chrome, etc.)'''
    * Restart Firefox

  • 2013 Workflows created in SharePoint Designer doesn't seems to work with retension policy!

    Hi Guys, 2013 Workflows created in SharePoint Designer doesn't seems to work with retension policy but 2010 workflows work. Any One have any details resaon or workarround?
    Shafqat Balouch MCT, MCSA, MCSE MCITP, MCPD, Microsoft Partner

    Hi  ,
    According to your description, I can reproduce your scenario in my SharePoint 2013.
    For the Retention Policy, it will schedule how content is managed and disposed by specifying a sequence of retention stages. In SharePoint Designer Workflow 2013, we have looping option available. You can
    use loop option and then pause for duration for achieving same function as Retention Policy to start a workflow.
    Reference:
    http://prasadtechtactics.blogspot.com/2012/07/sharepoint-designer-2013-workflows-part_24.html
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Eric Tao
    TechNet Community Support

  • USB Numeric Pad doesn't seem to work in "Screen Sharing" app.

    I have a MacBook Pro running Mountain Lion. Recently, purchased a new Targus AKP10AP USB Numeric Pad however, it doesn't seem to work in "Screen Sharing" app but seems to work fine in other apps. Screen\ Sharing.app doesn't seem to be able to recognise the numpad. If I connect a regular usb keyboard all seems to work fine - just the numpad doesn't seem to be recognized.

    First and foremost, XP SP2 is EOL on security updates. If possible I would strongly recommend Windows 7 instead.
    When you install XP, or Windows, fully upgrade first, then add Apple drivers, get it working fine. They say that 15 minutes is enough time to compromise a default XP install, and used as a "honey pot" to test what malware is circulating.
    I don't know about McAfee (I guess Google must) but for now or next time, try with just MS Security Essentials, free and gets high marks, it works.
    There are probably a lot of things to learn on a daily basis.
    But make sure what you install is current and compatible. And have backups and restore points so you can go back to earlier stable system state.
    And yes seems like the Windows partition or OS is not functional.

  • Wacom Tablet doesn't seem to work all of the time?

    I have a Wacom Intuos 3 tablet, not more than a year old. I recently installed it onto my Macbook Pro and it worked fine, but when I unplugged it and came back to work with it later, it doesn't seem to work. The mouse doesn't respond to where I click on the pad.
    So, I've reinstalled this a couple of times and was able to make it work perfectly, but today when I went back to work in photoshop, it doesn't seem to be responding again.
    Does anyone have any tips? I know that Leopard likes you to eject USB devices instead of just pulling them out of the slot, but I don't see anywhere to eject it.
    Does anyone know what's up?

    Downloaded a driver from website, tablet works now.

  • Safari on my iPhone 6 running 8.02 doesn't seem to work right. Some Java scripts don't show correctly and they do on other browsers I have downloaded. I tried almost everything and nothing seems to work to fix it. Please help.

    Some websites like the one of my college uses JavaScripts and they seem to load correctly to a certain point but then not really. For example in one it would say select an option from the left menu. And I do it hut nothing happens. But when I go to the same website in another browser on my phone. The JavaScript works completely and allows me to see whatever I was clickig on that menu. I have seen that there are other websites being affected too. I tried clearing my cookies and data. even restarted my phone. And doesn't seem to work. I don't know how change the configuration any more to make it work like normal. At first I thought it was my school's website but it never got fixed. And now I realized is my safari browser! I wanna keep using it since I am really familiar with It. If someone knows how to fix this please let me know!
    Thanks

    You can reset the SMC and see if that helps. If it's a unibody or Retina, follow the method for "a battery you should not remove yourself."
    http://support.apple.com/kb/ht3964

  • I'm travelling and trying to back up my new iPhone to iCloud. I have sufficient storage, am connected to wifi and it's plugged into a power source and yet it doesn't seem to work. Can anyone suggest what I'm doing wrong?

    I'm travelling and trying to back up my new iPhone to iCloud. I have sufficient storage, am connected to wifi and it's plugged into a power source and yet it doesn't seem to work at all. I'm currently in India. Could that be the cause or can anyone suggest any reason why this wouldn't work?

    "gets stuck" - are there any error messages?
    If you get the error "Backup not successful" and you've tried deleting the last backup and trying to back up manually without luck, try the following test:   Go to...
    Settings>iCloud>Storage & Backup>manage Storage, tap your device name in the Backups section, then look under Backup options.  Turn off all apps from backup and then do a manual backup.  If that doesn't work, then this post will not help.  If the backup works, then go back to the app list and turn some on and try another backup.  If successful, keep repeating these steps.  If it fails at some point, then try to zero in on the one app that seems to make the backup fail.  (I had this problem and found one app failing, probably due to a corrupt data file.)
    This process will take time, but if a backup works with no app data being used but clearly fails with the original settings, then somewhere in the mix of apps is a "bad" one.

Maybe you are looking for