Jump to content

OGirly

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

About OGirly

  • Birthday 08/08/1988

Contact Methods

  • Website URL
    http://www.ogirly.com

Profile Information

  • Gender
    Female

OGirly's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. haha! Machine coding? Totally failed that the first time I took it I had to retake both of my assembly language courses, haha, and I was even specializing in computer engineering (hence my requirement to retake these course lol...sorta important when dealing with device drivers and OS"s ). A CS degree is fine, but sometimes they make you learn a whole lot more than you'll ever use since it's sort of a general degree in :computing theory: for the most part; if your already in the industry why not just learn languages, and build a portfolio? Not to mention, college is ridiculously expensive now a days, but if your thinking about going have you considered a university? CSSFreakie: I know how you feel, without sounding too strange I've literally wished many times to be able to "plug" in knowledge as they do in the matrix lol Anyone can learn anything about computers, it just takes time...lol...wouldn't it be sooo nice if we could skip the 'time' part .
  2. Ha! I will avoid this for sure then. Thanks so much for the advice, it helps! Esp. the manual I may be adding that to my bookmark bar for a few weeks The top down approach makes a whole lot of sense, I know I was having problems before that I think we're caused by jumping in and out of queries and printing data... It's a new structure to get used to. I"m starting to see though, why php has such a huge following; as you learn it, it's really really intuitive to start working with (lol..not of the libary functions have "strange" names ). Thanks all for the kind welcome, I'm really looking forward to getting a better understanding of PhP with your guys help! ~alice
  3. Can I give my two cents? Learn C++ before going back and learning C; you may develop some bad habits or styles with C that may hinder you from really getting the most out of C++. The book they had me read when I was in school (like 2008ish) was "The C++ Programming Language, Third Edition by Bjarne Stroustrup". Pretty decent read, and a really in depth look at C++, it's features, the standard library etc. Although, it sort of assumes you have a basic understanding of programming concepts (OOP, Modular etc), so just be ready to do some outside research if your working through this title. Also, http://www.learncpp.com/ , is a decent web page to really just "get started" etc. with programming; but it's not going to take you all the way to finishing real projects. Learn C++, it's fun and it never hurts to know another language. Any "programming" language will help you with another, just working with the concepts in general (in any language, environment) will help build you into a better programmer. As far as knowing C++ and PhP don't count on them 100% translating lol...I was sooooo used to working in Strong Static env. that when I started PhP I get my variable's mixed up all the time b/c I'm struggling with that for some reason :\, although it probably will be easier to go into a SS environment vs coming into a PhP like one :\. Good luck with it, if you have any questions as your starting out feel free to message Best wishes, ~ alice
  4. yeppers works perfectly here as well! Don't you hate when things work on others machines but not your own, it's like Best wishes, ~ alice
  5. haha thanks! The name was a nickname I picked up in school since I was the only girl in my Comp Theory class, and I'm well sorta super girly (I think it may have annoyed some of them lol). It's stuck though, and I've sorta adopted it as a forums/net/gamertag lol Nice to meet you (btw I must have watched clueless about 100 times when I was younger!! although not sure if that's the origin of your name ).
  6. Hello I guess a little about my background? I'm new to PhP, but I do have a background in C, C++ etc. I have a few certs mostly through school :\ (linux+, microsoft vista lol b/c we all had to get it for school etc), and a BA in computer Science. I've sorta done the quick O'Reilly training as far as any studying of php (learning PhP5, and Programming PhP are the two titles I've read so far :\), as well as working through the php.net manual...so I really do mean I'm NEW to PhP. I'm extremely excited about it though (a friend of mine was like "why don't you know this already?") a few weeks ago, and she let me borrow her books. I"m hooked! I sorta know Ruby, and have a background in Pearl and just never got around to learning this; but php seems like a lot of fun to work with. For some reason I've gotten off to a rough start with it, but after playing around with it I am starting to feel really dumb for not learning this sooner I have some background with MySql as well, but my programming education wasn't really "web" intensive...so forgive me if I make some errors :\ A friend of mine and I are working on a website together as a "learning project" as we both try to get a better grasp of the language so please don't be surprised if you see a few post from me in the next few weeks. Currently a homemaker while my partner is finishing up her school simply because a computer science degree is not usable for much in Ohio compared to San Fran where we are originally from. Moving back in a year though, thank god! So I'm hoping to get a good understanding of PhP before heading back out west. I'm a rambler...if you can't tell...so I try to keep my posts mainly to code bah! or else you'd hear whole my life story lol....22yrs...hmm..that's about it? Just felt like saying hey and giving a quick introduction. Looking forward to getting to know some of you ~alice
  7. hey! I'm from Cali too (currently in Ohio for my partners school blah..but :\) nice to meet you I'm from San Fran; you?
  8. we'll it's working now; so I"m going to assume that the last post has some typeo that I've since caught. Thank you for all your help; you have no idea how helpful you've been! Looking forward to learning this language a bit more seems pretty great! ~alice
  9. Okay, so here's what I have now, pretty much just the changes you recommended; it's making progress. If I redirect to somewhere like google lets say it works just fine, but if I redirect back to the page with a ?vnsufac sent to allow an admin to just accept or reject another user it does not update any of them temporiarily it will stop them from showing, but it will not update them in the database. It will appear that all three have been done, but again...none are. If i have it redirect to somewhere like google. The one that I did does get updated, and it finally will update the last one; but never if I redirect to the ogirly_staff_homepage.php or ogirly_staff_homepage.php?vnsufac=1. Something must be going screwy here...here's the code...again thanks for helping with this. At least it's inputting the data. It's pretty similar to before; just made the clean ups you recommended etc. Still not sure why it's not working when I redirect back to the site though... :\ (Processing form is the second bit of code posted) <?php if(isset($_GET[vnsufac])){ // simply prints the back home button echo "<form action=\"http://localhost/~atharp1122/OGirly_Site/ogirly_staff_homepage.php\" method=\"post\">" ."<input type=\"submit\" value=\"Back to Staff Homepage\" style=\"margin-top:10px;\"></form>"; // perform database query, create arrays for each unverified staff request $UNVSRA = array(); ogirly_db_connect(); $UNVSRA = mysql_query("SELECT username, email, firstname, lastname FROM staffUNAP WHERE verified_email = 1 AND verified_staff = 0"); // print the form per entry while($row = mysql_fetch_assoc($UNVSRA)){ echo '<div class="newVerifyUserContain" >'; echo '<div class="newVerifyUser">'; echo '<form action="http://localhost/~atharp1122/OGirly_Site/process_staff.php" method="post">'; echo 'USERNAME: ' . $row['username']; echo '<input type="hidden" name="usrname" value="' . $row['username'] . '">'; echo '<input type="submit" name="approve" value="approve">'; echo '<input type="submit" name="reject" value="reject">'; echo '</form></div></div>'; }close_connection($ogirly_db_connection); } ?> <?php if(isset($_POST[approve])){ if(isset($_POST['usrname'])){ $usrname = isset($_POST['usrname']) ? (string) $_POST['usrname'] : FALSE; ogirly_db_connect(); $query = "UPDATE staffUNAP SET verified_staff = '1' WHERE username = '{$usrname}'"; mysql_query($query); if(mysql_error()){ echo mysql_error(); close_connection($ogirly_db_connection); } else{ close_connection($ogirly_db_connection); //echo "usrname = " .$usrname; header("location: http://localhost/~atharp1122/OGirly_Site/ogirly_staff_homepage.php?vnsufac"); } } else{ echo "usrname not set";} } else{ echo "no post data sent";} ?>
  10. I tried that and it's still not working; for some reason it will always insert the data except for the last one; even on a different file...grrrr... I have something at the end that's telling me that there are no more users that are unverified after I go through and accept everyone, but when I go to look at the database(and upon reload of the page) the last one that I clicked approve on (regardless of order in the print out it could have been the first, second third etc) will not submit; but it's also not giving me any sql errors at all...what could be happening here?? This is the new file, the processing file: <?php include("constants/ogirly_db_login_constants.php"); ?> <?php if(isset($_POST[approve])){ if(isset($_POST['usrname'])){ $usrname= $_POST['usrname']; ogirly_db_connect(); $query = "UPDATE staffUNAP SET verified_staff = '1' WHERE username = '{$usrname}'"; mysql_query($query); close_connection($ogirly_db_connection); if(mysql_error()){ echo mysql_error(); } else{ header("location: http://localhost/~atharp1122/OGirly_Site/ogirly_staff_homepage.php"); } } } else{ echo "No POST SENT"; } ?> and here is the other file: <?php if(isset($_GET[vnsufac])){ // simply prints the back home button echo "<form action=\"http://localhost/~atharp1122/OGirly_Site/ogirly_staff_homepage.php\" method=\"post\">" ."<input type=\"submit\" value=\"Back to Staff Homepage\" style=\"margin-top:10px;\"></form>"; // perform database query, create arrays for each unverified staff request $UNVSRA = array(); ogirly_db_connect(); $UNVSRA = mysql_query("SELECT username, email, firstname, lastname FROM staffUNAP WHERE verified_email = 1 AND verified_staff = 0"); $request_counter = 0; while($UNVSRA2[$request_counter] = mysql_fetch_assoc($UNVSRA)){ $data[$request_counter] = array('0' => $UNVSRA2[$request_counter][username], '1' => $UNVSRA2[$request_counter][email], '2' => $UNVSRA2[$request_counter][firstname], '3' => $UNVSRA2[$request_counter][lastname], '4' => $request_counter); // print the form per entry print "<div class=\"newVerifyUserContain\" >"; print "<div class=\"newVerifyUser\">"; print "<form action=\"http://localhost/~atharp1122/OGirly_Site/process_staff.php\" method=\"post\">"; print "<ul><li>"; echo "USERNAME: {$data[$request_counter][0]}<li>" ."<li><input type=\"hidden\" name=\"usrname\" value=\"{$data[$request_counter][0]}\"></li>" ."<li><input type=\"submit\" name=\"approve\" value=\"approve\"></li>" ."<li><input type=\"submit\" name=\"reject\" value=\"reject\"></li>"; print "</ul>"; print "</form>"; print "</div>"; print "</div>"; $request_counter++; }close_connection($ogirly_db_connection); } ?> here's the login program that is on the page the data is input into; it has a notification of new staff user requests that appears in the login div, and it keeps track of any unverified requests. It counts down, even disappearing after I click on the last user..but it's not actually updating to the database. This is really holding me back on finishing this last bit of this project..I really have no idea why it's not working I really appriciate your help on this, because I"m totally at a loss at what to do and it's been like three days (four really I tried for a day and a half before contacting the forums) and I still can't figure this out...omg soooo frustrating It seems like what I am trying to do should be SO simple :\ <?php //Staff Login // Check for Logout if(isset($_POST[logout])){ unset($_SESSION[username], $_SESSION[login], $_SESSION[staffLogin], $_SESSION[admin]); } // Check for previous Login if(isset($_SESSION[login]) && $_SESSION[staffLogin] == 1){ if($_SESSION[admin] == 1){ check_unverified_staff(); } else{ check_unverified_staff(); } echo "<form action =\"{$_SERVER[php_SELF]}\" method=\"post\" style=\"padding-top: 60px;\" >"; echo "Logged in as {$_SESSION[username]}<br/>"; echo "<input type=\"submit\" name=\"logout\" value=\"Logout\"></form>"; } // Check for new login elseif(isset($_POST[username])){ if((preg_match("/^\w{4}\w{1,11}\w$/", $_POST[password])) && (preg_match("/^\w{4}\w{1,13}\w$/", $_POST[username]))){ ogirly_db_connect(); $loginQuery = mysql_query("SELECT password, verified_staff, verified_admin FROM staffUNAP WHERE username = '$_POST[username]'"); $loginArray = mysql_fetch_array($loginQuery); close_connection($ogirly_db_connection); if($loginArray[0] == $_POST[password] && $loginArray[1] == 1){ $_SESSION[username] = $_POST[username]; $_SESSION[login] = 1; $_SESSION[staffLogin] = 1; // check to see if admin : if admin, post admin notices if($loginArray[2] == 1){ $_SESSION[admin] = 1; check_unverified_staff(); } //end admin check echo "<form action =\"{$_SERVER[php_SELF]}\" method=\"post\" style=\"padding-top: 60px;\" >"; echo "Logged in as {$_SESSION[username]}<br/>"; echo "<input type=\"submit\" name=\"logout\" value=\"Logout\"></form>"; } else {print_login_form();} } else {print_login_form();} } // First time visit/Default Action/Logout Action else {print_login_form();}
  11. Thank you, I will try that when I get home today. I'm sort of used to working with C++ so I thought PhP would be super easy, I feel like an ass now for thinking so. I seem to also be getting variables messed up etc. as I'm used to a really strict environment, this is quite a bit different. I'll try the two files and see if I can't figure out the problem by splitting it up as you recommended. <?php include("".XXX); ?> to include the new file correct?
  12. if(isset($_POST[approve])){ $usrname = isset($_POST['usrname']) ? (string) $_POST['usrname'] : FALSE; mysql_query("UPDATE staffUNAP SET verified_staff = 1 WHERE username = '$usrname'"); } ^ is what I am using to put it into the database; and yes username is spelled usrname in this case; it is intentional.
  13. hmm...no it's still not inserting the last one to be approved. All of the other ones, I set it to about four test users etc, they all get approved; just not the last one. At first it appears to go away, but it's not set in the database. :\
  14. actually, the above works, up until the last posting. It will update everyone as we go, but for the final person it will not update them...any ideas?
  15. You solved it! Here's how I did it in the end; hopefully someone else can use this too...great help! Thanks again <?php if(isset($_GET[vnsufac])){ // simply prints the back home button echo "<form action=\"http://XXXXXXXXX.php\" method=\"post\">" ."<input type=\"submit\" value=\"Back to Staff Homepage\" style=\"margin-top:10px;\">"; // perform database query, create arrays for each unverified staff request $UNVSRA = array(); XXXXX_db_connect(); $UNVSRA = mysql_query("SELECT username, email, firstname, lastname FROM staffUNAP WHERE verified_email = 1 AND verified_staff = 0"); $request_counter = 1; while($UNVSRA2[$request_counter] = mysql_fetch_assoc($UNVSRA)){ $data[$request_counter] = array('0' => $UNVSRA2[$request_counter][username], '1' => $UNVSRA2[$request_counter][email], '2' => $UNVSRA2[$request_counter][firstname], '3' => $UNVSRA2[$request_counter][lastname], '4' => $request_counter); // print the form per entry print "<div class=\"newVerifyUserContain\" >"; print "<div class=\"newVerifyUser\">"; print "<form action=\"{$_SERVER[php_SELF]}\" method=\"post\">"; print "<ul><li>"; echo "USERNAME: {$data[$request_counter][0]}<li>" ."<li><input type=\"hidden\" name=\"username\" value=\"{$data[$request_counter][0]}\"></li>" ."<li><input type=\"submit\" name=\"approve\" value=\"approve\"></li>" ."<li><input type=\"submit\" name=\"reject\" value=\"reject\"></li>"; print "</ul>"; print "</form>"; print "</div>"; print "</div>"; $request_counter++; }close_connection($XXXXXXXX_db_connection); } if(isset($_POST[approve])){ $username = isset($_POST['username']) ? (string) $_POST['username'] : FALSE; echo $username; } ?>
×
×
  • 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.