Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. Yes It depends on what roles you are looking for. If you are looking for a high salary then experience is key. However, if you are looking for more of a junior role on a lower salary where you could progress, I think that demonstrating some of your freelance work would be brilliant. Apart from the experience desired by compaines in job adverts don't be put off by the skills that they list i.e In the advert you posted they mention experience with at least one framework, why? If you understand OOP and are a competent programmer then you can pick up a framework in days. How do you define expert. If you have created websites with PHP that are successful then you are skilled using PHP. Same as above. I think that you just have to prove that you can adapt and become familiar with any technologies that are used in the company. i.e. If you have never used AJAX in your projects then there is no reason why you cannot pick it up very quickly. I use JS and AJAX sparingly, however if I was given a job where it is heavily required I can pick up a JS framework easily. Most job adverts I see just list all the technologies used on the web and say that they are desired. In truth this is not the case, they may use bits & pieces from different technologies but there is no way you need to be fluent in all.
  2. I have the same dream only it involves eating pies. There are lots of us here that do. Keep checking the job websites in your country to see what is about. For some reason (with all the recession, credit crunch business) in the UK, companies are crying out for PHP / .NET / Java developers.
  3. I could give you my PayPal address! Only kidding
  4. http://www.tizag.com/phpT/fileupload.php
  5. I get called a lot worse sometimes There is nothing wrong with this however when sticking to database normalization practices, 1 to 1 relationships are rare and usually should be combined into a single entity (i.e 1 table). There are cases where a 1 to 1 relationship would be more efficient in terms of application speed i.e If you had a website that contained 100,000 news articles, you would expect to have a table such as: articles ===== articleId title content author created However, on most of the website pages I only display the title, author and the created date. I only display the text of the article when a user clicks on the title. Therefore as the 'content' field is a text field it takes up more memory when querying the database table, so as I do not display the article text very often, it makes my application much faster if I was to split as follows: articles ====== articleId title author created article_text ======= articleId content In your case you probably aren't going to be massively querying the members table so there is no real need to split data for a single member of a different type.
  6. Why would you store the contents of an image file in a database field? Use your script to upload the file to the server, rename it so it is unique and doesn't contain any funny characters, save the filename to the database. When you output to screen all you need is the filename from the database, i.e <img src="/uploads/<?php print $row['filename']; ?>" />
  7. Have a look at the following from the php manual and you will see. http://php.net/manual/en/reserved.variables.server.php http://uk3.php.net/strstr By duplicating the HTML your code is inefficient. Changes to the footer would mean you having to change 2 parts of the HTML instead of 1. If all that is needed is an additional div element you could use the following <?php /* add to all but homepage footer */ if(!strstr($_SERVER['PHP_SELF'],"default.php")) { ?> <div class="footer2"> </div> <?php } /* display rest of footer */ ?> <div class="footer"> <div class="footer1"> </div> <div class="footer2"> </div> <div class="footer3"> </div> <div class="footerLinks"> <?php include($_SERVER['DOCUMENT_ROOT']."/includes/php/bottomlinks.php"); ?> </div> <div class="footer4"> </div> </div>
  8. You do not want 2 tables as you will be creating 1 to 1 relationships, this is pointless i.e 1 member can only relate to 1 supplier. Add all fields to the members table, if they dont apply to all members i.e only suppliers set them to have a default value of NULL. If it is the case that there are 3 user types, i.e members, suppliers, & both, then again use a flag to distinguish the user type. i.e members ==== memberId (INT) name (VC 50) username (VC 10) password (PASSWORD) memberType (ENUM 'general','supplier','both') DEFAULT general supplierField1 (VC 20 NULL) supplierField2 (VC 20 NULL) In the above structure the type of member is defined by the memberType field, they are a 'general' user, a 'supplier', or 'both' types. The following fields only contain data when the user is part of the suppliers group. If they are general members then the fields are NULL.
  9. Your second option to use an array is the best option as opposed to variable variables. <?php $results = array(); $num = 1; $query = mysql_query("SELECT * FROM people"); while($row = mysql_fetch_array($query)) { $results[$num] = array('name' => $row['name'], 'age' => $row['age']); $num++; } /* now you can extract values from the array */ print "name: ".$results[1]['name'].", age: ".$results[1]['age']."<br />"; print "name: ".$results[2]['name'].", age: ".$results[2]['age']."<br />"; ?>
  10. Try the following <?php if(strstr($_SERVER['PHP_SELF'], "default.php")) { } else { } ?>
  11. No probs. I'm in the UK so it's early afternoon here.
  12. You cannot use these functions on such an array. You require a loop to search the array. <?php $MyArray['first']['col1'] = 'abc'; $MyArray['first']['col2'] = 'def'; $MyArray['first']['col3'] = 'ghi'; $MyArray['second']['col1'] = 'jkl'; $MyArray['second']['col2'] = 'mno'; $MyArray['second']['col3'] = 'pqr'; $MyArray['third']['col1'] = 'stu'; $MyArray['third']['col2'] = 'vwx'; $MyArray['third']['col3'] = 'yz'; $MyArray['fourth']['col1'] = 'ddd'; $MyArray['fourth']['col2'] = 'b2b'; $MyArray['fourth']['col3'] = 'c3c'; $MyArray['fifth']['col1'] = 'ddd'; $MyArray['fifth']['col2'] = 'eee'; $MyArray['fifth']['col3'] = 'fff'; $MyArray['sixth']['col1'] = 'ggg'; $MyArray['sixth']['col2'] = 'hhh'; $MyArray['sixth']['col3'] = 'iii'; $MyArray['seventh']['col1'] = 'ddd'; $MyArray['seventh']['col2'] = 'kkk'; $MyArray['seventh']['col3'] = 'lll'; // print out values based on key print $MyArray['third']['col2']."<br />"; // search for value $search = "ddd"; $keys = array(); foreach($MyArray as $number => $col) { foreach($col as $colname => $value) { if($value == $search) { $keys[$number] = $colname; } } } print "The search for ".$search." is found in the following arrays<br />"; print "<pre>"; print_r($keys); print "</pre>"; exit(); ?>
  13. Use a flag in your users database table to define a supplier i.e members ==== memberId (INT) name (VC 50) username (VC 10) password (PASSWORD) supplier (ENUM 1,2) Normal members will have a value of 1 in the supplier field. Suppliers will have a value of 2. As it is an ENUM field it can only contain one or the other value. Any members that are flagged with a 2 in this field you can display the link for. In the suppliers area of the website make sure you repeat the test that checks the value is equal to 2. If it isn't then redirect the user to a 404 page or another page on your website.
  14. Multidimensional. There is no such array key in the example below! $MyArray[2]['col2'] You array is using text values for its keys i.e 'first','second' For the above to work your array would have to look like <?php $myArray = array(1 => array('first' => array('col1' => 'abc')), 2 => array('first' => array('col1' => 'def'))); ?> Use the following to view your array and you will see its structure <?php print "<pre>"; print_r($myArray); print "</pre>"; exit(); ?> Also, to find an array key from its value use the function array_search() http://uk3.php.net/array_search Hope this helps
  15. UPDATE tablename SET cat=1 WHERE CONCAT(CURDATE(),' ',CURTIME()) > end_time
  16. These are known as variable variables. http://php.net/manual/en/language.variables.variable.php
  17. Honestly. Get a professional design agency to start over on it. It looks so dated it is untrue. If this is supposed to be an advert for your company it does not give a good first impression.
  18. Way off the mark. If you mean that you are being redirected to /index.php from the root domain this is a 301 redirect at work. The only thing that could be causing this is a line in your .htaccess file / httpd conf file using a RewriteRule, or you specifically have a line of code in your script that is using a header() redirecting to index.php Use this tool http://www.internetofficer.com/seo-tool/redirect-check/ and enter your url. You will see any redirects that are at work.
  19. http://www.php.net/manual/en/book.zip.php
  20. Open SSL is used for generating CSR's & Keys that are needed when purchasing SSL certificates. Once you have a certificate setup on your server just change the links on your website from http:// to https:// Follow instructions here if you are running Apache on Linux and OpenSSL http://slacksite.com/apache/certificate.php
  21. How do you know the site sets any cookies after login? Setup a test php script on your local server that sets a cookie. Use the cURL functions I gave you to make a request to it. Is a cookie set?
  22. Post the code. At a guess, the data that is returned from your database is breaking your CSS when you are outputting to the screen or the data actually contains HTML. Have you viewed the source in your browser to see what is going on. This is more likely a CSS question.
  23. The directory it resides in must have the correct permissions for the apache user to create the file. I am not a windows user. In a Linux setup I would use /tmp as the directory for cookies to be created. The directory gets cleaned when not in use.
  24. LOL, Disney must get tons of traffic from redirects. Thats where I send all bad bots and 403 requests.
×
×
  • 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.