Jump to content

TheAntipop

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Everything posted by TheAntipop

  1. Since getting my Associate's degree in Computer Science and finding the job market difficult to crack, I've been trying to build some experience volunteering for web design/development and programming work. I recently finished a site for a not-for-profit organization that has a network of members which are local businesses. They were pleased with the way the site turned out, and the head of the organization brought up a proposal for me to generate some income. Many of the businesses that are members of the site do not have a web presence themselves, but are interested in creating one. The proposal to me was to create 10 different templates for a single informational page for the businesses to choose from with basic info like description, contact info, pricing, etc. They would chose which template they wanted and I would charge a flat rate for the page. I am definitely going to take up this offer, but I am kind of unsure of what to charge for the flat rate. Obviously, creating the templates will take the most time, but once they are done it is just a matter of plugging in the specific company's info. I was thinking somewhere between $25 - $50 for the single page, but I'm not sure if that would be too low. The concept of charging for my work is new to me, so I turn to the forum for an objective perspective. BTW, the web hosting and domains will be taken care of, so that will not be built into my price. Strictly the design and creation of the templates and editing them for each business. Any input would be appreciated.
  2. Well, I'm assuming I was chosen because Java/C++ is not miles away from C# and MySQL is not miles away from SQL Server. I think I would be able to pick up the languages fairly quickly, given that many of the differences are syntactical in nature. Then again, WTF do I know. If they just need someone who isn't retarded, I should do great! (I think ) Wish me luck.
  3. So, I've got my first ever programming related job interview Wednesday. This is a very big deal for me, and I'm nervous as fuck. I recently got my Associates in Computer Science (major: programming) and decided to put my resume out there. I actually was focusing more on an internship, since I have absolutely no experience working in the field. But I got a call today from an HR rep from Advanced Financial Services (it's a locally based financial company specializing in mortgage lending) expressing interest in seeing me for an interview. Their job description specifies C# and SQL Server experience, and exposure to VB.NET, of which I have none. My languages of choice (and what I've been schooled in) are Java, C++, and PHP. I've also worked extensively with MySQL (in conjunction with Java and PHP). All of this was on my resume (no C#, VB.NET or SQL Server was mentioned), but they called me anyway. Of course, C# shouldn't be too hard to get into seeing as how I have experience with both C++ and Java, plus it's all OOP involving generally the same concepts, but I'm wondering how specifically I will be tested. I'm thinking about taking a crash course in C# before the interview, but I'm not sure how much I would retain. Anyway, to anyone who has ever had an interview for a programming job, what can I expect (especially from an entry level position)? I mean, should I be expected to be tested on certain things, to write some sample code on the spot? (I freaking hope not, my mind would probably freeze). I mean, the job only requires a high school education, so I'm thinking it's not exactly going to be rocket science. But I'm still scared to death at the prospect of the interview. Any advice from people with programming job interview experience would be appreciated!
  4. I recently completed my Associates Degree in programming from a local community college. I've been exposed to a few object oriented languages, including C++, Java, Visual Basic, and PHP. The thing that bothers me is that the whole concept of objects seemed kind of glossed over in the curriculum. I mean, I obviously know what they are and how they function, but we hardly used them at all in practice. Of course, I frequently used objects and classes from the API for common procedures. For example, in Java to parse a text field I might use Integer.parseInt( jtextfield.getText() ). Or to create the GUI there was always a whole series of GUI objects instantiated (i.e. randomJTextField = new JTextField() followed by the definition of its properties). But we very rarely created our own classes and objects. Normally, the whole program was written in one class, and we would write methods (or functions) to handle different tasks and call them when needed. As a result, my whole concept of objects is a bit fuzzy. The few times we used them, I found the whole instantiation of objects to be somewhat confusing. Having earned a programming degree without utilizing the Object aspect of Object Oriented Programming (which seems kind of important), I can't help but feel a bit cheated. My current view of objects is that they are not necessary to use, they are just a way of organizing your program and making it easier to re-use code. Is this wrong? Do programming jobs out in the real world place high importance on using objects? I am about to write a resume and start job hunting, but I am kind of concerned about my weakness in this area. Any advice would be appreciated.
  5. Thank you - this revealed the problem! It was indeed a MySQL issue. The error was simply "Unknown MySQL Server host." The PHP file I include that creates the MySQL server connection was pointing to the wrong server address. Problem solved, thanks again.
  6. OK, here is the code. I have removed code irrelevant to my problem (and have commented where this occurs), and I have commented the point at which the problem occurs. <html> <head> <!-- Unrelated CSS/header tags removed --> </head> <body> <center> <img src="antiloss.gif"></center> <table class = "test2" cellspacing ="1" cellpadding=20 border=1 align="center"> <tr><td> <!-- Introduction text removed --> </td></tr> </table> <?php include('mysqltest3.php'); include('ps_pagination.php'); /* The following if statement is not executed when the site is loaded for the first time, and is not relevant to my problem; it is included for context */ if(isset($_GET['subgetrecords']) || isset($_GET['artist'])) { $sql = "SELECT * from losslessaudio where artist_id = (SELECT id from artists where artist = '". $_GET['artist'] . "')"; switch ($_GET['sortby']) { case "ID": $sql = $sql . " order by pk"; break; case "Date": $sql = $sql . " order by date_"; break; case "City": $sql = $sql . " order by city"; break; case "Venue": $sql = $sql . " order by Venue"; break; case "Title": $sql = $sql . " order by Title"; break; case "Format": $sql = $sql . " order by Format"; break; default: $sql = $sql . " order by date_"; } if ($_GET['order'] == 'desc') { $sql = $sql . " DESC"; } $pager = new PS_Pagination($conn,$sql,100,6,$artist); $rs = $pager->paginate(); } /* The problem is occuring in the code that follows. It is supposed to display a table containing a dropdown menu with the list of artists pulled from my database and a submit form, but neither the table nor form are displayed when executed on my PC. Maybe the mixture of PHP and HTML is causing a problem? Like I said, the code runs fine on my Mac. */ ?> <table class = "test3" cellspacing ="1" cellpadding=5 border=1 align="center"> <tr><td> <form action="mainboots.php?#target" method="GET" font size = "10" > <table align="center" border="0" cellspacing="0" cellpadding="3"> <?php $q = "SELECT * FROM artists order by artist"; $result = mysql_query($q, $conn); echo "<span style=\"font-size: 10pt\">"; echo "<tr><td>Select Artist:</td><td><select name='artist'>"; echo "</span>"; while($dbarray = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<option value= \"". $dbarray['artist']. "\""; if ($dbarray['artist'] == str_replace('\\', "", $_GET['artist'])) { echo " selected>" .$dbarray['artist']. "</option>"; } else { echo ">" . $dbarray['artist']. "</option>"; } } echo mysql_error; echo "</td>"; echo "<a name='target'>"; ?> <td align="right"> <input type="hidden" name="subgetrecords" value="1"> <input type="hidden" name="sortby" value="Date"> <input type="hidden" name="order" value="asc"> <input type="submit" value="Submit"></td></tr> </form> </table> </td></tr> </table> <?php /* The rest of the code deals with what happens when the Submit button is clicked, and is not relevant to my current problem, but has been included for context. */ function maketableheader($fields) { for ( $i = 0; $i < sizeof($fields); $i++ ) { echo "<th align='left' bgcolor=palegreen>"; echo "<a href=\"mainboots.php?sortby=". $fields[$i]. "&artist=". $_GET['artist']. "&order=asc"; echo "#target\">"; if ($fields[$i] == 'ID') { echo "ID #"; } else { echo $fields[$i]; } echo "</a>"; if ($_GET['sortby'] == $fields[$i]){ if ($_GET['order'] == "asc") { echo " <a href=\"mainboots.php?sortby=". $fields[$i]. "&artist=". $_GET['artist']. "&order=desc". "#target\"><img src=\"sortdesc.gif\" style=\"margin-bottom: -2px\" title=\"Reverse Sort Order\" border=\"0\"></a>"; } else if ($_GET['order'] == "desc") { echo " <a href=\"mainboots.php?sortby=". $fields[$i]. "&artist=". $_GET['artist']. "&order=asc". "#target\"><img src=\"sortasc.gif\" style=\"margin-bottom: -2px\" title=\"Reverse Sort Order\" border=\"0\"></a>"; } } echo "</th>"; } } if(isset($_GET['artist'])){ echo "<table class = \"test\" cellspacing =\"1\" cellpadding=5 border=1 align=\"center\">"; echo "<tr><td colspan = '7' bgcolor='khaki' align='center'><b>"; echo $pager->renderHeader(); echo "</b></td></tr>"; $fields = array("ID", "Date", "City", "Venue", "Title", "Format"); maketableheader($fields); echo "</tr>"; while($row = mysql_fetch_assoc($rs)) { echo "<tr><td bgcolor=\"white\">"; echo "<a href=\"bootnotes.php?location=".$row['pk']. "&artist=". $_GET['artist']. "\" onclick=\"document.cookie='yscroll'+'='+''+1;\" >". $row['pk']."</a>"; echo "</td><td bgcolor=white>"; echo $row['Date_']; echo "</td><td bgcolor=white>"; echo $row['City']; echo "</td><td bgcolor=white>"; echo $row['Venue']; echo "</td><td bgcolor=white>"; echo $row['Title']; echo "</td><td bgcolor=white>"; echo $row['format']; #echo "</td><td bgcolor=white>"; echo "</td></tr>"; } echo "</table>"; } echo "<br><span style=\"color:white; font-size: 10pt\"><center>&#169; 2008 Antipopular Productions</center></span>"; echo "</body></html>"; ?>
  7. I've been using a MacBook to develop a small web site, running a PHP server locally to test it out. Since I would also like to work on the site on my PC occasionally, I installed the WAMP Server package on the PC to facilitate this. I got the PHP server up and running, and it seems to work fine. However, when I try to run the exact same code that I run on the Mac on the PC, I get a different result... basically, the site is broken on the PC, and I'm not sure why. OS X comes with both Apache and PHP built in. I am using PHP version 5.2.6 on both platforms. However, the Apache version is different on the Mac. It's the Unix flavor version 2.2.9, while the Apache version on my PC is 2.2.2 (there is no 2.2.9 for Windows). I'm not sure if the different version of Apache has anything to with the problem. Also, I am not sure if the PHP settings are exactly the same on the PC and Mac. WAMP has a list of PHP settings that can be checked and unchecked, and I'm wondering if changing some of these would solve the problem. I'm just not sure which ones to change. Here is what the site is supposed to look like: http://mattmasi.com/mainboots.php When I run it from the local server on the Mac, it looks like this, however, when I run the same code from the PC's server, the page stops right after the introduction, and the Select Artist form is not present (which is obviously the most important part of the page). At first I thought it was ignoring everything between the PHP tags entirely, but I put an echo statement between the tags and it displayed it in the browser. I can post the code if needed, but right now I'm just wondering about general differences between running a PHP server on Mac vs. PC and how these might be contributing to my problem. Any help would be appreciated.
  8. Thanks for the reply. I'm trying to display the results on index.php. I did not write any of the code in process.php, it is part of the open source login script I am using. I know that file is not the problem though... For example, if I include the registration form on the home page without using the $location variable (outside of the switch statement), it works. But I don't want it on the home page, I want to load it by itself on the content pane. Here's what it looks like if I include the register form on the home page without using the $location variable or switch statement: http://mattmasi.com/test/index2.php If you fill out the forms and click join it will tell you it registered successfully (or display errors if the formatting is wrong). This tells me that it has something to do with the $location variable and the way I am using it with the forms.
  9. I've uploaded my site-in-progress to show you the problem in action. If you click on Login / Register it will display the forms in the content pane. However, as soon as you click on a submit button (Login or Join) it reloads index.php and I lose the results of the form submission. I know the form is going through, because if I register a username and password it is added to my MySQL databse. I just can't see the results on the web page (which process.php is supposed to handle). Like I said, whenever I click a link on the navigation bar I am specifying "location=" so the $location variable gets a value. But when I submit a form, I have no way of specifying where it will show up (that I know of), which is what is giving me the problem. Anyway, here's the site. Any suggestions are welcome... http://mattmasi.com/test/index.php
  10. Hi all, I am new to PHP and I am having an issue implementing a login script into a site I'm creating. The script is not my own, it was posted on evolt.org here. The site I am coding will have a navigation bar on the left side, and a content window to the right. On the main page (index.php), I am using a variable called $location to determine what page will load in the content pane. The links on the navigation bar specify the contents of $location. For example, the link "index.php?location=login" will set $location to "login" and, using a switch statement, my PHP script executes the appropriate code to display login.php in the content pane. I am using this method to display the login script's input forms for users to login and register. I want the forms and the results (once submitted) to display in my content pane. The problem is, once I click Submit on a form, the results disappear into the ether, and index.php is reloaded. The reason this is happening is, when I click on a navigation link that specifies "location=", I have control over where the contents of the linked file are displayed (the content pane). However, when I click Submit on the form, the form code is executed, but I don't have control over where the results are displayed. I'm wondering if there's a way to tell the form where to display the results. I know that when I click the submit on a form, the input strings are handed off to process.php. From there I am a bit fuzzy about what happens, because frankly the programming is a bit above my level of understanding, especially with the instantiating of classes. Here is the code for index.php: <?php include("include/session.php"); $location=$_GET['location']; if (empty($location)) { $location='index'; } include("header.html"); echo '<br><br>'; echo '<table class="test" cellspacing="0" align="center">'; echo '<tr>'; echo '<td class="head" colspan="2" valign="top">'; echo 'Notre Dame Club of RI/SE Mass'; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td class="nav" valign="top">'; include('navbar.html'); echo '</td>'; echo '<td class="content">'; switch ($location) { case 'index': include ('actualindex.html'); break; case 'sixcs': include ('sixcs.html'); break; case 'officers': include ('officers.html'); break; case 'login': include ('login.html'); break; case 'register': include('register.php'); } echo '</td></tr></table>'; include ('footer.html'); ?> Here is register.php: <?php /** * Register.php * * Displays the registration form if the user needs to sign-up, * or lets the user know, if he's already logged in, that he * can't register another name. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 19, 2004 */ ?> <html> <title>Registration Page</title> <body> <?php /** * The user is already logged in, not allowed to register. */ if($session->logged_in){ echo "<h1>Registered</h1>"; echo "<p>We're sorry <b>$session->username</b>, but you've already registered. " ."<a href=\"main.php\">Main</a>.</p>"; } /** * The user has submitted the registration form and the * results have been processed. */ else if(isset($_SESSION['regsuccess'])){ /* Registration was successful */ if($_SESSION['regsuccess']){ echo "<h1>Registered!</h1>"; echo "<p>Thank you <b>".$_SESSION['reguname']."</b>, your information has been added to the database, " ."you may now <a href=\"main.php\">log in</a>.</p>"; } /* Registration failed */ else{ echo "<h1>Registration Failed</h1>"; echo "<p>We're sorry, but an error has occurred and your registration for the username <b>".$_SESSION['reguname']."</b>, " ."could not be completed.<br>Please try again at a later time.</p>"; } unset($_SESSION['regsuccess']); unset($_SESSION['reguname']); } /** * The user has not filled out the registration form yet. * Below is the page with the sign-up form, the names * of the input fields are important and should not * be changed. */ else{ ?> <h1>Register</h1> <? if($form->num_errors > 0){ echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font></td>"; } ?> <form action="process.php" method="POST"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr> <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr> <tr><td>Email:</td><td><input type="text" name="email" maxlength="50" value="<? echo $form->value("email"); ?>"></td><td><? echo $form->error("email"); ?></td></tr> <tr><td colspan="2" align="right"> <input type="hidden" name="subjoin" value="1"> <input type="submit" value="Join!"></td></tr> <tr><td colspan="2" align="left"><a href="main.php">Back to Main</a></td></tr> </table> </form> <? } ?> And here is process.php: <?php /** * Process.php * * The Process class is meant to simplify the task of processing * user submitted forms, redirecting the user to the correct * pages if errors are found, or if form is successful, either * way. Also handles the logout procedure. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 19, 2004 */ include("include/session.php"); class Process { /* Class constructor */ function Process(){ global $session; /* User submitted login form */ if(isset($_POST['sublogin'])){ $this->procLogin(); } /* User submitted registration form */ else if(isset($_POST['subjoin'])){ $this->procRegister(); } /* User submitted forgot password form */ else if(isset($_POST['subforgot'])){ $this->procForgotPass(); } /* User submitted edit account form */ else if(isset($_POST['subedit'])){ $this->procEditAccount(); } /** * The only other reason user should be directed here * is if he wants to logout, which means user is * logged in currently. */ else if($session->logged_in){ $this->procLogout(); } /** * Should not get here, which means user is viewing this page * by mistake and therefore is redirected. */ else{ header("Location: main.php"); } } /** * procLogin - Processes the user submitted login form, if errors * are found, the user is redirected to correct the information, * if not, the user is effectively logged in to the system. */ function procLogin(){ global $session, $form; /* Login attempt */ $retval = $session->login($_POST['user'], $_POST['pass'], isset($_POST['remember'])); /* Login successful */ if($retval){ header("Location: ".$session->referrer); } /* Login failed */ else{ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: ".$session->referrer); } } /** * procLogout - Simply attempts to log the user out of the system * given that there is no logout form to process. */ function procLogout(){ global $session; $retval = $session->logout(); header("Location: main.php"); } /** * procRegister - Processes the user submitted registration form, * if errors are found, the user is redirected to correct the * information, if not, the user is effectively registered with * the system and an email is (optionally) sent to the newly * created user. */ function procRegister(){ global $session, $form; /* Convert username to all lowercase (by option) */ if(ALL_LOWERCASE){ $_POST['user'] = strtolower($_POST['user']); } /* Registration attempt */ $retval = $session->register($_POST['user'], $_POST['pass'], $_POST['email']); /* Registration Successful */ if($retval == 0){ $_SESSION['reguname'] = $_POST['user']; $_SESSION['regsuccess'] = true; header("Location: ".$session->referrer); } /* Error found with form */ else if($retval == 1){ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: ".$session->referrer); } /* Registration attempt failed */ else if($retval == 2){ $_SESSION['reguname'] = $_POST['user']; $_SESSION['regsuccess'] = false; header("Location: ".$session->referrer); } } /** * procForgotPass - Validates the given username then if * everything is fine, a new password is generated and * emailed to the address the user gave on sign up. */ function procForgotPass(){ global $database, $session, $mailer, $form; /* Username error checking */ $subuser = $_POST['user']; $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "* Username not entered<br>"); } else{ /* Make sure username is in database */ $subuser = stripslashes($subuser); if(strlen($subuser) < 5 || strlen($subuser) > 30 || !eregi("^([0-9a-z])+$", $subuser) || (!$database->usernameTaken($subuser))){ $form->setError($field, "* Username does not exist<br>"); } } /* Errors exist, have user correct them */ if($form->num_errors > 0){ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); } /* Generate new password and email it to user */ else{ /* Generate new password */ $newpass = $session->generateRandStr(; /* Get email of user */ $usrinf = $database->getUserInfo($subuser); $email = $usrinf['email']; /* Attempt to send the email with new password */ if($mailer->sendNewPass($subuser,$email,$newpass)){ /* Email sent, update database */ $database->updateUserField($subuser, "password", md5($newpass)); $_SESSION['forgotpass'] = true; } /* Email failure, do not change password */ else{ $_SESSION['forgotpass'] = false; } } header("Location: ".$session->referrer); } /** * procEditAccount - Attempts to edit the user's account * information, including the password, which must be verified * before a change is made. */ function procEditAccount(){ global $session, $form; /* Account edit attempt */ $retval = $session->editAccount($_POST['curpass'], $_POST['newpass'], $_POST['email']); /* Account edit successful */ if($retval){ $_SESSION['useredit'] = true; header("Location: ".$session->referrer); } /* Error found with form */ else{ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: ".$session->referrer); } } }; /* Initialize process */ $process = new Process; ?> For example, if I click on register in my navigation bar, it loads register.php into the content pane. It displays the forms to input desired username password and email. When I do this and click submit on the form, the forms disappear and index.php is reloaded. I am trying to get the form results to display in the content pane. Any help will be appreciated.
×
×
  • 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.