Jump to content

jamesxg1

Members
  • Posts

    1,133
  • Joined

  • Last visited

Everything posted by jamesxg1

  1. Hiya peeps! I was wondering how I would make a sub-folder in a zip file. I am using this code $zip->addEmptyDir('directory') But I then need to make a sub-folder, how do I go about this? Many thanks, James.
  2. The $_POST global is an array you just have to manipulate it correctly. foreach($_POST as $key => $value) { echo $key . ' - ' . $value . '<br />'; } James.
  3. By reading paypal's documentation for the type of account you are trying to interface with. Hiya bud, I know what I'm effectively trying to do is make larger function to standard (free) account and add the function of on-site payment. Many thanks, James.
  4. Anyone have any ideas? Many thanks, James.
  5. Hiya, Ok I will try LOL :S, Basically what I will be doing is posting the correct post's to paypal, then once it has generated the page (paypal side) I need to scrap it (https://www.paypal.com/cgi-bin/webscr) find the link valued (Continue) with a onclick attr value (document.getElementById('myAllTextSubmitID').name = 'new_user_button.x';document.getElementById('myAllTextSubmitID').value = '';document.forms.login_form.submit();return false;) auto click it, scrap the next page it displays and echo it. If that helps :S. Many thanks, James.
  6. Have a look into $_SERVER['PHP_SELF'] James.
  7. Anyone got any ideas :S ? Many thanks, James.
  8. Hiya peeps! I have searched and searched for the answer to this but I have had no luck! I was wondering how I would do the following. Page scrap (https://www.paypal.com/cgi-bin/webscr). Auto enter the URL (javascript: document.getElementById('myAllTextSubmitID').name = 'new_user_button.x';document.getElementById('myAllTextSubmitID').value = '';document.forms.login_form.submit();return false;) on the page scrap. Grab <form method="post" id="billingform" name="billing" action="https://www.paypal.com/uk/cgi-bin/merchantpaymentweb?SESSION=fdwADpMNhDZd6VTiQxZc-S1tRk-8ZjD6gOrFrcn_I40AVBH5oURlLlYgmxG&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9bd7371532d7fbae4715b6ee2d3a381319835793b1c0619a25"> <input type="hidden" id="CONTEXT_CGI_VAR" name="CONTEXT" value="X3-7SZn2ExXucINxlliZ_05NdFsrIIpaV9TcRYNLL_GiOwm9XgEZzWKQeV0"><input type="hidden" id="myAllTextSubmitID" name="myAllTextSubmitID" value=""><input type="hidden" name="cmd" value="_flow"><input type="hidden" name="id" value=""><input type="hidden" name="note" value=""><input type="hidden" name="close_external_flow" value="false"><input type="hidden" name="external_close_account_payment_flow" value="payment_flow"><input type="image" src="https://www.paypalobjects.com/MERCHANTPAYMENTWEB-630-20100607-1/en_GB/i/scr/pixel.gif" id="dfltButton" name="continue.x" value="Continue"><div id="shopping-cart" class="cowp-setting"><div id="purchase-detail"> <input type="hidden" id="item-quantity" name="item-quantity" value="1"><div id="cover"><table align="center" border="0" cellpadding="0" cellspacing="0" id="cart"> <thead><tr> <th class="item-name">Description</th> <th>Unit Price</th> <th>Quantity</th> <th class="item-total" width="8%">Amount</th> <th width="1%"></th> </tr></thead> <tr> <td class="item-name"><div>Paypal Test Transaction</div></td> <td>£1.99</td> <td>1</td> <td class="item-total">£1.99</td> <td></td> </tr> <tfoot> <tr> <td colspan="2" id="notes" valign="bottom"></td> <td valign="bottom">Item total:</td> <td valign="bottom">£1.99</td> <td></td> </tr> <tr id="exp_tax"></tr> <tr id="exp_shipping-and-handling"></tr> <tr id="exp_total"> <td class="totals-label" colspan="3">Total:</td> <td class="totals-value" id="total_value"><strong>£1.99</strong></td> <td class="totals-currency"><strong>GBP</strong></td> </tr> </tfoot> </table></div> <div id="purchase-summary"> <div id="purchase-many"><p>Paypal Test Transaction</p></div> <p class="summary-total"><span>Total:</span><span class="price-total">£1.99</span><span class="price-currency">GBP</span><div id="totals"><table align="right" border="0" cellpadding="0" cellspacing="0" id="col_shipping-table" style="width:100%;"></table></div></p> <div class="clearBoth"></div> </div> <div class="toggle"><a id="expander" href="#" title="Click to view purchase details">Click to view purchase details</a></div> <span id="titleExpanded">Click to close purchase details</span> </div></div> <h1> <span id="pgHdr">Pay with Credit Card or Log In</span><a target="_blank" href="https://www.paypal.com/uk/cgi-bin/merchantpaymentweb?cmd=xpt/Merchant/popup/WaxAboutPaypal-outside" onClick="PAYPAL.core.openWindow(event,{height:500, width: 450});"><img border="0" src="https://www.paypalobjects.com/MERCHANTPAYMENTWEB-630-20100607-1/en_US/i/logo/pp_secure_213wx37h.gif" alt="Payments by PayPal"></a> </h1> <div id="post-header"> <a target="_blank" href="https://www.paypal.com/uk/cgi-bin/merchantpaymentweb?cmd=xpt/Merchant/popup/WhatIsPayPal-outside" onClick="PAYPAL.core.openWindow(event, {width: 640, height: 500})">Learn more</a> about PayPal - the safer, easier way to pay.<div id="control"> <h2>Already have a PayPal account?</h2> <div class="loginOffset"><div class="login"><fieldset> <legend>Login</legend> <p class="instructions">Please log in</p> <input type="hidden" name="email_recovery" value="false"><input type="hidden" name="password_recovery" value="false"><div class="fieldRow login-email"> <label for="login_email">Email address:</label><input type="text" id="login_email" class="smallInputWidth" name="login_email" value="admini_1276552615_per@idealz.co.uk"> </div> <div class="fieldRow login-password"> <label for="login_password">Password:</label><input autocomplete="off" type="password" id="login_password" name="login_password" value="" class="smallInputWidth"> </div> <div class="buttonRow"><input type="submit" id="login.x" name="login.x" value="Log In" onClick="" class=""></div> <div class="notes"><p class="note">Forgotten your <a href="https://www.paypal.com/uk/cgi-bin/merchantpaymentweb?cmd=_email-recovery">email address</a> or <a target="_blank" href="https://www.paypal.com/uk/cgi-bin/merchantpaymentweb?cmd=_forgot-password">password</a>?</p></div> </fieldset></div></div> </div> </div> <div id="content"><div> <h2>Enter your billing information</h2> <fieldset id="billing-entry"> <legend>Create a PayPal Account</legend> <div class="fieldrow country"><div id="country-row"> <label for="country">Country:</label><input type="hidden" id="r_country_code" name="refresh_country_code" value="0"><select id="country_code" name="country_code" class=""><option value="">-- Choose a Country --</option> <option value="GB" selected>United Kingdom</option> <option value="AL">Albania</option> <option value="DZ">Algeria</option> <option value="AD">Andorra</option> <option value="AO">Angola</option> <option value="AI">Anguilla</option> <option value="AG">Antigua and Barbuda</option> <option value="AR">Argentina</option> <option value="AM">Armenia</option> <option value="AW">Aruba</option> <option value="AU">Australia</option> <option value="AT">Austria</option> <option value="AZ">Azerbaijan Republic</option> <option value="BS">Bahamas</option> <option value="BH">Bahrain</option> <option value="BB">Barbados</option> <option value="BE">Belgium</option> <option value="BZ">Belize</option> <option value="BJ">Benin</option> <option value="BM">Bermuda</option> <option value="BT">Bhutan</option> <option value="BO">Bolivia</option> <option value="BA">Bosnia and Herzegovina</option> <option value="BW">Botswana</option> <option value="BR">Brazil</option> <option value="VG">British Virgin Islands</option> <option value="BN">Brunei</option> <option value="BG">Bulgaria</option> <option value="BF">Burkina Faso</option> <option value="BI">Burundi</option> <option value="KH">Cambodia</option> <option value="CA">Canada</option> <option value="CV">Cape Verde</option> <option value="KY">Cayman Islands</option> <option value="TD">Chad</option> <option value="CL">Chile</option> <option value="C2">China</option> <option value="CO">Colombia</option> <option value="KM">Comoros</option> <option value="CK">Cook Islands</option> <option value="CR">Costa Rica</option> <option value="HR">Croatia</option> <option value="CY">Cyprus</option> <option value="CZ">Czech Republic</option> <option value="CD">Democratic Republic of the Congo</option> <option value="DK">Denmark</option> <option value="DJ">Djibouti</option> <option value="DM">Dominica</option> <option value="DO">Dominican Republic</option> <option value="EC">Ecuador</option> <option value="SV">El Salvador</option> <option value="ER">Eritrea</option> <option value="EE">Estonia</option> <option value="ET">Ethiopia</option> <option value="FK">Falkland Islands</option> <option value="FO">Faroe Islands</option> <option value="FM">Federated States of Micronesia</option> <option value="FJ">Fiji</option> <option value="FI">Finland</option> <option value="FR">France</option> <option value="GF">French Guiana</option> <option value="PF">French Polynesia</option> <option value="GA">Gabon Republic</option> <option value="GM">Gambia</option> <option value="DE">Germany</option> <option value="GI">Gibraltar</option> <option value="GR">Greece</option> <option value="GL">Greenland</option> <option value="GD">Grenada</option> <option value="GP">Guadeloupe</option> <option value="GT">Guatemala</option> <option value="GN">Guinea</option> <option value="GW">Guinea Bissau</option> <option value="GY">Guyana</option> <option value="HN">Honduras</option> <option value="HK">Hong Kong</option> <option value="HU">Hungary</option> <option value="IS">Iceland</option> <option value="IN">India</option> <option value="ID">Indonesia</option> <option value="IE">Ireland</option> <option value="IL">Israel</option> <option value="IT">Italy</option> <option value="JM">Jamaica</option> <option value="JP">Japan</option> <option value="JO">Jordan</option> <option value="KZ">Kazakhstan</option> <option value="KE">Kenya</option> <option value="KI">Kiribati</option> <option value="KW">Kuwait</option> <option value="KG">Kyrgyzstan</option> <option value="LA">Laos</option> <option value="LV">Latvia</option> <option value="LS">Lesotho</option> <option value="LI">Liechtenstein</option> <option value="LT">Lithuania</option> <option value="LU">Luxembourg</option> <option value="MG">Madagascar</option> <option value="MW">Malawi</option> <option value="MY">Malaysia</option> <option value="MV">Maldives</option> <option value="ML">Mali</option> <option value="MT">Malta</option> <option value="MH">Marshall Islands</option> <option value="MQ">Martinique</option> <option value="MR">Mauritania</option> <option value="MU">Mauritius</option> <option value="YT">Mayotte</option> <option value="MX">Mexico</option> <option value="MN">Mongolia</option> <option value="MS">Montserrat</option> <option value="MA">Morocco</option> <option value="MZ">Mozambique</option> <option value="NA">Namibia</option> <option value="NR">Nauru</option> <option value="NP">Nepal</option> <option value="NL">Netherlands</option> <option value="AN">Netherlands Antilles</option> <option value="NC">New Caledonia</option> <option value="NZ">New Zealand</option> <option value="NI">Nicaragua</option> <option value="NE">Niger</option> <option value="NU">Niue</option> <option value="NF">Norfolk Island</option> <option value="NO">Norway</option> <option value="OM">Oman</option> <option value="PW">Palau</option> <option value="PA">Panama</option> <option value="PG">Papua New Guinea</option> <option value="PE">Peru</option> <option value="PH">Philippines</option> <option value="PN">Pitcairn Islands</option> <option value="PL">Poland</option> <option value="PT">Portugal</option> <option value="QA">Qatar</option> <option value="CG">Republic of the Congo</option> <option value="RE">Reunion</option> <option value="RO">Romania</option> <option value="RU">Russia</option> <option value="RW">Rwanda</option> <option value="VC">Saint Vincent and the Grenadines</option> <option value="WS">Samoa</option> <option value="SM">San Marino</option> <option value="ST">São Tomé and Príncipe</option> <option value="SA">Saudi Arabia</option> <option value="SN">Senegal</option> <option value="SC">Seychelles</option> <option value="SL">Sierra Leone</option> <option value="SG">Singapore</option> <option value="SK">Slovakia</option> <option value="SI">Slovenia</option> <option value="SB">Solomon Islands</option> <option value="SO">Somalia</option> <option value="ZA">South Africa</option> <option value="KR">South Korea</option> <option value="ES">Spain</option> <option value="LK">Sri Lanka</option> <option value="SH">St. Helena</option> <option value="KN">St. Kitts and Nevis</option> <option value="LC">St. Lucia</option> <option value="PM">St. Pierre and Miquelon</option> <option value="SR">Suriname</option> <option value="SJ">Svalbard and Jan Mayen Islands</option> <option value="SZ">Swaziland</option> <option value="SE">Sweden</option> <option value="CH">Switzerland</option> <option value="TW">Taiwan</option> <option value="TJ">Tajikistan</option> <option value="TZ">Tanzania</option> <option value="TH">Thailand</option> <option value="TG">Togo</option> <option value="TO">Tonga</option> <option value="TT">Trinidad and Tobago</option> <option value="TN">Tunisia</option> <option value="TR">Turkey</option> <option value="TM">Turkmenistan</option> <option value="TC">Turks and Caicos Islands</option> <option value="TV">Tuvalu</option> <option value="UG">Uganda</option> <option value="UA">Ukraine</option> <option value="AE">United Arab Emirates</option> <option value="US">United States</option> <option value="UY">Uruguay</option> <option value="VU">Vanuatu</option> <option value="VA">Vatican City State</option> <option value="VE">Venezuela</option> <option value="VN">Vietnam</option> <option value="WF">Wallis and Futuna Islands</option> <option value="YE">Yemen</option> <option value="ZM">Zambia</option></select> </div></div> <noscript><div class="fieldrow country-button"> <label for=""></label><input type="submit" name="select_country.x" value="Apply my selected country" class="transparentButton"> </div></noscript> <fieldset class="standardfinancing" id="ccdetails"> <legend>Credit Card Details</legend> <input type="hidden" id="creditCardEntry" name="creditCardEntry" value=""><div class="fieldrow payment-type"> <label for="credit_card_type"><span class="label">Payment Type</span></label><fieldset id="payment-type" class="payment-type" title="Payment Type"> <legend>Select</legend> <input type="hidden" name="is_card_type_selectable" value="true"><select id="credit_card_type" name="credit_card_type"><option value="" selected>Select Card</option> <option value="M">MasterCard/Eurocard</option> <option value="V">Visa/Delta/Electron</option> <option value="A">American Express</option> <option value="S">Switch/Maestro</option> <option value="O">Solo</option></select> </fieldset> </div> <noscript><div class="fieldrow country-button"> <label for=""></label><input type="submit" name="refresh_card_type" value="Use this payment type" class="transparentButton"> </div></noscript> <div class="fieldrow" id="fieldrowCCNumber"> <label for="cc_number">Card Number:</label><input type="text" id="cc_number" maxlength="24" onChange="getCC(this);" onKeyUp="getCC(this);" onBlur="getCC(this);" name="cc_number" value=""> </div> <br><div class="fieldrow exp-date" id="fieldrowCCExpDate"> <label for="expdate">Expiry Date:</label><input type="text" id="expdate_month" maxlength="2" onFocus="getCC(this);clearField(this);" onKeyUp="this.style.color = '#000';" onClick="clearField(this);" name="expdate_month" value="mm">/<input type="text" id="expdate_year" maxlength="2" onFocus="clearField(this);" onKeyUp="this.style.color = '#000';" onClick="clearField(this); this.style.color = '#000';" name="expdate_year" value="yy"> </div> <div id="fieldrowCSC" class="fieldrow csc"> <label for="cvv2_number">CSC:</label><input type="text" id="cvv2_number" size="4" maxlength="4" name="cvv2_number" value=""><span class="autoTooltip" title="For MasterCard or Visa, it's the last three digits in the signature area on the back of your card. For American Express, it's the four digits on the front of the card."><dl class="quick-faq" id="csc-def"><dt><a target="_blank" href="https://www.paypal.com/uk/cgi-bin/merchantpaymentweb?cmd=xpt/Help/popup/CVVInfoPopC-outside" onClick="PAYPAL.core.openWindow(event, {width: 425, height: 450});" id="csc-hover">What's this?</a></dt></dl></span> </div> <div class="fieldrow dob" id="fieldrowCCDOB"> <label for="dob">Date of Birth:</label><input type="text" id="dob_date" maxlength="2" onFocus="getCC(this); clearField(this);" onKeyUp="this.style.color = '#000';" onClick="clearField(this);" name="dob_b" value="dd">/ <input type="text" id="dob_month" maxlength="2" onFocus="getCC(this); clearField(this);" onKeyUp="this.style.color = '#000';" onClick="clearField(this);" name="dob_a" value="mm">/ <input type="text" id="dob_year" maxlength="4" onFocus="clearField(this);" onKeyUp="this.style.color = '#000';" onClick="clearField(this); this.style.color = '#000';" name="dob_c" value="yyyy"> </div> <fieldset id="cardIssueInformation" class="unavailable"> <legend></legend> <div class="fieldrow exp-date" id="fieldrowStartDate"> <label for="startdate_month">Start Date:</label><input type="text" id="start-month" maxlength="2" onFocus="clearField(this);" onKeyUp="this.style.color = '#000;'" onClick="clearField(this);" name="startdate_month" value="mm">/<input type="text" id="start-year" maxlength="2" onFocus="clearField(this);" onKeyUp="this.style.color = '#000;'" onClick="clearField(this);" name="startdate_year" value="yy"> </div> <div class="fieldrow issue-number" id="issue-number"> <label for="issue-number">Issue no.:</label><input type="text" id="issue-number" maxlength="2" name="issue_number" value=""> </div> </fieldset> </fieldset> <div class="billing-information" id="billing-info-form"> <div class="fieldrow given-name"> <label for="first_name">First Name :</label><input type="text" id="first_name" maxlength="32" name="first_name" value=""> </div> <div class="fieldrow family-name"> <label for="last_name">Last Name:</label><input type="text" id="last_name" maxlength="64" name="last_name" value=""> </div> <div class="fieldrow street-address"> <label for="address1">Billing Address Line 1:</label><input type="text" id="address1" size="25" maxlength="100" name="address1" value=""> </div> <div class="fieldrow extended-address"> <label for="address2">Billing Address Line 2:<br><span class="optional-text">(optional)</span></label><input type="text" id="address2" size="25" maxlength="100" name="address2" value=""> </div> <div class="fieldrow locality"> <label for="city">Town/City:</label><input type="text" id="city" size="25" maxlength="40" name="city" value=""> </div> <div class="fieldrow region"> <label for="state">County:</label><select id="state" name="state"><option value=""></option> <optgroup label="England"> <option value="Avon">Avon</option> <option value="Bedfordshire">Bedfordshire</option> <option value="Berkshire">Berkshire</option> <option value="Bristol">Bristol</option> <option value="Buckinghamshire">Buckinghamshire</option> <option value="Cambridgeshire">Cambridgeshire</option> <option value="Cheshire">Cheshire</option> <option value="Cleveland">Cleveland</option> <option value="Cornwall">Cornwall</option> <option value="Cumbria">Cumbria</option> <option value="Derbyshire">Derbyshire</option> <option value="Devon">Devon</option> <option value="Dorset">Dorset</option> <option value="Durham">Durham</option> <option value="East Riding of Yorkshire">East Riding of Yorkshire</option> <option value="East Sussex">East Sussex</option> <option value="Essex">Essex</option> <option value="Gloucestershire">Gloucestershire</option> <option value="Greater Manchester">Greater Manchester</option> <option value="Hampshire">Hampshire</option> <option value="Herefordshire">Herefordshire</option> <option value="Hertfordshire">Hertfordshire</option> <option value="Humberside">Humberside</option> <option value="Isle of Wight">Isle of Wight</option> <option value="Isles of Scilly">Isles of Scilly</option> <option value="Kent">Kent</option> <option value="Lancashire">Lancashire</option> <option value="Leicestershire">Leicestershire</option> <option value="Lincolnshire">Lincolnshire</option> <option value="London">London</option> <option value="Merseyside">Merseyside</option> <option value="Middlesex">Middlesex</option> <option value="Norfolk">Norfolk</option> <option value="North Yorkshire">North Yorkshire</option> <option value="North East Lincolnshire">North East Lincolnshire</option> <option value="Northamptonshire">Northamptonshire</option> <option value="Northumberland">Northumberland</option> <option value="Nottinghamshire">Nottinghamshire</option> <option value="Oxfordshire">Oxfordshire</option> <option value="Rutland">Rutland</option> <option value="Shropshire">Shropshire</option> <option value="Somerset">Somerset</option> <option value="South Yorkshire">South Yorkshire</option> <option value="Staffordshire">Staffordshire</option> <option value="Suffolk">Suffolk</option> <option value="Surrey">Surrey</option> <option value="Tyne and Wear">Tyne and Wear</option> <option value="Warwickshire">Warwickshire</option> <option value="West Midlands">West Midlands</option> <option value="West Sussex">West Sussex</option> <option value="West Yorkshire">West Yorkshire</option> <option value="Wiltshire">Wiltshire</option> <option value="Worcestershire">Worcestershire</option> </optgroup> <optgroup label="Northern Ireland"> <option value="Antrim">Antrim</option> <option value="Armagh">Armagh</option> <option value="Down">Down</option> <option value="Fermanagh">Fermanagh</option> <option value="Londonderry">Londonderry</option> <option value="Tyrone">Tyrone</option> </optgroup> <optgroup label="Scotland"> <option value="Aberdeen City">Aberdeen City</option> <option value="Aberdeenshire">Aberdeenshire</option> <option value="Angus">Angus</option> <option value="Argyll and Bute">Argyll and Bute</option> <option value="Banffshire">Banffshire</option> <option value="Borders">Borders</option> <option value="Clackmannan">Clackmannan</option> <option value="Dumfries and Galloway">Dumfries and Galloway</option> <option value="East Ayrshire">East Ayrshire</option> <option value="East Dunbartonshire">East Dunbartonshire</option> <option value="East Lothian">East Lothian</option> <option value="East Renfrewshire">East Renfrewshire</option> <option value="Edinburgh City">Edinburgh City</option> <option value="Falkirk">Falkirk</option> <option value="Fife">Fife</option> <option value="Glasgow">Glasgow (City of)</option> <option value="Highland">Highland</option> <option value="Inverclyde">Inverclyde</option> <option value="Midlothian">Midlothian</option> <option value="Moray">Moray</option> <option value="North Ayrshire">North Ayrshire</option> <option value="North Lanarkshire">North Lanarkshire</option> <option value="Orkney">Orkney</option> <option value="Perthshire and Kinross">Perthshire and Kinross</option> <option value="Renfrewshire">Renfrewshire</option> <option value="Roxburghshire">Roxburghshire</option> <option value="Shetland">Shetland</option> <option value="South Ayrshire">South Ayrshire</option> <option value="South Lanarkshire">South Lanarkshire</option> <option value="Stirling">Stirling</option> <option value="West Dunbartonshire">West Dunbartonshire</option> <option value="West Lothian">West Lothian</option> <option value="Western Isles">Western Isles</option> </optgroup> <optgroup label="Unitary Authorities of Wales"> <option value="Blaenau Gwent">Blaenau Gwent</option> <option value="Bridgend">Bridgend</option> <option value="Caerphilly">Caerphilly</option> <option value="Cardiff">Cardiff</option> <option value="Carmarthenshire">Carmarthenshire</option> <option value="Ceredigion">Ceredigion</option> <option value="Conwy">Conwy</option> <option value="Denbighshire">Denbighshire</option> <option value="Flintshire">Flintshire</option> <option value="Gwynedd">Gwynedd</option> <option value="Isle of Anglesey">Isle of Anglesey</option> <option value="Merthyr Tydfil">Merthyr Tydfil</option> <option value="Monmouthshire">Monmouthshire</option> <option value="Neath Port Talbot">Neath Port Talbot</option> <option value="Newport">Newport</option> <option value="Pembrokeshire">Pembrokeshire</option> <option value="Powys">Powys</option> <option value="Rhondda Cynon Taff">Rhondda Cynon Taff</option> <option value="Swansea">Swansea</option> <option value="Torfaen">Torfaen</option> <option value="The Vale of Glamorgan">The Vale of Glamorgan</option> <option value="Wrexham">Wrexham</option> </optgroup> <optgroup label="UK Offshore Dependencies"> <option value="Channel Islands">Channel Islands</option> <option value="Isle of Man">Isle of Man</option> </optgroup></select> </div> <div class="fieldrow postal-code"> <label for="zip">Postcode:</label><input type="text" id="zip" size="16" maxlength="16" name="zip" value=""> </div> </div> <div class="contact-information" id="contact-info-form"> <div class="fieldrow tel"> <label for="H_PhoneNumber">Home Telephone:</label><input type="text" id="H_PhoneNumber" maxlength="20" name="H_PhoneNumber" value=""> </div> <div class="fieldrow email"> <label for="email-address">Email:</label><input type="text" id="email-address" maxlength="127" name="email" value=""> </div> </div> <p id="tos">For more information about PayPal, please read our <a target="_blank" href="https://cms.paypal.com/uk/cgi-bin/marketingweb?cmd=_render-content&content_ID=ua/ServiceDescription_popup&locale.x=en_GB">Key Payment and Service Information.</a></p> <p id="tos"></p> </fieldset> </div></div> <div id="afterform"> <div class="buttonrow"> <input type="submit" id="review" name="continue.x" value="Review Order and Continue" class=""><span id="agree" style="display:none"><input type="submit" name="continue.x" value="Agree and Continue" class=""></span> </div> <p class="returnto">Cancel and return to <input type="hidden" id="cancel_return" name="myAllTextSubmitID" value=""><script type="text/javascript">var myText = 'iDealz'; document.write('<a href="#" title="" onClick="document.getElementById(\'cancel_return\').name = \'cancel_return\';document.getElementById(\'cancel_return\').value = \'1\';document.forms.billing.submit();return false;">');document.write(myText);document.write('</a>');</script><noscript><input type="submit" name="cancel_return" value="iDealz" class="transparentButton" alt=""></noscript>.</p> </div> <input name="form_charset" type="hidden" value="UTF-8"> </form></div> Auto fill it and send it back? Any help would be very much appreciated! Many thanks, James.
  9. Agreed, and when I do this. foreach($match[1] as $k => $v) { $data[] $v; } I loose most of the information. Many thanks, James.
  10. Yes, what I am hoping to do is unset all the values in curly brackets ( { } ) ans then put the rest in one array. Many thanks, James.
  11. Hiya peeps, I have this Array ( [0] => Array ( [0] => { if value>valuetwo } [1] => { do } ) [1] => Array ( [0] => if value>valuetwo [1] => do ) ) But this could be different every time as I am using preg_match_all() how would I make them merge together or at least unset the values in curly brackets? Many thanks, James.
  12. Thats what I had wrote originally but I thought it might be unstable, is this the case?
  13. Spot on mate, cheers. Many thanks, James.
  14. Hiya peeps! I was wondering what regex I would use in preg_match_all to seek things in curly brackets ( { } ). Many thanks, James.
  15. Hiya peeps! I have this code. $tags['MENU'] = ' <ul> <li class="first"><a href="category.html" class="selected">freebies</a></li> <li><a href="category.html">inspiration</a></li> <li><a href="category.html">tutorials</a></li> <li><a href="category.html">web 2.0</a></li> <li><a href="category.html">interviews</a></li> <li><a href="category.html">technology</a></li> <li><a href="category.html">freelancing</a></li> <li><a href="category.html">compilations</a></li> <li><a href="category.html">downloads</a></li> </ul>'; How do I make a script that will harvest the category.html part and match it with the page a user is on and change that line to <li class="first"><a href="category.html" class="selected">LINK</a></li>. Thanks in advance, Many thanks, James.
  16. All in one page. <?php if(isset($_POST['submit'])) { register_user($_POST['username'], $_POST['password'], $_POST['email']); function register_user($username, $password, $email){ //Prevent mysql injection TODO: Implement "stripslashes" $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $email = mysql_real_escape_string($email); //Check if passwords where correct if ($password != $_POST['confirm']){ //If not send error message $reg_error = "Passwords did not match!"; include 'regform.php'; exit; }else if ($username =='' || $password =='' || $email ==''){ //Check if all fields are filled $reg_error = "Please fill in all fields!"; include 'regform.php'; exit; } //Check is the username already in the database $check = mysql_query("SELECT * FROM users WHERE username = '$username'"); $result = mysql_num_rows($check); //Check if the email is already in the database $check2 = mysql_query("SELECT * FROM users WHERE email = '$email'"); $result2 = mysql_num_rows($check2); //If username exists throw and error if($result > 0){ $reg_error = "This username is already taken!"; include 'regform.php'; exit; } //If email exists throw an error else if ($result2 > 0){ $reg_error = "This email is already taken!"; include 'regform.php'; exit; } //encrypt password with md5 $encrypt = md5($password); //Register user mysql_query("INSERT INTO users (username, password, email) VALUES ('$username', '$encrypt', '$email')"); } //Login user function log_user($username, $password){ session_start(); //Prevent mysql injection $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $decrypt = md5($password); //Do a query against the DB $checking = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$decrypt'"); $count = mysql_num_rows($checking); //User found set session if ($count == 1){ $_SESSION['logged'] = 1; header("location: main.php"); } //User not found else{ $log_error = "Incorect username or password"; include 'login.php'; exit; } } } ?> <!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>User registration</title> </head> <body> <form action="#" method="POST"> <b>Username:</b><input type="text" name="username"/><br/> <b>Password:</b><input type="password" name="password"/><br/> <b>Confirm password:</b><input type="password" name="confirm"/><br/> <b>Email:</b><input type="text" name="email"/><br/> <input type="submit" value="submit" name="submit" /> </form> <?php if (isset($reg_error)){ echo $reg_error; } ?> <a href="login.php">Or login</a> </body> </html>
  17. Functions.php <?php include 'Database.php'; class register { function register_user($username, $password, $email){ //Prevent mysql injection TODO: Implement "stripslashes" $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $email = mysql_real_escape_string($_POST['email']); //Check if passwords where correct if ($_POST['password'] != $_POST['confirm']){ //If not send error message $reg_error = "Passwords did not match!"; include 'regform.php'; exit; }else if ($username =='' || $password =='' || $email ==''){ //Check if all fields are filled $reg_error = "Please fill in all fields!"; include 'regform.php'; exit; } //Check is the username already in the database $check = mysql_query("SELECT * FROM users WHERE username = '$username'"); $result = mysql_num_rows($check); //Check if the email is already in the database $check2 = mysql_query("SELECT * FROM users WHERE email = '$email'"); $result2 = mysql_num_rows($check2); //If username exists throw and error if($result > 0){ $reg_error = "This username is already taken!"; include 'regform.php'; exit; } //If email exists throw an error else if ($result2 > 0){ $reg_error = "This email is already taken!"; include 'regform.php'; exit; } //encrypt password with md5 $encrypt = md5($password); //Register user mysql_query("INSERT INTO users (username, password, email) VALUES ('$username', '$encrypt', '$email')"); } //Login user function log_user($username, $password){ session_start(); //Prevent mysql injection $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $decrypt = md5($password); //Do a query against the DB $checking = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$decrypt'"); $count = mysql_num_rows($checking); //User found set session if ($count == 1){ $_SESSION['logged'] = 1; header("location: main.php"); } //User not found else{ $log_error = "Incorect username or password"; include 'login.php'; exit; } } } ?> Regform.php <?php include 'functions.php'; $register = new register(); if (isset($_POST['Submit'])){ $register->register_user($_POST['username'], $_POST['password'], $_POST['email']); } ?> <!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>User registration</title> </head> <body> <form action="#" method="POST"> <b>Username:</b><input type="text" name="username"/><br/> <b>Password:</b><input type="password" name="password"/><br/> <b>Confirm password:</b><input type="password" name="confirm"/><br/> <b>Email:</b><input type="text" name="email"/><br/> <input type="submit" value="submit"/> </form> <?php if (isset($reg_error)){ echo $reg_error; } ?> <a href="login.php">Or login</a> </body> </html>
  18. <?php $id = mysql_real_escape_string(trim($_GET['id'])); $get = "SELECT `image` FROM `images` WHERE `id` = '$id' LIMIT 1"; $run = mysql_query($get); if($run && mysql_num_rows($run) == 1) { while($images = mysql_fetch_assoc($run)) { $finfo = finfo_open(FILEINFO_MIME_TYPE); header("Content-type:" . finfo_file($finfo, $images['image']) . ""); readfile('PATH_TO_IMAGES/' . $images['image']); finfo_close($finfo); } } ?> It works, and its pretty good so I find it ok! James
  19. The only reason he would need a get param is if he is selecting the image with a WHERE! But if you want to go that deep into the headers then here. <?php $id = mysql_real_escape_string(trim($_GET['id'])); $get = "SELECT `image` FROM `images` WHERE `id` = '$id' LIMIT 1"; $run = mysql_query($get); if($run && mysql_num_rows($run) == 1) { while($images = mysql_fetch_assoc($run)) { $finfo = finfo_open(FILEINFO_MIME_TYPE); header("Content-type:" . finfo_file($finfo, $images['image']) . ""); readfile('PATH_TO_IMAGES/' . $images['image']); finfo_close($finfo); } } ?> James.
  20. You want something like this. photo.php <?php session_start(); $get = "SELECT `image` FROM `images` LIMIT 1"; $run = mysql_query($get); if($run && mysql_num_rows($run) == 1) { header("Content-type:image/jpeg"); while($images = mysql_fetch_assoc($run)) { readfile('PATH_TO_IMAGES/' . $images['image']); } } ?> Then use this. <img src="photo.php"> James
  21. Hiya peeps! I was wondering how I can get server info and user info EG. I would need to collect the server's Name, IP and URL. And I would need the users IP, COMPUTER NAME and something unique to each user? Many thanks James.
  22. That worked amazingly! Thank you very very much! Many thanks, James.
  23. Maybe use sessions. EG. if(isset($_SESSION['count'])) { header('Location: disallowed.php'); } if(isset($_POST['submit'])) { $_SESSION['count'] = 1; } James.
×
×
  • 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.