PHP, handling # in a passage of the string in the query string

I'm new to PHP the world ASP. I'm working on a shopping cart where, I'm passing the name of the item through the query string in the processcart.php file. It works fine until I have put a sign # in the name of the element. Is there a good way to manage the channels with signs # among them.

David

DEPearson wrote:
> I'm new to PHP the world ASP. I'm working on a shopping cart where I
> pass the option through the query string name in the processcart.php file. It works
> great until I have put a sign # in the name of the element. Is there a good way to manage
> strings containing signs # among them.

PHP can handle # in a string without problems. The error that you are
manufacturing must pass # by a query string. In a URL, # indicates a
element named inside the page. To use # as a character who is preserved
as a literal value, you need to urlencode. You can either do
with the urlencoded function. It is probably easier to use the
URL directly: %23 represents #.

--
Adobe Community Expert David Powers
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Tags: Dreamweaver

Similar Questions

  • Problems with the primary key of the query string

    Moving from asp to php, to work with David Power's book: The Essential Guide to Dreamweaver CS4 with CSS, AJAX, and PHP.  Recycling of my brain, so starting from scratch in the learning process.

    Everything was going perfectly until I tried to add the primary key of a record in a query string.  I compared my code with the example code for the book, and everything matches.  When previewing the page in my browser and hover over the link which must pass the main code on the next page, the query string does not appear correctly.  It shows user_id = but no figure shows, as it is supposed to.  www.webpage.com/update_user.php?user_id=

    Here is my code: (Please note, <>have been removed, as I was unable to find a way view the code in the correct way here (copy/paste was doesn't work do not, nor insert syntax))

    ? PHP {?}

    ? PHP echo $row_listUser ['family_name'];? PHP echo $row_listUser ["FirstName"];?

    ? PHP echo $row_listUser ['username'];?       ? PHP echo $row_listUser ["admin_priv"];?

    a href = "update_user.php? user_id =? php echo $row_listUser ['user_id'];?" "Edit / has

    a href = "delete_user.php? user_id =? php echo $row_listUser ['user_id'];?" ' Delete / has

    ? PHP} while ($row_listUser = mysql_fetch_assoc ($listUser));?

    Any ideas that could help me understand why this part does not in particular would be greatly appreciated.  Writing to the database worked perfectly, I see that there are numbers in the database as user_id, and it is defined as my primary key in the configuration database.  Such a simple process that is causing me headaches!

    Thank you

    You have the code to request a copy in your folder:

    $query_listUser = 'SELECT user_id, username, first_name, family_name, admin_priv from users ORDER BY family_name ASC';

    $listUser = mysql_query ($query_listUser, $connSCFDIR) or die (mysql_error ());

    $row_listUser = mysql_fetch_assoc ($listUser);

    $totalRows_listUser = mysql_num_rows ($listUser);

    $query_listUser = 'SELECT username, first_name, family_name, admin_priv from users ORDER BY family_name ASC';

    $listUser = mysql_query ($query_listUser, $connSCFDIR) or die (mysql_error ());

    $row_listUser = mysql_fetch_assoc ($listUser);

    The $listUser table will contain the results of the second query, which does not include the field user_id. delete the redundant code.

  • PHP: How to add integers only from strings sorted

    Hello

    I thought a lot about how it, but not have made any progress in my efforts.

    I have a few strings to form that are displayed in the variables when a form is submitted:

    String 1 = "Mark (2)"

    String2 = "Chris (5).

    String 3 = "Mark (5).

    Channel 4 = 'Angie (5).

    String 5 = "Chris (1).

    A shape is I want all integers to add for each person.

    So my final result:

    Brand = 7

    Chris = 6

    Angie = 5

    I don't know how to use php to add only integers of the variables that have the same names in them.

    Any suggestions?

    Chris

    It is essentially the construction of a database table that is structured as follows (the name is the key, score is the value):

    Table)

    [Mike]-online 1.

    [Chris]-online 8.

    [Mark]-online 9

    )

    As he travels the elements of the parsed string, it first checks if there is already an entry for the name if found. If this isn't the case, it creates one. If there is already an entry corresponding to the name, it adds the new score to what is already there.

    Here is another example of script where I removed the second function, that I used for the test output, and instead, it sends the results to variables. If it finds a key in the table corresponding to the name (it is case sensitive), and then it retrieves the score, otherwise he attributes a score of 0. I also added in the lines of comments explaining what is happening. If you need something explained, just post back. Here's the updated code:

    <>

    function to parse strings of name/stat

    function parseNameStats ($string, & $stats)

    {

    separate the string into groups, separated by commas

    $sets = explode (",", $string);

    Browse the main groups

    foreach ($sets as $subject)

    {

    divide the substring of parenthesis to separate the name of partition

    $temp = explode ('(', $subject);

    If (count ($temp) == 2)

    {

    first part must be a name, so trim whitespace

    $name = trim($temp[0]);

    second part is score, so create stat entry to add to the existing

    $int = (integer) trim($temp[1]);

    If ($name & $int)

    {

    If (! array_key_exists ($name, $stats)) $stats [$name] = $int;

    else $stats [$name] = $int;

    }

    }

    }

    }

    do it for her

    $stats = array();

    parseNameStats ('Mike (1), Chris (2), Mark (5)', $stats);

    parseNameStats ('Chris (5)', $stats);

    parseNameStats ('Chris (1), 4 ', $stats);

    assign scores to variables

    $mikeScore = (array_key_exists ('Mike', $stats))? $stats ['Mike']: 0;

    $markScore = (array_key_exists ('Brand', $stats))? $stats ['brand']: 0;

    $chrisScore = (array_key_exists ('Chris', $stats))? $stats ["Chris"]: 0;

    output test

    print ("Mike: '.") $mikeScore.', Mark: '. $markScore.', Chris: '. $chrisScore);

    ?>

  • Wheel rotation during the passage of the apps

    Hello

    I frequently meet the spinning wheel during the passage of the apps. For example an app can do one, but open window have not been used for a while and then when I click on the window to use it I get the wheel spinning for a few seconds.

    I am running Yosemite 10.10.5 on a MacPro Mid 2010) with 16 GB of ram and 12 GB available on the 300 GB SSD drive. I just realized that maybe space on the boot drive may be the cause, so I'll empty now and update if there is no change.

    Also, my SSD is a 500 GB Samsung SSD 840 EVO media and I think that the TRIM is not enabled? I read that TRIM was not based with SSDS of third party on my machine and was picking up information contradictory as to the time it was a problem or not. The lack of TRIM could be the cause of the spinning wheel?

    Duane

    You ran a 'cleaning', 'optimize' or 'speed up' apps on your Mac?  Have you installed an antivirus software?

    The 12 GB of free space must be sufficient and not to be the cause of the problem. Don't let him get any small however.

  • Mac Pro is not displayed after the passage of the screens

    OK, so this is a strange problem but it's very annoying (at least for me). I just bought a LG Ultrawide 29 "display and connected via a HDMI cable to my Mac Pro (Home machine) and a second HDMI cable to my Macbook Pro (desktop computer). The Mac pro / Macbook pro good work with the big screen, HOWEVER, when I use my Mac pro and select the tilt of the screen to switch to the HDMI 2 connection, it works and rocking on my Macbook pro. But when I try to switch it back to HDMI 1 (Mac Pro), it comes back with a black screen and says no signal. Even if I plug the HDMI cable it does not work. I set the timer to 3 hours sleep, doesn't always help. I know he's not missing sleep because itunes can be played when I spend and still playing music throughout and continued when I try to switch back. The only way I could get is long, press the button on my Mac Pro and restart.

    The only reasonable difference that I know is that the Macbook pro is running Yosemites, while my Mac Pro running Beta El Capitan. I have a feeling, this is probably the cause, but I just wanted to know if someone has solved this problem somehow.

    Thank you

    Hello Hemlock70,

    Thank you for using communities of Apple Support.

    I understand that your external screen remains completely black, with a message no signal, during the passage of the views.  For assistance with this problem, please go through the steps in the link provided below.

    Get help with graphical problems on external displays connected to your Mac.

    Take care.

  • I tried to install 300 photos on a USB I installed 170 photos and come with an Ox80070052 error message. Please advis how can I install the rest of the photos without the passage of the error.

    I tried to install 300 photos on a USB I installed 170 photos and come with an Ox80070052 error message. Please advis how can I install the rest of the photos without the passage of the error.

    Hi BrendaMay,

    Take a look at this link http://social.technet.microsoft.com/Forums/en/itprovistasetup/thread/bf17ed76-5164-4380-9140-16bd74e7c8c7 and check if the post by Ira Horowitz to Monday, December 24, 2007 15:04 is a good one to try.

    Kind regards

    SAP

  • I tried to install 300 photos on a USB I installed and come with an Ox80070052 error message. Please advis how can I install the rest of the photos without the passage of the error.

    I tried to install 300 photos on a USB I installed and come with an Ox80070052 error message. Please advis how can I install the rest of the photos without the passage of the error.

    Hello BrendaMay,

    ·         What exactly do you mean by saying that you install photos?

    ·         You try to copy photos from your computer to the USB key?

    Try to format the hard disk to the NTFS Format USB and check if you can copy the photos.

    If does not work, try to format to FAT32.
    1. type devicemgmt.msc in the Vista Start menu or in the Run dialog box.

    2 expand disk drives, right-click on your USB key that you want to format it in NTFS file system, and then select Properties.

    3. on the Policy tab, select optimize for performance option. Click OK and return to my computer.

    4. right click on your key USB. Select Format.

    5. Select NTFS from the drop-down list (you can also select FAT32).

    6. click on apply to format your drive to NTFS.

    Note: The pilot of formatting will destroy all data on the disk.

    If this does not work, try to create a new folder in the drive, and then copy the photos on this folder.

    Thank you

    Irfan H, Engineer Support Microsoft Answers. Visit our Microsoft answers feedback Forum and let us know what you think.

  • HP LaserJet Enterprise 600 m602 slow printing during the passage of the trays

    Hello world!

    On the HP LaserJet Enterprise 600 m602, who met breaks in print jobs during the passage of the trays?  Example, we are going to print invoices and we have a rule configuration that prints on plate 2 with the exception of the last page that is perforated paper tray 3.  So, in a job of 5 pages, pages 1-4 are the tray 2 paper... then page 5 is perforated tray 3.  There is a 2 to 3 seconds when the last page is extracted from tray 3.  If the invoice is only 2 pages, the print job appears super slow.

    This printer was working fine with no delay until we applied the firmware 2302786_433718.  Now, the delay is very noticeable.  We do not know if it was intentional or not in the new firmware.

    We use the latest PCL 5 Universal Print Driver.  The only thing that has changed is the firmware.  We even tried a full reset of firmware.  Problem is still there.

    I worked with HP support, but we were told to wait... the next version of firmware that may or may not fix everything.

    Any help or insight is appreciated.

    We have this same problem with our printer HP Laserjet 600 M602.

    Could solve by setting the Print Mode to all papertypes that are used for the same parameter.  We thought initially can be a problem, issue or firmware of the Board of adjustment, but in reality was the paper type settings. We set up printer for ordinary paper into tray 2 and tray 3, default regular bond has been set at light mode printing and binding for the print mode binding. Each time dial-up printer and trays, he stops to configure different paper type settings.

    Hopefully the other help solve their printing problems

    Enjoy your day,

  • How to store the query string value in the scope of the session in webcenter spaces?

    Hello

    I want to store the query string value (which is given from URL) in the sessionScope variable. According to the value of sessionScope beacause I went some components inside my taskflow. Can someone help me how to store this value in the scope of the session. I use webcenter spaces for my application development.

    Thank you

    Ashok.

    Please see the article below

    How to pass a parameter of argument the query URL to a parameter input workflow? (Doc ID 1545808.1).

  • Competitor not starting not not to DR after passage in the

    Hello

    We have successfully configured recovery disaster for 11i ebs on windows environment.

    Redo log shipping and applying normally and its working fine.

    After the passage of the primary on the eve, we synchronized with the new primary database application services.

    But while watching the concurrent managers, we are facing questions.

    In the concurrent Manager log as its display error

    Could not contact Service Manager FNDSM_ORACLEAP_HRDR. The TNS alias could not be located, the listening on ORACLEAP process could not be contacted or the listener cannot generate the process from the Service Manager.

    Could not contact Service Manager FNDSM_ORACLEAP_HRDR. The TNS alias could not be located, the listening on ORACLEDB process could not be contacted or the listener cannot generate the process from the Service Manager.

    We have made the steps below but make even persistent.

    (1) connect apps/primaryapps

    (2) exec FND_CONC_CLONE. SETUP_CLEAN;

    (3) validation;

    (4) run cmclean.sql

    (5) run on nodes DB, CM & WEB autoconfig.

    (6) run @%FND_TOP%\patch\115\sql\afdcm037.sql sccripts also.

    (7) we have correct host entries in the system hosts file.

    Kindly help me to solve this problem.


    Thanks and greetings

    Villi Kumar

    Hello

    The problem is solved now concurrent Manager is up and running after the digital switchover.

    Solution:

    After the passage of the database:

    ------------------------------------------

    Complete the Configuration of database:

    ----------------------------------------

    connect the apps/primaryapps

    SQL > exec fnd_net_services.remove_system ('HRDR');

    SQL > commit;

    SQL > exec fnd_conc_clone.setup_clean;

    run the automatic configuration on db

    lsnrctl stop STHRDR

    lsnrctl start STHRDR

    Synchronization of the application:

    -------------------------------

    disable the listener applcaiton both on the odes before running the automatic configuration.

    Run the autoconfiguration on cm node service

    Run the autoconfig on the node of the Web

    Check the node values using query below:

    ----------------------------------------------------

    Select nodeName in fnd_nodes;

    Select CONCURRENT_QUEUE_NAME from FND_CONCURRENT_QUEUES where CONCURRENT_QUEUE_NAME like '% FNDSM'; ---> to the result of the query, for me web node hostname only came so I ran script below.

    @%FND_TOP%\patch\115\sql\afdcm037.sql ---> this script updates the table with the details of the cm node

    now, it seems very well.

    Select CONCURRENT_QUEUE_NAME in the FND_CONCURRENT_QUEUES where CONCURRENT_QUEUE_NAME like '% FNDSM ';

    Then restart all servers.

    Now start the database and applications.

    Problem will solve itself.

    Concerning

    Villi Kumar

  • You can control a URL in eloqua to add to the query string?

    If I insert a URL in an email, I can't stop eloqua to add additional query string parameters in eloqua.

    I want to make this happen because the URL doesn't seem to work if we add an extra parameter using the query string.

    I had a similar problem recently, and even turn off the tracking doesn't seem to help.  I finally decided to use a shortened URL (bit.ly) and it worked for me.

  • Hi, I have adobe creative cloud and a Macbook. I want to the passage of the mouse to pen. Any recommendations?

    Hi, I have adobe creative cloud and a Macbook. I want to the passage of the mouse to pen. Any recommendations?

    The best solution is to buy a wacom tablet, go wrong with breakfast as the draw Intuos | Wacom , Intuos Photo | Wacom or the Art of Intuos | Wacom this way you cn get used to it.

  • CC in Lightroom on Windows 10 crashes during the passage of the library to develop.

    Everyone has a problem with Frost during the passage of the library to develop modules in Lightroom on Windows 10 CC?

    Hi mgmagney,

    This could be because of the graphics processor.

    Go to the Lightroom preferences > performance > uncheck 'use the graphics processor' > restart Lightroom, and then check out.

    Kind regards

    Claes

  • Larger images Popup during the passage of the mouse on the photos (was: in Dreamweaver CC 2015...)

    I have thumbnails that I would have larger popup on the passage of the mouse. Can't do it in any way. Any help?

    Here is an example usage of CSS3 transform:

    div #socialmedia a {img:hover
    -webkit-transform: scale (1.3);
    Transform:scale (1.3);
    -ms - transform:scale (1.3);
    }

  • PHP form script is missing from the web server or PHP is not properly configured on your web hosting provider. Help - I get this message on my site when the form is filled out and you press send... Check if the form PHP script has been downloaded correctl

    PHP form script is missing from the web server or PHP is not properly configured on your web hosting provider. Help - I get this message on my site when the form is filled out and you press send... Check if the form PHP script has been downloaded correctly, contact your host about the configuration of PHP.

    Hi Graham,

    If you, please add your site to this link ( http://my-site.com/scripts/form_check.php ) and make sure that all green checkmarks are appearing. If they don't, let us know what errors you seem to receive and include the link to your site.

    In addition, check out this guide on the forums of Muse troubleshooting: Troubleshooting Muse form used on the servers of third party Widgets

    I hope this helps!

    Emily

Maybe you are looking for

  • iCloud Drive not sync on iOS 10

    Hello As I moved to Sierra and iOS 10, my iCloud reader app on my iPhone is not in harmony with what is on my Mac. All my documents are missing. They are on my Mac, on iCloud.com, but will not be displayed in the app iCloud on my iPhone that doesn't

  • Why don't haven't seen a PDF in Firefox 36.0? (OS10.9.5)

    Since the upgrade to Firefox (OS 10.9.5) 36.0, a PDF file is again seen in Firefox: I am prompted to download and save them - even if in Firefox preferences, the default selection reads: Preview in Firefox. Help, please.

  • Compaq Mini 110: Polarity of power supply jack

    Hello I have a HP/Compaq Mini 110 that was given to me because both the battery and the AC adapter was lost. I have a power supply of the correct voltage (19 VDC) and can get an outlet of the right size. I need to know what the polarity of the plug m

  • Download the list of purchases

    How do I download a list of my purchases in a given year? I have gone to my account and found the purchases, but it won't let me even save the pages to PDF or print. I have to take screenshots. I'm just missing something, or can we not get a list of

  • Recovery creator disc error code: 1100 8-48-00000002. Satellite Pro L300-15

    Hi all. Satellite Pro L300-152 of the Vista 32 SP2. This laptop was gave me to try to repair (another instance of stolen suicide Vista).After retrieving the system (no re - install wasn't necessary), I would like to create a disc of recovery for the