
clay1
Members-
Posts
161 -
Joined
-
Last visited
Never
Everything posted by clay1
-
Solved it. $lead = pg_fetch_array($result, $i, PGSQL_ASSOC); //Remove spaces from column names $keys = str_replace( ' ', '', array_keys($lead) ); $values = array_values($lead); $lead = array_combine($keys, $values);
-
foreach($lead as $key => $value){ echo "<br><br>$key"; $key= str_replace( ' ', '', $key ); echo "<br><br>$key"; } The second $key is correct but it doesn't stick. In other words when I do that then dump $lead I still have the old keys
-
Well that is what the extract() is for. I was trying to avoid typing out each of the hundred variables. Like I said I can't change the column names. Isn't there a way I can create a new array with the correct key names? like foreach($lead) $lead['key'] = str_replace($lead['key'] Something along those lines
-
Yeah but how do I do that to the keys? I tried that it just removes the space from the value not the key
-
My pg_fetch_array returns something like: $lead['id'] $lead['street address'] I need that to get rid of that space
-
I've got an associative array from pg_fetch_array which ends up having spaces in some of the keys due to spaces in the column names(no I can't change them). I want to use extract($array) but obviously the spaces create an issue accessing my variables. How can I go from $lead = pg_fetch_array($result, $i, PGSQL_ASSOC); extract($lead); To something where I won't have any spaces?
-
Fixed by original coder Thanks for the help though
-
I don't believe the JS is doing anything at this point. This is just the user clicking submit This is the code above the form if(!$_POST['db']) { $action = 1; ?> <form name='form' method='POST' action='test3.php'> <? } else { $action = 2 ; include('includes/config.php'); ?> <FORM name='form' ACTION="removed" METHOD=POST> <? } ?> <table class="form1" width="100%" border="0"> <tr> <td colspan="3"><p><strong>Please enter your information. Name and address must match credit card billing address. All fields are required</strong></p> <p>How many tickets would you like to purchase? Bring a friend and save $10</p> <p><input type="radio" name="Total" value="30" /> 1 Ticket - $30</p> var_dump: array(24) { ["Total"]=> string(0) "" ["FirstName"]=> string(7) "edited" ["LastName"]=> string(6) "edited"
-
I can't see why.. the text fields are carrying over fine. Do you see any error in that code at all?
-
That didn't work. I was trying this but the post value is empty <?php if(!$_POST){ ?> <input type="radio" name="Total" value="30" /> 1 Ticket - $30</p> <p><input type="radio" name="Total" value="50" /> 2 Tickets - $50</p></td> <?php } else { echo "<input type=\"text\" name=\"Total\" value=\"". $_POST['Total'] . "\" >"; } ?>
-
I guess I wasn't exactly clear. What I mean is this: 1. User fills out the form, selects 1 ticket and clicks submit 2. The page is redisplayed with all the user submitted text fields filled out.. ie first and last name. However the Tickets radio button is now no longer selected 3. The form is then sent to a 3rd party page where again the text fields are filled out with the user data, however the radio buttons and the drop down are not-- because unlike first and last name the value doesn't equal $_POST['whatever'] Does this make more sense?
-
When this form is submitted, it is automatically resubmitted using JS. All my fields are carried over in the $_post except for total, and state which are radio buttons and a drop down. <p><input type="radio" name="Total" value="30" /> 1 Ticket - $30</p> <p><input type="radio" name="Total" value="50" /> 2 Tickets - $50</p></td> </tr> <tr><td><p><strong>First Name:</strong></p> <p><INPUT TYPE="text" NAME="FirstName" VALUE="<?=$_POST['FirstName']?>"></p></td> <td><p><strong>Last Name:</strong></p> <p><INPUT TYPE="text" NAME="LastName" VALUE="<?=$_POST['LastName']?>"></p></td></tr> Obviously I can't change the value of Total to $_POST['Total'] since that hasn't been set yet. What can I do here?
-
Basically I am trying to seamlessly save the customer information and then bring them to the processing URL without requiring the use to click multiple times. More information on what I am using: http://www.eprocessingnetwork.com/dbe.html What I want to happen is: 1.Customer fills out form. 2. Clicks submit 3. Customer information is entered into table 4. Customer is brought to the order.pl page to enter their credit card 5. Customer clicks submit and their card is approved or declined. What I don't want is for the customer to need to do anything else between 3 and 4. Does that make sense? I tried the following which I found on http://davidwalsh.name/execute-http-post-php-curl After I hit submit, it shows me the payment gateway and the fields are filled out. The URL in the browser is my site's and when I click 'submit' it tries to bring me to mysite.com/transact.pl which obviously doesn't exist. extract($_POST); //set POST variables $url = 'https://www.eProcessingNetwork.com/cgi-bin/dbe/order.pl'; $fields = array( 'Total'=>urlencode($Total), 'ePNAccount'=>urlencode($ePNAccount), 'FirstName'=>urlencode($FirstName), 'LastName'=>urlencode($LastName), 'Address'=>urlencode($Address), 'City'=>urlencode($City), 'State'=>urlencode($State), 'Zip'=>urlencode($Zip), 'EMail'=>urlencode($EMail), 'ID'=>urlencode($ID), 'ReturnApprovedURL'=>urlencode($ReturnApprovedURL), 'ReturnDeclinedURL'=>urlencode($ReturnDeclinedURL), 'Phone'=>urlencode($telephone) ); //url-ify the data for the POST foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string,'&'); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); //execute post $result = curl_exec($ch); //close connection curl_close($ch);
-
When someone registers for an event on my site, we collect their information on a form and then pass it to our merchant provider who processes the payment and then returns the customer to a page on our site depending on if their card was approved or not. I have a form that collects more information than what the merchant provider requires. For example: Age. I need to save that extra information in my database and then pass the variables required to my merchant provider. This is the opening of the form code provided by the merchant: <form id="form" action="https://www.eProcessingNetwork.com/cgi-bin/dbe/order.pl" method="post" /> I would like to avoid having multiple pages or clicks for the customer. Is that possible? Can I have the form variables saved to my table AND go to the merchant page in 1 click?
-
User clicks a URL which sends user to a page ie: event.php?id=1000 where id=the id of an event in my table What steps should I take to ensure that nothing nefarious is sent? Thanks
-
I am working on a project that involves currently 8 different domain names that reference a city. They are all hosted on the same shared hosting server. The content for the sites will be essentially the same except for localization based upon the url. The content of the site will be an events listing and registration page for events in a particular city. The template will be the same for each one but with some localized graphics such as a header. Eventually there will be 30+ domains/cities. I am wondering what the best way to approach this is?
-
Changing my separator to \t and my encloser to ` fixed it-- is this my best solution?
-
OK. I've narrowed this down a bit I think. The problem being quotes in the html field. I am exporting to CSV now and this is what I am getting on a screen dump: http://,url" Click here . \" The URL is getting broken up into separate fields. The field in the table has both single and double quotes in it. How can I force those to be ignored?
-
I did this: $field = $row_DetailsRS1[$i]; $cleanfield = strip_tags($field); The html is removed when I just print to the screen. However the xls file is still borked. I emptied the field that was causing the problem and that row printed out fine. Then I removed the column altogether(I am using a copy of the table to test with) and the xls file only had 1 row. Very perplexing
-
Maybe Monday morning will get a response?
-
Help?