PHP - London Based Web Developer Wanted: Full Time, Permenant
Base Creative is changing and expanding. We have recently appointed a new creative director and a new technical project manager and we are looking for a:
WEB DEVELOPER
Growth in our business has brought about the impetus to change the creative direction of the company along with the environment and atmosphere, under the direction of our creative head and with your input.
We have a good reputation, a wealth of happy clients - big established names to smaller start-ups with fresh ideas - but we want to be more innovative, fun and much more creative, growing further into cross media and device skills, forging a recognised, stellar reputation for quality creativity in the industry. We are starting with gradually overhauling our own website and studio, so be prepared to play a part in this change immediately.
Your Role
You will have full control over your output, from the planning stage right through to the back end development, while working with our other staff on the creative and development team. You can become a part of something new and exciting, playing a key role in shaping the environment within which you work.
The perfect candidate will be 100% committed to a successful career with Base Creative, looking to learn and grow in knowledge and have a great portfolio underpinned by varied technical skills.
Responsibilities and Tasks:
Similar TutorialsYou: As a PHP expert, you find the prospect of building yet another brochure-ware website distressing; you want to get your hands dirty building an advanced, MVC based application in a fun and supportive environment where you will be constantly challenged, always learning and delivering a product used by millions of people every day.
Our company was founded and is managed by developers who wrote the original software the company was built upon; the technical team are the core of our business. As a member of that team, it will be you who decides upon the on-going development of our technical stack as well as the product itself. You will of course have complete control over your workstation.
Our stack:
Qualifications:
A passion for programming, solving problems and building software customers love.
Experience building web-based applications as distinct from brochure-ware websites.
An expert in OOP/MVC/ORM programming techniques and PHP (v5.3+) frameworks. We happen to use Symfony2 but any relevant experience is fine.
You can bend MySQL to your will.
Solid front-end development experience with XHTML, CSS, and Javascript. Our stack includes AngularJS, CoffeeScript, jQuery and LESS.
An appreciation for a beautiful GUI and excellent user experience.
Expectation of a fast moving, agile environment. We ship code to customers daily – we’d expect you contribute from day 1.
You can validate your skills for example with source code samples, a github profile, contributions to an open source project, developer blog, stackoverflow answers etc.
What you will do:
Design (with help) and develop new channels for our software. In particular we are looking at apps using twilio (for voice/sms), facebook and twitter as well as a web based screensharing tool.
Integrate our software into other 3rd party applications. This could both be via APIs (salesforce, jira, 37signals) or through digging directly into the source code (sugarCRM, xenforo etc).
Continue improve and refine our existing channels and product. We are never satisfied and always looking for that small improvement, refactor or redesign that can increase usability, speed and functionality for our customers.
Work on our backend systems including internal developer tools and deployment processes, our SaaS application stack or the tools we have to manage our business.
Work on our mobile apps, built using our API / HTML5 and PhoneGap
About us:
Our principle product is DeskPRO, the helpdesk software platform. We make it easy for organisations (companies – large and small, charities, public sector organisations) to communicate with their users via email, twitter, facebook, SMS, web forms, live chat (text and voice) as well as providing publishing self-help tools, sales management, co-working tools and community based question and answers. DeskPRO is a platform where customers install the helpdesk applications they need to manage their business.
We sell this software to a range of organisations including large companies (e.g. Tumblr, Xerox, T-mobile, Fujitsu, Valve Software and AT&T) universities and the public sector all the way through to small family businesses. We have a dual license model; selling licenses to software installed on our clients’ servers (we don’t encrypt the code – so your code will get read!) and offering a fully managed SaaS solution. Millions of people use our software every day and a lot of agents spend their whole working day using it constantly.
What we offer:
Competitive salary based upon experience.
Friendly work environment at the Innovation Warehouse in Farringdon: http://theiw.org/.
30" monitor and control over your workstation setup. No corporate bureaucracy here.
A mixture of autonomy over your role and real responsibilities to the team and business.
Varied work. The DeskPRO product is large with lots of modules and technologies.
Review our source code before even applying; just ask and we will add you to our github account. Never accept a job until you have seen the code you will be working with.
We plan to have a lot of fun on this journey – please bring a sense of humour.
Apply:
Please send your CV and either a link to your online profile, github account or some sample source code to: jobs@deskpro.com
We're a London-based start-up company called md8 LTD. Right now we are looking for a UK-based senior server-side and client-side developer to build the main application of our ground breaking debating website. Please see our pdf for more information: https://truck.it/p/2rQYrhOIQO Hi I have a simple idea for a webapp I would like to pay someone to develop for my small business. It's a system for tracking "one off" orders we get. Basically at the moment we use paper notes. Problems with this:- - They get lost - In 6 months time if the customer wants to reorder, you have to take the customer's details again, which isn't very professional - If I remember I've taken an order for something I can't do anything about it (i.e. let my colleagues know) until I'm next at work. etc etc I wanted built a web app (basically a webpage front end to a as yet non-existent database) which would allow us to log these items and then have a search/query function where we would look through:- "open orders" "closed orders" "orders awaiting collection" etc offers to mefijob@forward.cat thanks! Basically I have recently been playing around with parsing a csv file. What I am looking to do at this point is simply take the date/timestamp (part of the csv file), which is in the following format:DD/MM HH:MM:SS.100th/s For the sake of argument, lets say I have this in an array string called $csv[0] and the file has several lines that span the course of a couple hours. I wouldn't mind having to use explode() to breakup/remove the date or 100th/s IF that would make things a lot simpler. So where would I start in trying to achieve this?. The result I am looking for will simply return "X Seconds". Storing this in a string variable would be a bonus, as I plan to use this to divide a separate piece of information. Any examples or ideas would be great. Thank you. ps: Here is an example time from the csv file itself: Code: [Select] 11/19 22:23:18.143 SensioLabs UK is proud to announce the third edition of the exceptionally successful SymfonyLive London.
Queen Elizabeth II Conference Centre, London, SW1P 3EE.
The two day conference will take place on Thursday 25th - Friday 26th September 2014, in the heart of London, and will bring together the sharpest minds in open source enterprise software development.
Day one is a workshop day consisting of hands-on training courses from industry leading Symfony experts.
Day two is the main conference day when we're pulling out all the stops. Talks on Symfony, Drupal, BDD and wider PHP topics will make this an event to remember.
Whether you're a Symfony aficionado or a novice eager to learn more, this event will have something for everyone.
To register go to http://london2014.live.symfony.com
For the latest conference news follow us @SensioLabsUK - official hashtag #symfony_live.
Who should attend?
Symfony developers (all levels of experience and knowledge welcome)
Drupal developers looking to learn more about Symfony and its components in preparation for the Drupal 8 launch later this year
PHP developers eager to widen their knowledge on frameworks, best practice and quality PHP development techniques
Development managers, system administrators and other IT professionals with an interest in learning more about Symfony, getting to know the community and sharing ideas.
Hi peps, I am trying to write a script that allows for events to be executed at any given time that user gives it like if the user wants it at 2 am the event will execute at that given time i read some answer they say use cron but im using windows how to do it ?? Hello everyone, here is my problem. I am working for someone that would like users to be able to create a Trial Account on their website. This trial account is to be used for 24 hours, once the 24 hours is completed they can no longer login/use that account. Everything about the Trial Account is completed, other then the account timer. I am at a loss on how to get this part done. I was thinking that I would use the MySQL commands, GETDATE() and DATEADD(), to get the date and time that the account was created and using the DATEADD() command I would add 24 hours to the GETDATE() value. Then if the user logs into at a date past the DATEADD() value the Users Account type is switched to 3(This means that the account has been disabled) and then is directed to the Logout page, which then redirects him back to the homepage. After this point, the user can no longer login due to the code preventing any user with an account type of 3 to login. The problem is that I am unaware how to incorporate the GETDATE() and DATEADD() functions into my PHP code. Would anyone be able to explain how I can get this done, or suggest a better method of inputting a starting time and ending time for the account? Thank You for any/all help. I created a "statistics of site" page, stats.php. Currently stats.php updates every visit, that's over 25 queries for every visit, with over 9,000 visits a day, I wish to cut down. What is the best way to make it so all queries are done every hour, therefore requiring less queries to the database? I assume the best way to go at this would be either to run a time() based script every 60 minutes and: - update this to a new field, then stats.php will require 1 query every visit, plus the 1 every hour. or - update a text file and read that each stats.php visit, meaning just the 1 query every hour. Now, I understand the second option will run much less queries overall, but is it the best way to go? Is there a better way to go about doing this? Been googling this for hours now and I can't find something that doesn't give a parse error. I found this thread: http://www.phpfreaks.com/forums/index.php?topic=160855 ..and tried to work around the answer but with no luck. All I really want to do is something like this: <td class=" <?php if ($time<20:00&>1:00) { echo "class1";} else if($time>20:00&<2:00) { echo "class2";}?> "></td> I want the class to change to another one if the user see the table cell within a specific hour of the day. Hi, i am thinking of creating a text based game mmorpg using php/mysql etc... I know that a lot of these types of games use a tick based system, but i want it to be realtime, the only game i cna find that uses this is Torn, does anyone know how they make it realtime? I know that ticks can be controlled by cronjobs, but how about realtime? The problem is that the game might involve the player building a house, in a tick based system it could be easy to manage by saying the house will take 3 ticks to complete, but i want the house to be like in 10 minutes of 32 minutes, how can i do this. Someone said to check whenever the player next logs in to check if the house has finished and then say it has been built, but seeing as it is an mmorpg it could affect everyones gameplay, not just the person building it, so this will not work. Thanks and sorry if this is a bit confusing. I would really appreciate help and I hope my problem can be solved easily. I am attempting to display the date/time based on the user's location. I have installed the timezone.js plugin for help as well. Is there a way to convert the Jquery variable that displays the users timezone location and insert it inside the PHP date_default_timezone_set?
If there is an easier way to display the users timezone date and time please let me know otherwise this was the only solution I could find.
Thanks in advanced...
Here is my code
Header
<header> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script src="Time/detect_timezone.js"></script> <script src="Time/jquery.detect_timezone.js"></script> <script> $(document).ready(function(){ $('#tzvalue').set_timezone({'default' : 'America/Los_Angeles'}); }); </script> </header> Hi, I have a project where i want to send the sms to the customers at the particular time calling from the database, how to do these in php? Thanks, Hello Coder Guys, I need a small help from you. I want to list all files & directories based on last file modification time of server. I want to list new files as first & old files as last. Consider "files" as the directory name which contains all files & directories. Please make the php code to display all files & directories from "files" directory based on last file modification time of server. Thanks IN Advance ! This code works just fine to display a list of reservations for a given day and sums the guest and table counts just fine for the entire day. Sums all reservations returned.
What I am trying to do or figure out is a way to get totals based on specific time intervals. For example how many guests and tables at 8:00, 9:00, 10:00, etc....
I can see where the sums are calculated, but need help adding a way to add a variable to look at the reservation_time and sum by hour rather than just daily total.
$tablesum ++; $guestsum += $row->reservation_pax; <?php echo $guestsum;?> <?php echo _guest_summary;?>The full code that pulls in the data and then sums it up in total: <!-- Begin reservation table data --> <br/> <table class="global resv-table-small" cellpadding="0" cellspacing="0"> <tbody> <tr> <?php echo "<td class='noprint'> </td>"; echo "<td>Time</td>"; echo "<td>Guests/Type</td>"; echo "<td>Name</td>"; echo "<td>Special Instructions/Notes</td>"; echo "<td class='noprint'>Table</td>"; echo "<td class='noprint'>Status</td>"; echo "<td class='noprint'>Created</td>"; echo "<td class='noprint'>Details/Delete</td>"; echo "</tr>"; // Clear reservation variable $reservations =''; if ($_SESSION['page'] == 1) { $reservations = querySQL('all_reservations'); }else{ $reservations = querySQL('reservations'); } // reset total counters $tablesum = 0; $guestsum = 0; if ($reservations) { //start printing out reservation grid foreach($reservations as $row) { // reservation ID $id = $row->reservation_id; $_SESSION['reservation_guest_name'] = $row->reservation_guest_name; // check if reservation is tautologous $tautologous = querySQL('tautologous'); echo "<tr id='res-".$id."'>"; echo "<td"; // daylight coloring if ($row->reservation_time > $daylight_evening){ echo " class='evening noprint'"; }else if ($row->reservation_time > $daylight_noon){ echo " class='afternoon noprint'"; }else if ($row->reservation_time < $daylight_noon){ echo " class='morning noprint'"; } echo " style='width:10px !important; padding:0px;'> </td>"; echo "<td id='tb_time'"; // reservation after maitre message if ($row->reservation_timestamp > $maitre['maitre_timestamp'] && $maitre['maitre_comment_day']!='') { echo " class='tautologous' title='"._sentence_13."' "; } echo ">"; echo "<strong>".formatTime($row->reservation_time,$general['timeformat'])."</strong></td>"; echo "<td id='tb_pax'><strong class='big'>".$row->reservation_pax."</strong> <span class='noprint'>"; printType($row->reservation_hotelguest_yn); //echo "<img src='images/icons/user-silhouette.png' class='middle'/>"; echo "</span></td><td style='width:10%' id='tb_name'><span class='noprint'>".printTitle($row->reservation_title)."</span><strong> <a id='detlbuttontrigger' href='ajax/guest_detail.php?id=".$id."'"; // color guest name if tautologous if($tautologous>1){echo" class='tautologous tipsy' title='"._tautologous_booking."'";} echo ">".$row->reservation_guest_name."</a></strong>"; // old reservations symbol if( (strtotime($row->reservation_timestamp) + $general['old_days']*86400) <= time() ){ echo "<img src='images/icons/clock-bolt.png' class='help tipsyold middle smicon' title='"._sentence_11."' />"; } // recurring symbol if ($row->repeat_id !=0) { echo " <img src='images/icons/loop-alt.png' alt='"._recurring. "' title='"._recurring."' class='tipsy' border='0' >"; } echo"</td><td style='width:10%' id='tb_note'>"; if ($_SESSION['page'] == 1) { echo $row->outlet_name; }else{ echo $row->reservation_notes; } echo "</td>"; if($_SESSION['wait'] == 0){ echo "<td class='big tb_nr' style='width:85px;' id='tb_table'><img src='images/icons/table_II.png' class='tipsy leftside noprint' title='"._table."' /><div id='reservation_table-".$id."' class='inlineedit'>".$row->reservation_table."</div></td>"; } echo "<td class='noprint'><div>"; getStatusList($id, $row->reservation_status); echo "</div></td>"; echo "<td class='noprint'>"; echo "<small>".$row->reservation_booker_name." | ".humanize($row->reservation_timestamp)."</small>"; echo "</td>"; echo "<td class='noprint'>"; // MOVE BUTTON // echo "<a href=''><img src='images/icons/arrow.png' alt='move' class='help' title='"._move_reservation_to."'/></a>"; // WAITLIST ALLOW BUTTON if($_SESSION['wait'] == 1){ $leftspace = leftSpace(substr($row->reservation_time,0,5), $availability); if($leftspace >= $row->reservation_pax && $_SESSION['outlet_max_tables']-$tbl_availability[substr($row->reservation_time,0,5)] >= 1){ echo" <a href='#' name='".$id."' class='alwbtn'><img src='images/icons/check-alt.png' name='".$id."' alt='"._allow."' class='help' title='"._allow."'/></a> "; } } // EDIT/DETAIL BUTTON echo "<a href='?p=102&resID=".$id."'><img src='images/icons/pen-fill.png' alt='"._detail."' class='help' title='"._detail."'/></a> "; // DELETE BUTTON if ( current_user_can( 'Reservation-Delete' ) && $q!=3 ){ echo"<a href='#modalsecurity' name='".$row->repeat_id."' id='".$id."' class='delbtn'> <img src='images/icons/delete.png' alt='"._cancelled."' class='help' title='"._delete."'/></a>"; } echo"</td></tr>"; $tablesum ++; $guestsum += $row->reservation_pax; } } ?> </tbody> <tfoot> <tr style="border:1px #000;"> <td class=" noprint"></td><td></td> <td colspan="2" class="bold"><?php echo $guestsum;?> <?php echo _guest_summary;?></td> <td></td> <td colspan="2" class="bold"><?php echo $tablesum;?> <?php echo _tables_summary;?></td> <?php if($_SESSION['wait'] == 0){ //echo "<td></td>"; } ?> </tr> </tfoot> </table> <!-- End reservation table data --> Edited by mfandel, 26 October 2014 - 02:06 AM. I'm working on a project that has a lot of different timezone options, and all I have from the users is their UTC offset. After weeks of doing tweaks, I come to new issues every time I add something, one would think it would be a lot easier to just get the correct time and day :) The latest issue is that when I try to rewrite a date to a better fomat, it disregards the GMT offset. Like this: 4/14/19, 12:00 PM GMT+2 (=$date) becomes ... 14-04-2019 10:00 when using this code: $bp_date_to_format = date_create_from_format('Y-m-d\TH:i:sP', $date); echo date_format($bp_date_to_format, 'd-m-Y H:i'); I figured it would just rewrite the format, keeping the exact time. It isn't. We do have all these sorts of localization functions as well, but because there doesn't seem to be one single standard (each 3rd party API connection we have uses its own default datetime format so it seems). // Remove UTC Text $UTC_offset = str_replace('UTC', '', $timezone); // Get Offset in Minutes if (stripos($UTC_offset, ':') !== false) { // Calculate seconds from offset list($hours, $minutes) = explode(':', $offset); $seconds = $hours * 60 * 60 + $minutes * 60; } else { $seconds = $UTC_offset * 60 * 60; } // Get User timezone name from seconds $timezone = timezone_name_from_abbr('', $seconds, 1); if ($timezone === false) { $timezone = timezone_name_from_abbr('', $seconds, 0); } // Set new TZ return date_default_timezone_set($timezone);
Isn't there any "one way"solution that can be used? It's confusing to say the least.
Cheers. I've been researching online resources and seen a lot of code and functions for calculating an interval or difference between two date/time figures. What I'm trying to do is somewhat in reverse... I want to establish an interval to determine a past date/time to be used in a MySQL Query but just can't figure the critical part.
// STEP #1 = DEFINE THE DESIRED DATE/TIME DIFFERENCE INTERVAL DESIRED FOR QUERIES $timeinterval = '60'; // Interval is in MINUTES and can be changed as desired // STEP #2 = GET THE CURRENT LOCAL SERVER DATE/TIME // as YYYY-MM-DD HH:MN:SE $serverdatetime = date('Y-m-d H:i:s'); // My local Server Date & time // STEP #3 = CALCULATE THE ***PAST** (OLDER) DATE/TIME LIMIT BASED ON $timeinterval (Minutes) // as YYY-MM-DD HH:MN:SE $pastdatetime = [stuckinarut here] <- 60 MINUTES prior to current Server Date/Time // STEP #4 = MySQL QUERY (`submitted` column is auto-timestampped on record insertions) $sql="[columnsblahblah] FROM mydb WHERE `submitted` >= $pastdatetime";In a Perfect World, the MySQL Query would yield ONLY records with a `submitted` DATE/TIME equal to 60 Minutes (or less) PRIOR TO from the Current Server Time. Any assistance is appreciated! Thanks. -FreakingOUT Hello, I am building an online game(users make a character and move on a map and so on...)
All user data is stored in a mySQL database and I want the users to interact in real-time, but there can be a 1-3 second delay between the communication, but not exceed 3 seconds even if 500 players are playing at the same time.
But for the purpose of the question let's say the users can only chat between one another, if I'll have a solution for that then I can use the same method for more parts of the game.
I can't use websockets because my webhost doesn't support it( I don't want to use pusher.com).
I know I can make real-time apps with ajax long polling, but I think that with 500 players playing at the same time it's not the best solution.
So, finally:
How can I make user interaction as close as possible to a real-time game?
(Without too much load on the hosting server)
(I am sorry if some of my terms are not correct - I am just getting back to coding after a long time...)
Edited by Mythion, 17 August 2014 - 02:34 AM. Hi, I am getting un-wanted error messages with this register form. It should just go through to insert into db table but i keep getting: "You must enter a valid address Your invalid company description was:" Here's the code.... register00.php: Code: [Select] <?PHP session_start(); include('db.php'); /* set some validation variables */ if (isset($_POST['Submit'])){ $error_message = ""; /* DEFINE THE FUNCTION */ /* ============================================== */ /* ============================================== */ /* DO NOT MODIFY THIS FUNCTION */ function Resize_Image($save,$file,$t_w,$t_h,$s_path,$o_path) { $s_path = trim($s_path); $o_path = trim($o_path); $save = $s_path . $save; $file = $o_path . $file; // $ext = strtolower(end(explode('.',$save))); $a = explode('.', $save); $ext = strtolower(end($a)); unset($a); list($width, $height) = getimagesize($file) ; if(($width>$t_w) OR ($height>$t_h)) { $r1 = $t_w/$width; $r2 = $t_h/$height; if($r1<$r2) { $size = $t_w/$width; }else{ $size = $t_h/$height; } }else{ $size=1; } $modwidth = $width * $size; $modheight = $height * $size; $tn = imagecreatetruecolor($modwidth, $modheight) ; switch ($ext) { case 'jpg': case 'jpeg': $image = imagecreatefromjpeg($file) ; break; case 'gif': $image = imagecreatefromgif($file) ; break; case 'png': $image = imagecreatefrompng($file) ; break; } imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; imagejpeg($tn, $save, 100) ; return; } /* END OF RESIZE FUNCTION */ //This is the directory where images will be saved $target = "/home/users/web/b109/ipg.removalspacecom/images/COMPANIES/"; $target = $target . basename( $_FILES['upload']['name']); // Connects to your Database // session_start(); // include ('db.php'); //This gets all the other information from the form /* ============================================== */ /* ============================================== */ /* YOU NEED TO DO SOME VALIDATION AND SANITIZING OF YOUR FORM DATA */ if((!isset($_POST['company_name'])) || (strlen(trim($_POST['company_name'])) <5) || (trim($_POST['company_name']) != preg_replace("/[^a-zA-Z0-9\s\-\'\,\.\_]/", "", trim($_POST['company_name'])))) { /* if username is bad start building the error message */ $error_message .= "You must enter a valid company name<br>"; $error_message .= "Valid names are min 5 characters and use letters, numbers and underscores only.<br>"; $error_message .="Your invalid company name was: <font color=\"red\">" . $_POST['company_name'] . "</font><hr>"; } /* END validating company_name */ /* =============================================== */ if((!isset($_POST['contact_name'])) || (strlen(trim($_POST['contact_name'])) <5) || (trim($_POST['contact_name']) != preg_replace("/[^a-zA-Z0-9\s\-\'\,\.\_]/", "", trim($_POST['contact_name'])))) { /* if username is bad start building the error message */ $error_message .= "You must enter a valid contact name<br>"; $error_message .= "Valid names are min 5 characters and use letters, numbers and underscores only.<br>"; $error_message .= "Your invalid contact name was: <font color=\"red\">" . $_POST['contact_name'] . "</font><hr>"; } /* END validating contact_name */ /* =============================================== */ if((!isset($_POST['phone'])) || (strlen(trim($_POST['phone'])) <5) || (trim($_POST['phone']) != preg_replace("/[^0-9\s\-\_]/", "", trim($_POST['phone'])))) { /* if it is NOT set, then set the error variable and start building the error message */ $error_message .= "You must enter a valid phone<br>"; $error_message .= "Valid phones are min 5 characters and use letters, numbers and underscores only.<br>"; $error_message .= "Your invalid phone was: <font color=\"red\">" . $_POST['phone'] . "</font><hr>"; }else{ $phone = trim($_POST['phone']); } /* END validating phone */ /* =============================================== */ /* =============================================== */ /* validating the email */ /* create a function */ function validateEmailAddress($email) { return filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match('/@.+\./', $email); } if(!isset($_POST['email']) || validateEmailAddress($_POST['email']) !=1) { $error_message .= "You must enter a valid email address<br>"; $error_message .= "The invalid email was: <font color=\"red\">" . $_POST['email'] . "</font><hr>"; } /* END validating email */ /* =============================================== */ if((!isset($_POST['street1'])) || (strlen(trim($_POST['street1'])) <5) || (trim($_POST['street1']) != preg_replace("/[^a-zA-Z0-9\s\-\'\,\.\_]/", "", trim($_POST['street1'])))) { /* if username is bad start building the error message */ $error_message .= "You must enter a valid address<br>"; $error_message .= "Your invalid name was: <font color=\"red\">" . $_POST['street1'] . "</font><hr>"; } /* END validating street1 */ /* =============================================== */ /* if((!isset($_POST['street2'])) || (strlen(trim($_POST['street2'])) <5) || (trim($_POST['street2']) != preg_replace("/[^a-zA-Z0-9\s\-\'\,\.\_]/", "", trim($_POST['street2'])))) { */ /* if username is bad start building the error message */ /* $error_message = "You must enter a valid address<br>"; $error_message = $error_message . 'Your invalid name was: <font color="red">' . $_POST['street2'] . "</font><hr>"; } */ /* END validating street2 */ /* =============================================== */ if((!isset($_POST['premiumuser_description'])) || (strlen(trim($_POST['premiumuser_description'])) <5) || (trim($_POST['premiumuser_description']) != preg_replace("/[^a-zA-Z0-9\s\-\'\,\.\_]/", "", trim($_POST['premiumuser_description'])))) { /* if username is bad start building the error message */ $error_message .= "You must enter a Please add a Company Description<br>"; $error_message .= "Your invalid Please add a Company Description was: <font color=\"red\">" . $_POST['premiumuser_description'] . "</font><hr>"; } /* END validating premiumuser_description */ /* =============================================== * /* =============================================== */ /* this section of code will set up an error message for the username if ANY of the conditions occur 1) checks to see if $_POST['username'] is NOT set 2) if length of username is less than 5 3) if username has anything other than letter, numbers or underscores */ if((!isset($_POST['username'])) || (strlen(trim($_POST['username'])) <5) || (trim($_POST['username']) != preg_replace("/[^a-zA-Z0-9\_]/", "", trim($_POST['username'])))) { /* if username is bad start building the error message */ $error_message .= "You must enter a valid username<br>"; $error_message .= "Valid usernames are min 5 characters and use letters, numbers and underscores only.<br>"; $error_message .= "Your invalid name was: <font color=\"red\">" . $_POST['username'] . "</font><hr>"; } /* END validating username */ /* =============================================== */ /* =============================================== */ /* this section of code will set up an error message for the password if ANY of the conditions occur 1) checks to see if $_POST['upassword'] is NOT set 2) if length of upassword is less than 5 3) if upassword has anything other than letter, numbers or underscores */ if((!isset($_POST['password'])) || (strlen(trim($_POST['password'])) <5) || (trim($_POST['password']) != preg_replace("/[^a-zA-Z0-9\_]/", "", trim($_POST['password'])))) { /* if it is NOT set, then set the error variable and start building the error message */ $error_message .= "You must enter a valid password<br>"; $error_message .= "Valid passwords are min 5 characters and use letters, numbers and underscores only.<br>"; $error_message .= "Your invalid password was: <font color=\"red\">" . $_POST['password'] . "</font><hr>"; }else{ $password = trim($_POST['password']); } /* END validating password */ /* =============================================== */ /* =============================================== */ /* check to see if username is already taken */ $username = mysql_real_escape_string(trim($_POST['username'])); $query1 = "SELECT username from companies WHERE username = '$username'"; $result1 = mysql_query($query1) or die(mysql_error()); $count = mysql_num_rows($result1); if($count>0) { $error_message .= "The username: <font color=\"red\">" . $_POST['username'] . "</font> is taken.<hr>"; } /* =============================================== */ /* if any of the post variables are invalid */ /* set the session variable and send back to the form page */ /* NOT USED IN THIS EXAMPLE if(strlen(trim($error_message))>0) { $_SESSION['error_message'] =$error_message; // header("Location: register00.php"); // exit(); } */ /* =============================================== */ $uploadDir = 'images/COMPANIES'; /* main picture folder */ $max_height = 450; /* largest height you allowed; 0 means any */ $max_width = 450; /* largest width you allowed; 0 means any */ $max_file = 2000000; /* set the max file size in bytes */ $image_overwrite = 1; /* 0 means overwite; 1 means new name */ /* add or delete allowed image types */ $allowed_type01 = array( "image/gif", "image/pjpeg", "image/jpeg", "image/png", "image/x-png", "image/jpg"); $do_thumb = 1; /* 1 make thumbnails; 0 means do NOT make */ $thumbDir = "/images/thumbs"; /* thumbnail folder */ $thumb_prefix = ""; /* prefix for thumbnails */ $thumb_width = 90; /* max thumb width */ $thumb_height = 70; // max thumb height //Writes the photo to the server if(move_uploaded_file($_FILES['upload']['tmp_name'], $target)) { /* HERE IS WHERE WE WILL DO THE ACTUAL RESIZING */ /* ============================================== */ /* ============================================== */ /* THESE SIX PARAMETERS MAY BE CHANGED TO SUIT YOUR NEEDS */ $upload = $_FILES['upload']['name']; $o_path ="images/COMPANIES/"; $s_path = "images/thumbs/"; $file = $upload; $save = $file; $t_w = 200; $t_h = 150; /* ============================================== */ /* ============================================== */ /* DO NOT CHANGE THIS NEXT LINE */ Resize_Image($save,$file,$t_w,$t_h,$s_path,$o_path); //Tells you if its all ok /* ============================================== */ /* ============================================== */ /* PROVIDE A WAY FOR THEM TO GO SOMWHERE */ $error_message .= "The file ". $file . " has been uploaded, and your information has been added to the directory"; }else { //Gives and error if its not /* ============================================== */ /* ============================================== */ /* PROVIDE A WAY FOR THEM TO GO SOMWHERE */ $error_message .= "Sorry, there was a problem uploading your file."; } /* =============================================== */ /* PREPARE DATA FOR INSERTION INTO TABLE */ /* FUNCTION TO CREATE SALT */ function createSalt() { $string = md5(uniqid(rand(), true)); return substr($string, 0, 3); } //Writes the information to the database /* ============================================== */ /* ============================================== */ /* ALWAYS WRITE YOUR QUERIES AS STRINGS THAT WAY WHEN TESTING, YOU CAN MAKE SURE THAT THE VALUES CONTAIN WHAT YOU EXPECT */ if(empty($error_message)){ $salt = createsalt(); $password = trim($_POST['password']); $hash = hash('sha256', $salt, $password); $approved = 0; $company_name = mysql_real_escape_string(trim($_POST['company_name'])); $contact_name = mysql_real_escape_string(trim($_POST['contact_name'])); $location = mysql_real_escape_string(trim($_POST['location'])); $postcode = mysql_real_escape_string(trim($_POST['postcode'])); $street1 = mysql_real_escape_string(trim($_POST['street1'])); $street2 = mysql_real_escape_string(trim($_POST['street2'])); $city = mysql_real_escape_string(trim($_POST['city'])); $phone = mysql_real_escape_string(trim($_POST['phone'])); $email = mysql_real_escape_string(trim($_POST['email'])); $premiumuser_description = mysql_real_escape_string(trim($_POST['premiumuser_description'])); $salt = mysql_real_escape_string($salt); $upload = mysql_real_escape_string($upload); $query ="INSERT INTO `companies` (company_name, contact_name, location, postcode, street1, street2, city, phone, email, premiumuser_description, password, salt, approved, upload) VALUES ('$company_name', '$contact_name', '$location', '$postcode', '$street1', '$street2', '$city', '$phone', '$email', '$premiumuser_description', '$password', '$salt', '$approved', '$upload')"; $result = mysql_query($query) or die(mysql_error()); /* =============================================== */ /* at this point we can send an email to the admin as well as the user. DO NOT send the user's password to ANYONE!!!! */ }//if(empty($error_message)) }//if (isset($_POST['submit'])) ?> <html> <body> <?php if (!empty($error_message)){ echo $error_message; } ?> <form enctype="multipart/form-data" method="post" action="register00.php"> <table width="316" border="0"> <tr><td colspan=2><h1>Register/Sign Up</h1></td></tr> <tr><td>Company Name:</td><td> <input name="company_name" type="text" id="company_name" value="<?php if (isset($_POST['company_name'])){ echo $_POST['company_name']; } ?>" /> </td></tr> <tr><td>Contact Name:</td><td> <input name="contact_name" type="text" id="contact_name" value="<?php if (isset($_POST['contact_name'])){ echo $_POST['contact_name']; } ?>" /> </td></tr> <tr><td>Contact Number:</td><td> <input name="phone" type="number" id="phone" value="<?php if (isset($_POST['phone'])){ echo $_POST['phone']; }else{ echo "incl. area code";} ?>" /> </td></tr> <tr><td>Address line 1:</td><td> <input name="street1" type="text" id="street1" value="<?php if (isset($_POST['street1'])){ echo $_POST['street1']; } ?>" /> </td></tr> <tr><td>Address line 2:</td><td> <input name="street2" type="text" id="street2" value="<?php if (isset($_POST['street2'])){ echo $_POST['street2']; } ?>" /> </td></tr> <tr><td>Area:</td><td> <input name="location" type="text" id="location" value="<?php if (isset($_POST['location'])){ echo $_POST['location']; } ?>" /> </td></tr> <tr><td>City:</td><td> <input name="city" type="text" id="city" value="<?php if (isset($_POST['city'])){ echo $_POST['city']; } ?>" /> </td></tr> <tr><td>Postcode:</td><td> <input name="postcode" type="text" id="postcode" value="<?php if (isset($_POST['postcode'])){ echo $_POST['postcode']; } ?>" /> </td></tr> <tr><td>Username:</td><td> <input name="username" type="text" id="username" value="<?php if (isset($_POST['username'])){ echo $_POST['username']; } ?>" /> </td></tr> <tr><td>Password:</td><td> <input name="password" type="password" class="style7" id="password" value="<?php if (isset($_POST['password'])){ echo $_POST['password']; } ?>" /> </td></tr> <tr><td>Email:</td><td> <input name="email" type="text" class="style7" id="email" value="<?php if (isset($_POST['email'])){ echo $_POST['email']; } ?>" /> </td></tr> <tr><td>Company Logo:</td><td> <input name="upload" type="file" class="style7" id="upload"> </td></tr> <tr><td>Company Description:</td><td> <textarea rows="20" cols="50" name="premiumuser_description" id="premiumuser_description"><?php if (isset($_POST['premiumuser_description'])){ echo "{$_POST['premiumuser_description']}"; } ?></textarea> </td></tr> <tr><td> <input name="Submit" type="submit" value="Register" /> </td></tr> </table> </form> </body> </html> Just a note to say that the image DOES upload to the folder(s) /COMPANIES and /thumbs but DOES NOT show up on display of the table? all other information isnt inserted/uploaded... I'm looking for help with the some log-out issues with the PHPmotion script
|