Jump to content

pstanbra

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pstanbra's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. WOOAAAHH yea baby! that worked.. hmm so whats REQUEST_URI do
  2. here is my full code: all you got to remember is a url passes a variable as ?brick=1 <?php global $brickurl; global $txn; $brickurl = $_POST[on0]; if (!empty($_GET['brick'])) {$brickID = $_GET['brick'];} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <H2>add advert </H2> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <p> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </p> <p> </p> test; <?php echo $brickID;echo $brickurl;?> <p> </p> <p> <label>website <input name="on0" type="text" value="http://" size="84" maxlength="84" /> </label> </p> <p> </p> </form> </body> </html>
  3. I pass a variable in a url as ?brick=1 At the next page I set the variable brickID as (I would hope, "1) The page has a form posting to itself. When i get into this page - 1 is displayed on the page but if i resubmit and post to self again - the 1 dissappears so i guess its overwriting the value - i dont get it. Any ideas what ive done wrong <?php global $brickurl; $brickurl = $_POST[on0]; if (!empty ($_GET["brick"])) {$brickID = $_GET["brick"];} ?> echo $brickID
  4. any more comments on this guys
  5. hmm I jsut presume it would as its in a format as below. I presume the loop would not work as it would apply the images in a single cell? As you can see -there are many images here. Each image needs to have a dynamic link as this link in the table will be overwritten by a script later to change the url. re: the statement above $query = "SELECT bricks.url FROM bricks WHERE bricks.brick ='1'"; each image has an ID (brick number) the code above selects the row for that 1 particular image Im not really a php programmer but am trying .. <tr> <td width="58"><img src="images/cash-shaker_01.jpg" width="58" height="18" alt="" /></td> <td colspan="7"><img src="images/cash-shaker_02.jpg" width="189" height="18" alt="" /></td> <td width="10" rowspan="2"><img src="images/cash-shaker_03.jpg" width="10" height="32" alt="" /></td> <td colspan="6"><img src="images/cash-shaker_04.jpg" width="167" height="18" alt="" /></td> <td width="22" rowspan="2"><img src="images/cash-shaker_05.jpg" width="22" height="32" alt="" /></td> <td width="54"><img src="images/cash-shaker_06.jpg" width="54" height="18" alt="" /></td> <td width="10"><img src="images/spacer.gif" width="1" height="18" alt="" /></td> </tr> <tr> <td colspan="8"><img src="images/cash-shaker_07.jpg" width="247" height="14" alt="" /></td> <td colspan="6"><img src="images/cash-shaker_08.jpg" width="167" height="14" alt="" /></td> <td><img src="images/cash-shaker_09.jpg" width="54" height="14" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="14" alt="" /></td> </tr> <tr> <td colspan="6"><img src="images/cash-shaker_10.jpg" width="157" height="25" alt="" /></td> <td width="11" rowspan="11"><img src="images/cash-shaker_11.jpg" width="11" height="196" alt="" /></td> <td colspan="5" rowspan="2"><img src="images/cash-shaker_12.jpg" width="175" height="43" alt="" /></td> <td width="7" rowspan="3"><img src="images/cash-shaker_13.jpg" width="7" height="54" alt="" /></td> <td colspan="4" rowspan="2"><img src="images/cash-shaker_14.jpg" width="150" height="43" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="25" alt="" /></td> </tr> <tr> <td colspan="4"><img src="images/cash-shaker_15.jpg" width="92" height="18" alt="" /></td> <td width="49" rowspan="5"><img src="images/cash-shaker_16.jpg" width="49" height="86" alt="" /></td> <td width="16"><img src="images/cash-shaker_17.jpg" width="16" height="18" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="18" alt="" /></td> </tr> <tr> <td colspan="4"><img src="images/cash-shaker_18.jpg" width="92" height="11" alt="" /></td> <td><img src="images/cash-shaker_19.jpg" width="16" height="11" alt="" /></td> <td colspan="5"><img src="images/cash-shaker_20.jpg" width="175" height="11" alt="" /></td> <td colspan="4"><img src="images/cash-shaker_21.jpg" width="150" height="11" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="11" alt="" /></td> </tr> <tr> <td colspan="4"><img src="images/cash-shaker_22.jpg" width="92" height="38" alt="" /></td> <td><img src="images/cash-shaker_23.jpg" width="16" height="38" alt="" /></td> <td colspan="3"><img src="images/cash-shaker_24.jpg" width="90" height="38" alt="" /></td> <td width="10" rowspan="8"><img src="images/cash-shaker_25.jpg" width="10" height="142" alt="" /></td> <td colspan="4"><img src="images/cash-shaker_26.jpg" width="156" height="38" alt="" /></td> <td colspan="2" rowspan="2"><img src="images/cash-shaker_27.jpg" width="76" height="56" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="38" alt="" /></td> </tr> <tr> <td colspan="4"><img src="images/cash-shaker_28.jpg" width="92" height="18" alt="" /></td> <td><img src="images/cash-shaker_29.jpg" width="16" height="18" alt="" /></td> <td colspan="3" rowspan="7"><img src="images/cash-shaker_30.jpg" width="90" height="104" alt="" /></td> <td colspan="4"><img src="images/cash-shaker_31.jpg" width="156" height="18" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="18" alt="" /></td> </tr> <tr> <td colspan="4" rowspan="2"><img src="images/cash-shaker_32.jpg" width="92" height="32" alt="" /></td> <td rowspan="2"><img src="images/cash-shaker_33.jpg" width="16" height="32" alt="" /></td> <td colspan="3" rowspan="4"><img src="images/cash-shaker_34.jpg" width="118" height="48" alt="" /></td> <td colspan="3" rowspan="2"><img src="images/cash-shaker_35.jpg" width="114" height="32" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="1" alt="" /></td> </tr> <tr> <td><img src="images/cash-shaker_36.jpg" width="49" height="31" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="31" alt="" /></td> </tr> <tr> <td colspan="6"><img src="images/cash-shaker_37.jpg" width="157" height="8" alt="" /></td> <td colspan="3" rowspan="2"><img src="images/cash-shaker_38.jpg" width="114" height="16" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="8" alt="" /></td> </tr> <tr> <td colspan="2" rowspan="2"><img src="images/cash-shaker_39.jpg" width="68" height="36" alt="" /></td> <td width="14" rowspan="4"><img src="images/cash-shaker_40.jpg" width="14" height="76" alt="" /></td> <td colspan="3" rowspan="2"><img src="images/cash-shaker_41.jpg" width="75" height="36" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="8" alt="" /></td> </tr> <tr> <td width="75" rowspan="2"><img src="images/cash-shaker_42.jpg" width="75" height="38" alt="" /></td> <td height="68" colspan="5" rowspan="3" valign="top" background="images/cash-shaker_43.jpg"><span class="style9">Total Donations <?php echo $global_currency.getDonations('donation'); ?></span><br /> <span class="style9">Net Donations: <?php echo $global_currency.getNetDonations('donation'); ?><span class="style9" ></span><font color="#FFFFFF"><br /> <span class="style9" style="color: #FFFFFF"><font color="#FFFFFF"><font color="#FFFFFF">Total Fees: </font></font></span></font><span class="style9"><span style="color: #FFFFFF"> <?php echo $global_currency.getDonationFees('donation'); ?></span><font color="#FFFFFF"><span style="color: #FFFFFF"><br /> <span class="style9">Number of Donations</span></span><span class="style9">: <font color="#FFFFFF"><?php echo getDonationsCount('donation'); ?></font></span></font></td> <td><img src="images/spacer.gif" width="1" height="28" alt="" /></td> </tr> <tr> <td colspan="2"><img src="images/cash-shaker_44.jpg" width="68" height="10" alt="" /></td> <td colspan="3"><img src="images/cash-shaker_45.jpg" width="75" height="10" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="10" alt="" /></td> </tr> <tr> <td colspan="2"><img src="images/cash-shaker_46.jpg" width="68" height="30" alt="" /></td> <td colspan="4"><img src="images/cash-shaker_47.jpg" width="86" height="30" alt="" /></td> <td colspan="2"><img src="images/cash-shaker_48.jpg" width="89" height="30" alt="" /></td> <td colspan="3"><img src="images/cash-shaker_49.jpg" width="86" height="30" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="30" alt="" /></td> </tr> <tr> <td><img src="images/spacer.gif" width="58" height="1" alt="" /></td> <td width="10"><img src="images/spacer.gif" width="10" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="14" height="1" alt="" /></td> <td width="10"><img src="images/spacer.gif" width="10" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="49" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="16" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="11" height="1" alt="" /></td> <td width="79"><img src="images/spacer.gif" width="79" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="10" height="1" alt="" /></td> <td width="1"><img src="images/spacer.gif" width="1" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="10" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="75" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="7" height="1" alt="" /></td> <td width="36"><img src="images/spacer.gif" width="36" height="1" alt="" /></td> <td width="38"><img src="images/spacer.gif" width="38" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="22" height="1" alt="" /></td> <td><img src="images/spacer.gif" width="54" height="1" alt="" /></td> <td></td> </tr> </table></td> <td width="20%" rowspan="3" valign="top" bgcolor="#FFCCFF"><p align="center"><span style="padding: 5px 5px 5px 5px;border-width: 1px;border-spacing: 0;border-style: dotted;border-color: #000000;"><img src="stellar-therm.php?current=<?php echo getNetDonations('donation'); ?>&target=150000&symbol=<?PHP echo $global_currency;?>" alt="Live Donation Thermometer" /></span></p> <p> </p> <p align="center"><img name="" src="" width="135" height="42" alt="" /></p> <p align="center"><img name="" src="" width="135" height="42" alt="" /></p> <p align="center"><img name="" src="" width="135" height="42" alt="" /></p> <p> </p> <p> </p></td> </tr> <tr> <td><span class="style11"><br /> Top 10 Donators </span><br /> <?php do { ?> <table width="499" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="243" height="45" valign="top"><span class="style8"><a href="<?php echo $row_links['option_name1']; ?>"><?php echo $row_links['option_selection1']; ?> </a><span class="style1">£<?php echo $row_links['mc_gross'];?></span></span><span class="style1"><span class="style2"><br /> <span class="style7"><?php echo $row_links['option_name1']; ?></span></span><br /> </span></td> <td valign="top"><span class="style7"><?php echo $row_links['option_name2'];?> </span></td> </tr> </table> <?php } while ($row_links = mysql_fetch_assoc($links)); ?></td> </tr> <tr> <td valign="top"><p> </p> <p align="center"> </p> <p> </p> <p align="center"> </p></td> </tr> </table>
  6. the logic is feasible however in practice im not so sure - you see i have a photoshop image that has been sliced up into a webpage. Im not sure I could use a loop as this would cause problems with image positioning?
  7. I ma trying to create a dynamic link; I have a table with brick number and url. The code below works and sets the link url on an image. However I have 40 images. 40 different urls Other than repeating the code below 40 times changing where brick = <number> is there another way to dynamically generate the url based on the image/brick <?php require_once('Connections/house.php'); ?> <?php mysql_select_db($database_house, $house); $query_brick1 = "SELECT bricks.url FROM bricks WHERE bricks.brick ='1'"; $brick1 = mysql_query($query_brick1, $house) or die(mysql_error()); $row_brick1 = mysql_fetch_assoc($brick1); $totalRows_brick1 = mysql_num_rows($brick1); ?> <a href="<?php echo $row_brick1[url]?>"><img src="images/cash-shaker_05.jpg" width="75" height="69" border="0"></a> <?php mysql_free_result($brick1); ?>
  8. I'm using paypal IPN to send data to a mySQL db - no problems there. As paypal only accepts so many "custom" variables - i need to set my return page to another form to accept more details and then add to the db. So here is my question. In the table - there is an ID as the unique key. When I write my paypal values to the db - the ID is automatically generated and isnt in a VARIABLE. soooooooo!!!! If I write a function to put the extra variables from a form into the same row in the table - how do i do this. Do i - Select the last row of the database and add the extra values to my newly added fields in the table or - is there another way to do this. If I select the last row of the table - is there not a possibility of this being a new row created by another record a second ago . How safe is selecting the last row. What do you suggest.
  9. not sure but still how do I send them. so far i got header ('location: https://www.paypal.com/cgi-bin/webscr' .$_GET[$fields]); but this doesnt work
  10. Yes I did think that but simply adding that takes you to paypals page - as apposed to having fields sent to the paypal script by the form post command. how do i use header yet send all the fields from the form now stored in the array
  11. Is this really neccessary? I only want to do the same as click on submit on a form and send/POST to the paypal link. The only difference is that my form fields are sent to PHP_self for checking - once checks are correct - the function should be the same post for to paypal
  12. Hi - I've found a great little script to use as form validation. However - on my form - the action needs to be changed to PHP_SELF. Seems the form data is pushed into an array and then error checking is done on this. In the added code, there is a section here; // no errors! redirect the user to the thankyou page (or whatever) else { } } So my question is - how do I send my form variables (now error checked) to www.Paypal.com/webscr My Form Page; <?php $errors = array(); // set the errors array to empty, by default $fields = array(); // stores the field values $success_message = ""; if (isset($_POST['submit'])) { // import the validation library require("validation.php"); $rules = array(); // stores the validation rules $rules[] = "range<100,number_range_less_than,Please enter a number less than 100."; $errors = validateFields($_POST, $rules); // if there were errors, re-populate the form fields if (!empty($errors)) { $fields = $_POST; } // no errors! redirect the user to the thankyou page (or whatever) else { *******need to send my form info to paypal ************ } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>PHP Validation Demo</title> <style type="text/css"> <!-- body,p,table,td,input,select { font-family: arial; font-size: 8pt; } .demoTable { background-color: #efefef; width: 400px; } .error { border: 1px solid red; background-color: #ffffee; color: #660000; width: 400px; padding: 5px; } .notify { border: 1px solid #336699; background-color: #ffffee; color: #336699; width: 400px; padding: 5px; } --> </style> </head> <body> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <p><b><u>PHP Validation Demo</u></b></p> <p> This form contains all the validation options that are offered by the validation.php function library. To see how the code works, <a href="file:///C|/Documents and Settings/stanbrap/Desktop/php_validation/php_validation.zip">download the source code here</a>. </p> <?php // if $errors is not empty, the form must have failed one or more validation // tests. Loop through each and display them on the page for the user if (!empty($errors)) { echo "<div class='error'>Please fix the following errors:\n<ul>"; foreach ($errors as $error) echo "<li>$error</li>\n"; echo "</ul></div>"; } if (!empty($success_message)) { echo "<div class='notify'>$success_message</div>"; } ?> <p> </p> <table class="demoTable"> <tr> <td>nter a number less than 100:</td> <td><input type="text" name="number_range_less_than" value="<?=$fields['number_range_less_than']?>" /></td> </tr> </table> <p><i>Length of field input</i></p> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="<?PHP echo $business;?>"> <input type="hidden" name="item_name" value="Donation"> <input type="hidden" name="item_number" value="donation"> <input type="hidden" name="currency_code" value="<?PHP echo $currency_code;?>"> <input type="hidden" name="notify_url" value="<?PHP echo $notify_url;?>"> <input type="hidden" name="return" value="<?PHP echo $return;?>"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <p><input type="submit" name="submit" value="SUBMIT" /></p> </form> </body> </html>
×
×
  • 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.