Jump to content

Love2c0de

Members
  • Posts

    364
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Love2c0de

  1. I'm thinking it could take around 2-3 hours to write the script and set the database up. Then I need to implement it into the Wordpress website and allow some time for any bugs which may arise. Say 4 hours to complete the whole process. Pricing by the hour, I would probably charge around £50 which works out at just over £12 an hour. That's $84.46 Aussie dollars and $79.70 US dollars. Does that seem expensive for what's required? Regards, L2c.
  2. Good morning, So safe to say I can just write my script as I would for one of my own sites? Also, what kind of price would you charge someone if they came to you and asked for the same? I've got no way to benchmark prices as this is the first time I've had someone ask me to do a script for them. Regards, L2c.
  3. Evening Kevin, I'm waiting on the brief but a general outline is this: They want a drop-down with a list of cities in the UK. This will populate 10 boxes on the page with prices. Each city will have different prices to compensate added costs so it needs to be dynamic. My initial intention is to store the cities and prices in a database using 1 table. Setup could be: id city price1ft price 2ft price3ft etc etc 1 Manchester 26.99 45.99 69.99 etc etc 2 Edinburgh 39.99 55.99 79.99 etc etc It then needs to be further dynamic by adding labour costs depending on the amount of items in square feet. I believe once I have the data from the database I can then use JavaScript to achieve this. When they select an option from the select, I need to query the database for the correct prices and do the above. Thinking of using Ajax but I'm not sure what the client specifically requires at this moment in time so just waiting on an email. And that's pretty much the gist of the idea. Kind regards, L2c.
  4. Evening, Well I've been asked to write a function for a website and it's for a Wordpress website. When I looked at some of the Wordpress PHP code it looks really complicated. Not so much the OO PHP as I'm familiar with the syntax and look of OO PHP but it seems to have it's own 'type' of PHP code (or the plugins do). Not sure if I can just write a procedural script in a Wordpress website the same as you would for a handcoded website for example or do you have to accommodate any of the Wordpress code/files? Do you have to include any files? Do you have to create the PHP file in a certain directory? Is accessing and returning data from a Wordpress database the same concept as it is for a normal hand coded website? I've only ever handcoded and never used Wordpress or similar CMS systems so it's all new to me. Thanks for the reply. Kind regards, L2c.
  5. Good evening all, Is it possible to use a procedural PHP script in Wordpress as normal? Kind regards, L2c.
  6. Good afternoon, You first want to check that the form has been submitted and that the $_POST superglobal actually contains a value. You should do this: <?php if(isset($_POST['fname'])) { //the $_POST superglobal holds value(s)! } else { //we got nothing. } ?> That will eliminate your Undefined Index problem. Now, what are you typing in the fname field in the form? It should display the value that you entered. Kind regards, L2c.
  7. Good morning, Thanks very much. Works a treat. Regards, L2c.
  8. Good morning, I have a link on my website which has a default href value. The reason I set an initial value is so that if JS is disabled, it will direct them to another page. My jQuery is supposed to open a 'tooltip' next to the link - which it does - but I want to be able to disable the href so that it points to nowhere so the tooltip activates and the href points to nowhere but can't figure out how to do it. It keeps loading the default page. Here is my code: $(function(){ $("#technologies,#marketing,#google_analytics").fadeIn(2000); $(".tool").attr("href","#"); $(".tool").css("cursor","default"); $(".tool").hover(function(e){ var Xpage = e.pageX; var Ypage = e.pageY; var title = $(this).attr("data-pack"); var div = "<div class='tooltip'>"+title+"</div>"; console.log(div); $("body").append(div); $(".tooltip").css("top", Ypage-90); $(".tooltip").css("left", Xpage+15); $(".tooltip").fadeIn(500); }, function(){ $(".tooltip").remove(); }); }); Thanks for your time. Kind regards, L2c.
  9. Good afternoon Ch0cu3r, Thank you very much for your feedback. I've not had chance to test the code out but was looking for an alternative similar to what I had and I think this is it. In your opinion, what would be the most secure way to achieve what I want and what are the potential security issues with both? Kind regards, L2c.
  10. Good evening, Thanks for the reply. Well, what I do is scan the directory where the HTML template pages are stored and check the $_GET variables value against values within the directory array using in_array(). Kind regards, L2c.
  11. Good evening all, I wanted to know just one thing really and the reasons why if the answer is yes. Is it dangerous to search your website directory for HTML template file names to match them against a $_GET variable in order to display the correct page? Thanks for your time. Kind regards, L2c.
  12. Good afternoon, Can you provide us the code from the edit gallery script? When counting the length of strings, it returns the actual number of characters but when accessing each individual character of the string it is 0 based, so $str[0] for example would return the first character. I'm sure you know that but clearly an offset issue. I'd start by echoing each variable/value at different points of the script leading up to line 53 to see what values you are actually getting. Hard to really suggest anything with no code apart from it's an offset issue . Kind regards, L2c.
  13. Good evening Jazzy, What would you suggest CSS wise? Should I optimize the image using an online image optimization tool? Thank you for further feedback! All criticism is greatly welcomed! Kind regards, L2c.
  14. Good morning again, I added the <base> tag above all my other external files in the <head> and it's working fine now. Thank you very much. Kind regards, L2c.
  15. Hi Jazz, Thanks for the reply. I added the base tag and I now have my images loading ok, the only things not loading now are my 2 stylesheets, font.css and main_styles.css I will look into the absolute path later as I'll be away soon. Just googled it and played around with {SERVER_NAME} but no luck. However will research later. I'm not quite sure on this line in the console though: http://www.tspv-websites.co.uk/Contact/css/main_styles.css The /css/ directory is not within a directory called Contact, it is in the same directory as my main index.php, whereas the actual Contact HTML file is a couple stages above. Thanks again for the reply! Kind regards, L2c.
  16. I think it's to do with my links not being relative to the path or something because the images and stylesheet are not loading. Any ideas? Sorry couldn't edit my last post. Thanks L2c.
  17. Good evening, I've got an 'Offers' page with 3 deals on there. Each deal has it's own link with the URL like this: <a href="./Contact/Deal" />Deal 1</a> <a href="./Contact/Deal" />Deal 2</a> <a href="./Contact/Deal" />Deal 3</a> The idea is when one of the 3 deal buttons are clicked, I want to send a $_GET value through the URL and populate my textarea on my form with some text relevant to the 'Deal' on my contact page. I am rewriting the URL and only just got the page to load (I was getting a 404 before). Trouble is, my page has no styles applied to it whatsoever. The stylesheet appears in the <head> but none of the elements have any styles applied to them. Here is my Offers page: <h2 id="offer_intro">Exclusive Offers This Year!</h2> <div id="deals_container"> <div class="deals" id="deal1"> <h3>Deal 1</h3> <h2>40% Off!</h2> <p>Guranteed 40% off any website for our second client! Firstly, I will liaise with you and discuss the requirements of your website. I will provide you with the standard price, followed by the price after the deduction of the 40%. This offer includes domain & hosting for 1 year.</p> <span>Be quick!</span> <a href="./Contact/Deal">Order!</a> </div> <div class="deals" id="deal3"> <h3>Deal 3</h3> <h2>£50 Logo/Banner Design</h2> <p>If you would simply like a new logo or banner designed for your existing website, we provide this service for a very cheap fee of £50 when you order by 31<sup>st</sup> October 2013. We will create 3 or 4 mock examples and provide you with them all. We make any tweaks which you suggest.</p> <span>Need a logo?</span> <a href="./Contact/Deal">Order!</a> </div> <div class="deals" id="deal2"> <h3>Deal 2</h3> <h2>Free Domain & Hosting!</h2> <p>Free Domain & Hosting for<span>2 years</span> when you purchase any website. This will be deducted from the overall price of your website. We will provide support in setting up your domain and hosting account, including any email accounts and/or mailing accounts your website will use.</p> <span>Order Now!</span> <a href="./Contact/Deal">Order!</a> </div> </div> <script> $('.deals button').click(function(){ console.log(this); }); </script> Here is my .htaccess file: RewriteEngine on RewriteBase / RewriteRule ^/?([a-zA-Z_]+)$ index.php?page=$1 [L,QSA] RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_0-9]+)$ index.php?page=$1&deal=$2 [L] Obviously something is not right with the second RewriteRule I think because like I said above, it was giving me a 404 and I kept modifying it and I looked at other peoples problems online and figured the 'pattern' but not quite 100%. Getting this error in Chrome Dev Tools: Has anyone ever come across this problem? Thank you for your time. Kind regards, L2c.
  18. Look at what I've caused I'll stick with what I have for these purposes as it works and it's only 2 emails so it should suffice I think. Thanks for all the input. Kind regards, L2c.
  19. Good morning, Great topic and good to read. The emails are not that significant as I log into my database everyday so should someone contact me and the email fails, chances are I will spot the contact within my database where I send all their data. Ideally though I would like an email to notify me. At the minute it works perfect but I'm open to any suggestions to improve it. Is using an external mailing system necessary for this occasion? Kind regards, L2c.
  20. Good afternoon guys, I'm torn on what to do, you have completely different opinions......discuss more please! I mean, the way I have it right now, it's working perfectly. I used one of my old email accounts (as a user) and use [email protected] to inform me of contact. I'm receiving both emails saying the correct things. Discuss more though because I'd like it to be as robust as possible with no room for error. Kind regards, L2c
  21. I will take that into consideration. I'm using a separate file with a require statement in my main index.php file after processing the data. Here is the file: index.php if(!isset($error)) { //no errors, we have required data - continue $date = date("Y-m-d", time()); require("$dir/send_emails.php"); require("$dir/$dirq/insert_contact.php"); } The email script: <?php //write email scripts //client script $to = $_POST['email']; $subject = "TSPV-Websites"; $message = "Thank you for your contacting us.\r\n<br />"; $message .= "We will reply to you shortly.\r\n\r\n<br /><br />"; $message .= "Please find your message details below for reference:\r\n\r\n<br /><br />"; $message .= "<b>Your name:</b> ".$_POST['name']."\r\n<br />"; $message .= "<b>Your Number:</b> ".$_POST['phone']."\r\n<br />"; $message .= "<b>Your Email:</b> ".$_POST['email']."\r\n<br />"; $message .= "<b>Your Referrer:</b> ".$_POST['referrer']."\r\n<br />"; $message .= "<b>Your Comments:</b> ".$_POST['comments']."\r\n\r\n<br /><br />"; $message .= "<b>Message Sent:</b> ".$date."\r\n<br />"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: [email protected]"; mail($to,$subject, $message,$headers); //admin script $to = "[email protected]"; $subject = "TSPV-Websites"; $message = "We have received contact from a user..\r\n<br />"; $message .= "Please find the message details below for reference:\r\n\r\n<br /><br />"; $message .= "<b>Their name:</b> ".$_POST['name']."\r\n<br />"; $message .= "<b>Their Number:</b> ".$_POST['phone']."\r\n<br />"; $message .= "<b>Their Email:</b> ".$_POST['email']."\r\n<br />"; $message .= "<b>Their Referrer:</b> ".$_POST['referrer']."\r\n<br />"; $message .= "<b>Their Comments:</b> ".$_POST['comments']."\r\n\r\n<br /><br />"; $message .= "<b>Message Sent:</b> ".$date."\r\n<br />"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: [email protected]"; mail($to,$subject, $message,$headers); ?> Regards, L2c.
  22. Wow indeed. What the hell am I thinking? Kind regards,
  23. Good evening, Writing an email script which will send an email to the client saying thank you for contact plus their message below including the time they sent the message. The second email will be one going to myself so I am notified about the contact, again containing the message. I want to just reset the $to and $subject variable values and re use them. Is proper practice to unset the variables then recreate them, or just set them to an empty string before writing the second script? Thanks for the advice. Kind regards, L2c.
  24. Thanks, I'll keep it in mind! Regards, L2c.
  25. Good evening PaulRyan, Did exactly that and works how I wanted it to. I was under the impression though that you shouldn't store trivial data in a session or is that completely untrue? Kind regards, L2c.
×
×
  • 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.