Everything posted by kieraninnes
-
How do I do this nice wee graphic?
Sorry for the long wait mate, I forgot about this thread. Sure, here's a step by step. I did it out of experience. Here's the steps (rough - so if you feel that something doesn't make sense, reply here or contact me) 1) Create a base background color (something dark) 2) Grab a brush that's about 1/3 the size of the actual canvas and set the 'Hardness' to 0% (by right clicking the canvas and moving the slider). 3) Create a new layer and brush the 'white smoke' by CLICKING not clicking and dragging (giving you better control). Once done, you can lower the opacity of that layer until it looks nice and right. 4) Create another layer, this time making your brush a bit smaller, and click once where you want their to be a 'shine' like in my psd file. Again, lower the opacity/fill until it looks good. 5) Grab the 'Pen' tool, and select 'Paths' (top left of the options bar which appears above the canvas when you select a tool). Also, select the 'exclude overlapping paths' which appears in that options bar (on the right) as well. 6) Create a new layer, and make a shape that looks right, by clicking once to set your anchor, then again where you want the second (this time holding the click down and dragging your mouse to curve the line). Then a third time, again clicking and dragging your mouse to curve it; 7) Now join up the 2 remaining anchors and right click near the path, and select 'fill'. Chose 'color' and select white - then ok it. Repeat 6 and 7 on a new layer for the second shape. 9) Select the layer of the first shape you made, and press the 'mask' button at the bottom of the layers pallet. Then grab the gradient tool and draw a gradient along the arrow below; 10) Rinse and repeat step 9 and do the same for the second shape, but this time make sure that the gradient goes from top left, to bottom right rather than the last step; 11) Now it's just a case of lowering the opacity of the 2 shapes. Hope this made sense mate. If not just give me a buzz and I'll explain anything you don't understand. Innes
-
How do I do this nice wee graphic?
Here made, I just had a quick half a minute stab at it in Photoshop, here's the PSD. Hope it's what you're after. Edit; my PSD didn't upload via the forum, so I've upped it to Rapidshare for you. http://rapidshare.com/files/161610827/HeaderGraphic.psd Regards, Innes
-
Image and Color quality
Photoshop > Ctrl + M is your friend .
-
even spacing along a circular path
Just take the original EU flag image; http://www.euroesprit.org/content/delta2/EU%20Flag.gif and then edit the stars in Photoshop. That way you'll keep the right spacing.
-
Password Protecting A Directory via a Database
Sorry about my wording. I only have it set the way it is because I'm an absoloute noob at php, and the easiest way I seen was to use .htaccess. But I wanted to keep my original login form. Don't worry though, as I've done away with the .htacess, and I'm awaiting Pat24's reply on 'sessions' in php. THanks for the reply and help benwu. =] Kieran
-
Password Protecting A Directory via a Database
Anyone? Kieran
-
Password Protecting A Directory via a Database
I tried setting up 2 login's for even more security, one is the original way, above. Which then redirects to this; http://tools.dynamicdrive.com/password/ which is even more secure. But I want to know how I could incorporate the above link into just 1 login page. Because if I just use the above, I lose the ability for a login page, and you have to login via a pop-up box. But if I could keep my login page, I can write what it is exactly that people are logging into. If that makes sense? Please help =] I basically want to do it the way it's done on the link above, but instead of logging in via a stupid popup box, I want an actual page to fit the rest of the site. Kieran =]
-
Password Protecting A Directory via a Database
I've read all sorts of ways of password protecting a directory on a website. And with Pat24's help a few days ago, I set up my first login form which checked the inputted password with those that were on the database, and if right, forwarded them to a different area of the site. I want that directory of the site (called 'staffarea') to be password protected, and connected to the same database that the login's are stored in (MD5 encrypted). The reason I want to do this is because if I know the full url of the staff area, I can still gain access to it without authentication. Because my login box was just a secure means of redirection. Here's my login form: <form method="post" action="checklogin.php"> <fieldset> <legend>Log In </legend> <p><label for="Username"></label></p> <table width="200" border="0"> <tr> <td>Username:</td> <td><input type="text" name="username" id="username" /></td> </tr> <tr> <td><label for="Password">Password: </label></td> <td><input type="password" name="password" id="password" /></td> </tr> </table> <input type="submit" name="submit" id="submit" value="Log In" class="btn" /> </fieldset> </form> Here's my checklogin.php <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="stafflogin"; // Database name $tbl_name="stafflogin"; // Table name mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $username=$_POST['username']; $password = md5($_POST['password']); $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT location FROM $tbl_name WHERE username='$username' and password= '$password'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ session_register("username"); session_register("password"); session_register("id"); $get_url = "SELECT location FROM $tbl_name WHERE username='$username' and password='$password'"; $url=mysql_query($get_url); $row = mysql_fetch_assoc($url); $max_id=$row['location']; header('Location: '.$max_id); exit; } else { echo "Sorry, you entered the wrong Username or Password, please click <a href='login.html' target='_blank'>here</a> to try and login again."; } ?> So I need help in doing a few things; 1) Creating a way of password protecting a directory of my site. 2) Creating a way of saying to this passworded directory that my 'stafflogin' database contains all possible login's and password's. Here's a screen shot of my database to give you an idea of how I set it up previously with the great help of Pat24: The location is the where the redirection will take the user to. Any help on this would be greatly appreciated, because I'm an absoloute noob at php, being that I've only started learning it 2/3 days ago. Thanks, Kieran
-
Still learning.
It's okay I've got it working. I was looking over my code and noticed some errors and stuff. So here's the working code if anyone wants to steal it; <? $studentname=$_POST['studentname']; $formclass=$_POST['formclass']; $grade=$_POST['grade']; mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("studentgrades") or die(mysql_error()); mysql_query("INSERT INTO `users` VALUES ('$studentname', '$formclass', '$grade')"); Print "The students information has been succesfully added to the database. Click <a href='inputdata.html' target='_blank'>here</a> to go back to where you were previously"; ?>
-
Still learning.
Right, so in the past two days I've learnt how to set up a 'login' box, with md5 encryption. As well as set up databases, and search those databases using a form, and returning the relevant results. Now I'm wanting to learn how to actually INPUT data into a database using a form. For ease I'm gonna use the same database I was 'searching' from in the last topic. Here's what I have so far: FORM: <form action="process.php" method="post"> <table width="308" border="0"> <tr> <td width="125" class="input-student-data-form-titles"><strong>Student Name:</strong></td> <td width="173"><strong> <input type="text" name="studentname" /> </strong></td> </tr> <tr> <td class="input-student-data-form-titles"><strong>Student Form:</strong></td> <td><strong> <input type="text" name = "formclass" /> </strong></td> </tr> <tr> <td height="24" class="input-student-data-form-titles"><strong>Grade:</strong></td> <td><strong> <input type="text" name = "grade" /> </strong></td> </tr> </table> <br /> <strong> <input name="submit" type="submit" value="Submit" /> </strong> </form> Process.php: <? $name=$_POST['studentname']; $email=$_POST['formclass']; $location=$_POST['grade']; mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("studentgrades") or die(mysql_error()); mysql_query("INSERT INTO `users` VALUES ('$student name', '$form class', '$grade')"); Print "The students information has been succesfully added to the database. Click <a href='inputdata.html' target='_blank'>here</a> to go back to where you were previously"; ?> But when I enter anything into the form and hit submit, it tells me that it's been successfully added to the databse, but this is what I see in the database: I wrote; Student name: Joe Bloggs Form Class: 13FLA Grade: B Pressed submit, and went to look in my database and seen these entries; As you can see it just entered; "name" in the 'studentname' column, instead of Joe Bloggs. "form" in the 'formclass' column, instead of 13FLA and NOTHING in the grade. This is the same for anything I input into my form. I have no idea where I've went wrong, but if anyone else can, would you mind giving me a hand? =] Thank you. Kieran
-
Help 'editing' a PHP Search Code
Thanks Pat. It's okay though, I did some trial and error and found; echo "<b>Searched For:</b> " .$find; echo "<b> In: </b>" .$field; worked perfectly. Kieran
-
Help 'editing' a PHP Search Code
Thanks Pat, once again you've taught me so much is such a short space of time. I can't thank you enough. Thank you. Kieran Edit. Just have 2 questions Pat. If I wanted to add more fields to my database, and then essentially my combo box. How would I add them into the php. For example, I add "targetgrade" in the database, then into the combo box as a search option. Do I do this? echo $result['fname']; echo " "; echo $result['lname']; echo "<br>"; echo $result['info']; echo "<br>"; echo "<br>"; echo $result['targetgrade']; echo "<br>"; echo "<br>"; echo "<br>"; I think it would work, I'm just stumped as to how many <br>'s to have after each $result. Also, question 2. At the end it says; echo "<b>Searched For:</b> " .$find; which will say "Searched For: *whatever you entered*. How would I make it so it said: "serached for: *whatever you entered* in *whatever field you chose in the combo box*. Hope this makes sense Pat. Thanks once again for your enormous help. Kieran
-
Help 'editing' a PHP Search Code
Pat, I'm not going to be on the computer till around 10pm tonight, or at the latest tomorrow (I'm getting carpet layed). But, if you could still help me in finding a solution on how to search the other 2 fields, that'd be great. Thanks for all the hard work you've put into helping me. Kieran
-
Help 'editing' a PHP Search Code
Yeah that's not too bad though. Atleast it's actually working. We can try and do the other 2 fields tomorrow. Thanks again Pat, you've been a massive help to me. Kieran
-
Help 'editing' a PHP Search Code
Edit: IT WORKS :D:D:D Second Edit: $data = mysql_query("SELECT studentname, formclass, grade FROM users WHERE `studentname` LIKE '%$find%'"); I did what you said wrong (but when I changed everything to the fields I use it worked . ============================================================ Thanks sooooooo much Pat, you've been absolutely great, without you I'd still be building static webpages.
-
Help 'editing' a PHP Search Code
Thanks Pat I checked it and it says what you wrote. BUT I did make a breakthrough. I forgot to change; echo $result['fname']; echo " "; echo $result['lname']; echo "<br>"; echo $result['info']; echo "<br>"; echo "<br>"; to: echo $result['studentname']; echo " "; echo $result['formclass']; echo "<br>"; echo $result['grade']; echo "<br>"; echo "<br>"; Corrosponding with my table column names. I thought that was it taken care of...evidently not. I got similar error's this time on different lines: 67 & 79 67: while($result = mysql_fetch_array( $data )) And 79: $anymatches=mysql_num_rows($data); Thanks again for the help Pat, you excel yourself all the time . Kieran Edit: here are the errors: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\staffarea\search.php on line 67 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\staffarea\search.php on line 79 Sorry, but we can not find an entry to match your query Searched For: KIERAN INNES
-
Help 'editing' a PHP Search Code
Could it be this actually. It said "make a TABLE called users". So i did, but I did this on my Database called "studentgrades" Will that matter? So basically what I have is this; mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("studentgrades") or die(mysql_error()); Is that right? Or should I rename my Database to users as well? Then Change "studentgrades" above to users. Or will that no make a blind bit of difference. (I'm was wondering because it told me to make a 'users' table, yet i see nowhere in the php code that mentions the "users" table.
-
Help 'editing' a PHP Search Code
Thanks pat, now it searches fine, but the results display errors. For example; I searched my name in "student name"; KIERAN INNES. But I got this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\staffarea\search.php on line 72 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\staffarea\search.php on line 84 Sorry, but we can not find an entry to match your query Searched For: KIERAN INNES Line 72 is: while($result = mysql_fetch_array( $data )) and line 84 is: $anymatches=mysql_num_rows($data); Thanks alot for helping me Pat, you've been great to me over the past 2 days. Kieran
-
Help 'editing' a PHP Search Code
Hey Pat. Nothing came up; asif the search/query wasn't done. Kieran
-
Help 'editing' a PHP Search Code
Thanks for the reply ELITE. Like you I've only started learning PHP and SQL yesterday. And well, I have no idea where I'd put that code haha. Sorry for being a total idiot at it, but I'm learning.
-
Help 'editing' a PHP Search Code
Thanks Pat Theirs no rush for it like; it's only for educational purposes.
-
Help 'editing' a PHP Search Code
Hi again, as you know from my previous topic, I'm a complete noob at PHP. But with Pat24's help (thanks), I've started learning. I was reading this tutorial and tried to change it. (instead of copying it). What the tutorial says is; "create a new page, add this search form, add this bit of php, and your results from your mysql database will show up." But what I was wanting to do is instead of having a 'search' form on a bland, seperate page, I wanted to edit it and have it in an existing simple web page. Here's the tutorial: http://php.about.com/od/phpwithmysql/ss/php_search.htm Here's what I did. BUT IT DIDN'T WORK 1) Created table called 'data' in the database 'studentgrades'. 2) Added the search form into a very (and I mean very very very basic, no images) css/html expandable webpage. 3) Changed: <form name="search" method="post" action="<?=$PHP_SELF?>"> that was in the 'search' form code, to: <form name="search" method="post" action="search.php"> 4) added the php code (you'll see it in the tutorial, into a search.php file. 5) Crossed my fingers, and it didn't work I know one reason it didn't work; I'm a total noob at php and didn't know hot to get it to display the results on the page with the search form, underneath the search form. So if any of you would gladly like to help me (*cough Pat *cough*), I'd really really appreciate it. Thanks , Kieran Edit: Forgot to mention; I want the search.php to display the results on the original page that had the search form on it (It's called searchrecords.html on my test site) If that makes sense.
-
Creating a login.php
Wow thanks Pat, you're a genious. Can you tell me what was wrong with it? Just so I can understand better =] Again, really big thanks for the help, I don't know how I can repay you - you've made PHP become easy.
-
Creating a login.php
Thanks Pat, but I get this error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\checklogin.php on line 25 Wrong Username or Password This is the line in question: $count=mysql_num_rows($result); =] Innes
-
Creating a login.php
Thanks Antom, it does make sense. But I just don't understand HOW to change it. Because I do this: Change: $sql="SELECT location FROM $tbl_name WHERE username='$username' and password='$password' "; $result=mysql_query($sql); to: $sql="SELECT location FROM $tbl_name WHERE username='$username' and password=md5("' . $_POST['password'] . '")'; $result=mysql_query($sql); in line 22 and 23 of the checklogin.php. But I get this error message: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\htdocs\checklogin.php on line 22 And in Dreamweaver all the colours from the code below chages from multiple colours, to just block red, asif the code hasn't been 'closed' (like in html). Help