Everything posted by Anth Winter
-
Line Break
ive made a mini update page before on a site ive worked on, and, without reading through your code this is how i did it. The user has a form to submit in a secure area News title ..and... Content They submit the news title and content which is stored into the mysql database i then retrieve this from the mysql database as below.... <? $query = mysql_query("SELECT * FROM news order by id desc LIMIT 10", $connection); while ($row = mysql_fetch_array($query)) { echo "<h3 class=\"newstitle\">".$row['title']."</h3><p class=\"newspost\"> ".nl2br($row['body'])."</p>"; } // close database connection mysql_close($connection); ?> </div> hope this helps.... basically, when u call the "content" from the mysql database with $row
-
Feedback on my Fashion Store Website please :-)
when i frist went to the site i came away from it not knowing that you had a mens section, when i went back for a second look i found out you did... maybe on the first page you shoud emphasize a mix of products, not jus ladies? good site tho
-
Anyone learning PHP?
Yea, i just foiund out recently also, some servers dont enable short tags so its always best to stick with <?php ?>
-
php variable with 0's
thanks for replies. ElanMans idea has hit the jackpot - thanks again
-
mysql syntax error
i think it maybe the mysql recognising desc as describe you may need to change the name from desc to something mysql does not recognise as a command
-
php variable with 0's
hi all, is there anyway you can get a variable to stay like this... $number = 0001; so that if i was to do... $number++ it would set $number as 0002 at the moment if $number is 0001 and i do $number++ $number then becomes 2, and not 0002 I hope this makes sense and is possible - thanks for anyone who reads
-
Login with sessions - IM STUCK, please help
its ok now, ive found that with the new $_SESSION i needed to start the session on each page. eveything working so far... now to continue with the rest. Thanks for your help guys. appretiated :)
-
Login with sessions - IM STUCK, please help
Thanks elanman, its worked now. although ive had to cancel using the new $_SESSION code as i cant get it to work with that. i think its an issue when i try and see if there is a valid session on the member page, it does not recognise me and it goes back to registration page. on the member page this is at the very top of everything and works with the old session code. im not sure what to change it to with the new session code <?php session_start(); if(!session_is_registered(username)){ header("location:register.php"); } ?>
-
Login with sessions - IM STUCK, please help
Hey, thanks for replys my php version is 5.2.9 so i changed the sessions to what you said, with that i still get error: Warning: Cannot modify header information - headers already sent by (output started at /homepages/12/d265923897/htdocs/digitalwinter/test/login.php:8) in /homepages/12/d265923897/htdocs/digitalwinter/test/login.php on line 38 I think it must have something to do with what php_penguin is saying - as i moved my php into a "logincheck.php" containing only the php and no other tags etc, and had the form action set to "logincheck.php" which worked and redirected me to members.php I would really like everything within login.php so i can set the form action to "self" as i want the message to display on the actual website rather than a blank page with an error. this is my current "login.php" with the above error as i edited it a tad: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Login</title> </head> <body> <?php ob_start(); $dbhost = "localhost"; $dbuser = "x"; $dbpass = "x"; $username = $_POST['username']; $password = $_POST['password']; $connection = mysql_connect($dbhost,$dbuser,$dbpass) or die(mysql_error()); if (isset($connection)) { mysql_select_db("x")or die("cannot select Database"); } if(isset($_POST["submit"])) { $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT * FROM members WHERE username='$username' AND password='$password'"; $result=mysql_query($sql,$connection); $count=mysql_num_rows($result); if($count==1){ $_SESSION['username'] = "username"; $_SESSION['password'] = "password"; header('Location: members.php'); } else { echo "Incorrect username or password.<br />"; }} ob_end_flush(); ?> <h1>Login</h1> <form action="<? echo $php_self ?>" method="post"> <p><label>Username</label> <input type="text" name="username" id="username" /> </p> <p><label>Password</label> <input type="text" name="password" id="password" /> </p> <p> <input type="submit" name="submit" id="submit" value="Submit" /> </p> </form> <br /> <br /> Not a member? <a href="register.php">Register here</a>. </body> </html>
-
Login with sessions - IM STUCK, please help
Hi all, ive been working on this for hours... and hours now, its my first attempt at a login page with sessions. the error im getting is: Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at /homepages/12/d265923897/htdocs/digitalwinter/test/login.php:10) in /homepages/12/d265923897/htdocs/digitalwinter/test/login.php on line 54 Warning: Cannot modify header information - headers already sent by (output started at /homepages/12/d265923897/htdocs/digitalwinter/test/login.php:10) in /homepages/12/d265923897/htdocs/digitalwinter/test/login.php on line 56 here is the code for the page: Line 54 and 56 are near the bottom, i have labeled them <body> <?php $dbhost = "localhost"; $dbuser = "x"; $dbpass = "x"; $username = $_POST['username']; $password = $_POST['password']; $connection = mysql_connect($dbhost,$dbuser,$dbpass) or die(mysql_error()); if (isset($connection)) { mysql_select_db("x")or die("cannot select Database"); } if(isset($_POST["submit"])) { $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT * FROM members WHERE username='$username'"; $result=mysql_query($sql,$connection); $count=mysql_num_rows($result); if($count==0){ echo "Username does not exist.<br /><br />"; } else { $sqltwo="SELECT * FROM members WHERE username='$username' AND password='$password'"; $resulttwo=mysql_query($sqltwo,$connection); $counttwo=mysql_num_rows($resulttwo); if($counttwo==0){ echo "Incorrect password for <b>$username</b>.<br /><br />"; } else { if($count==1 | $counttwo==1){ session_register("username"); ***LINE 54*** session_register("password"); header("location:members.php"); ***LINE 56*** }}}} ?> <form action="<? echo $php_self ?>" method="post"> <p><label>Username</label> <input type="text" name="username" id="username" /> </p> <p><label>Password</label> <input type="text" name="password" id="password" /> </p> <p> <input type="submit" name="submit" id="submit" value="Submit" /> </p> </form> </body> </html>
-
Website review please - Clubber Shots
well thanks char :)
-
Website review please - Clubber Shots
Thanks for the comments guys, i felt clubber shots needed a bit of work and i wanted to gather your comments. so thanks. ive updated the site a little now with your help and hope it looks better About the sales of keyrings and photos, thats just an added extra for anyone wanting to purchase these, its not the main focus
-
Review: Digital Winter
Thanks for all your comments people, i appretiate it rosiesp: I think ive now sorted out the issues within safari, just needed some extra code here and there. thanks and to all the people commenting on the usage of a winter theme - i did have some ideas previously but havnt really played on them... eskymos site is amazing, i do agree. Ill see what i can do without overdoing it. Ill post back once its done. Thanks again all!
-
Antoher review if you please? DJ Producer website
hi everyone. the website im wishing to get feedback on is Graeme Willis - a house DJ and producer website its recently been updated with a whole new layout so would love to hear your comments. Please note that im currently working on a logo to go in the homepage on the front where there is alot of space, to the left of his head. Thanks
-
Website review please - Clubber Shots
Hello to all that read...... up for review is my creation Clubber Shots Its been active for a while now and i would appretiate any feedback about the website. all comments welcome thanks
-
Review: Digital Winter
Hey everyone, i posted this for review a while back now but it has had some chops and changes recently. I was just wondering what you all thought.... Also... i know i have a lack of portfolio... im hoping to find more website work soon so i can expand that section Website : Digital Winter
-
some professional feedback please
I agree in that the navigation tabs should be a better color, try some different ideas, that color isnt really fixing in with the wood grain texture. Also the text on them is to near the bottom of the tab, and leaves a gap at the top, maybe try having them centered vertically within the tab. Your logo moves slighty to the left when going from Home to the rest of the pages For the rest of it... Its a great website and youve done a great job
-
HTML code from MySQL table
thats great, i think i will look into the java and bbcode, very useful info taken in. thanks people.
-
HTML code from MySQL table
Hi, ive created a mysql database for a website i manage so that the person can update the news on the front page they have 2 form boxes, one of them is a <textarea> for the news message. they submit this and its stored in the mysql database what im wanting to know, is if they insert html code within the text area when updating the site. is there anyway i can get my database to recognise this and display it as it should e.g. the textbox contains: "This is the new news and here is a picture <img src="image.jpg" />" This gets submitted into the table and displayed on the main page. But the img code displays the image. Its hard trying to explain but i hope someone understand and can help. ultimatly im wanting to create a button they can use like in a forum post where they can insert images and just put the URL in thanks to anyone in advanced
-
Display text from a textarea as it's written
so you have a textarea box on a page... then when its submitted it displas it below the box?
-
php 4 and php5 problems
ive found what to do to solve it ive inserted this at the top of the page $id = $_GET["id"]; it will do for me lol. thanks for help
-
php 4 and php5 problems
$id is defined by the URL - $loc and $page is set manually at the begining of the page eg for URL "http://www.clubbershots.com/070209.php?id=2" if ($id == 2) { echo "<a href=\"$page.php?id=$next\" title=\"Click for next picture\"><img src=\"$loc/IMG_2325.jpg\" class=\"main\" alt=\"$page-$id\" /></a><br />Picture ID: $page-$id<br /><br />"; } this is set at the top of the <body> <body> <? $page = "070209"; $loc = "archives/2009/070209"; $thumbloc = "archives/2009/070209/thumbs"; ?>
-
php 4 and php5 problems
hi all, i have an echo command that is working in php4 but when i activate php5 it does not work I have created a php photo gallery for my site. all pictures are displayed as thumbnails. then when you click one, it displays large above all the thumbnails. the echo string is if ($id == 1) { echo "<img src=\"$loc/IMG_2235.jpg\" class=\"main\" alt=\"$page-$id\" /></a><br />Picture ID: $page-$id<br /><br />"; } here are the already set functions from teh above string, i have verified the path is correct: $page = "070209"; $loc = "archives/2009/070209"; i just dont understand what i need to do to get it to work in php5..... like i say its fine with php4 thanks for your help and to all that look
-
search help
thats very helpful. thanks pat
-
search help
hi people, i have this form <form action="archive.php" method="post"> <select name="month"> <option disabled="disabled">January</option> <option>Feburary</option> <option>March</option> <option>April</option> <option>May</option> <option>June</option> <option>July</option> <option>August</option> <option>September</option> <option>October</option> <option>November</option> <option>December</option> </select> <p><input type="submit" name="submitsearch" value="Search"></p> </form> what im wanting to know, if possible, is that upon the user's selection: e.g. "April" it will take them to "www.website.com/archive/2009/april.php" e.g. "December" it will take them to "www.website.com/archive/2009/december.php" any help would be kindly appreciated. and thanks in advanced