Solved

Urgent - Help with PHP/ASP Code

Posted on 2004-07-30
19
335 Views
Last Modified: 2012-05-05
Okat this one is going to be complicated i assume. I am a webdesigner, iv been working since 1998 and my sites have amazingly increased alot since then, i now have (finally) photoshop fully under my control. I can complete a full site with design, pages, content and graphics, complete in 3 days (inc while working a 9-5 job).

The only problem i am now getting is all my clients want php login, as of late iv been using Cute news, which is good and is a amazing free script to use. But as im sure you could imagine its about time that i really got to learning the new ideas and methods of doing websites.

What i am looking for is HOW to create login and password panels (not a clue at the moment), then that page will go to the secure area where with forms, you can add news, easy and fast. I really REALLY need to understand this withing if possible the next 2 months as i have a rather large project that would profit amazingly from this.

I know this is a really bitch of a question so i dont expect a full written explanation (but anyone who went into amazing detail would get instantly ALOT MORE points ie. 100, i would do a free romaing thread so u can accept points). I would like something LIKE :

Links to tutorials and guides that are easy to understand and get used to,
Good descriptions of what is needed and where to get it from,
Just a all round explanation and some sort of guide that will get me on the tracks to getting good.

I hope im not asking for too much, thanking you in advance - Reece Warrender
0
Comment
Question by:wo33er
  • 8
  • 2
  • 2
  • +3
19 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 100 total points
ID: 11674534
Unless you are hosting the final product, it's a safe bet to assume that a lot of your clients will be using an Apache web server with PHP. This site from Zend (owners of PHP) has about everything there is to know about PHP user authentication with various backends, including flat files, .htaccess, and full blown databases.
http://www.zend.com/zend/tut/authentication.php

I don't know of any good ASP sites off the top of my head, but this tackles user authentication in ASP.NET.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT03.asp

A word of caution though, user authentication and protected content adds a whole new dimension to a web application and should not added at the last minute or in a rush. Make sure you have a thorough understanding of how it works, how to protect against malicious users, and how to write secure code before you start writing the actual code, and most definitely before you ship the final product.
0
 
LVL 4

Assisted Solution

by:kssaran
kssaran earned 100 total points
ID: 11674538
Well. Reece,

From the look of it, your application is not going to be very simple. Creating Login & password pannels can be done with a simple database usermaster and verifying it against the user's login. When you talk of Secured area, that means you might probably have to buy a Digital Certificate from any one secure certificite issuer like www.verisign.com or somebody and you need to make use of protocal HTTPS instead of HTTP. Time frame can be defined depends on the exact amount of work involved. Is it just only the adding of news, you can definitely finish the whole thing in a month period.

Here are few articles about getting a digital certificate for your secured server
http://www.redhat.com/docs/manuals/linux/RHL-7-Manual/ref-guide/ch-securing.html
https://www.verisign.com/support/site/caReplacement.html

Pls get back for any further queries

Rgds
Sara
0
 
LVL 15

Expert Comment

by:Timbo87
ID: 11674597
One thing I want to clear up. If you want a secure site, as in users submitting credit card information, then yes, you'll need to get a certificate like Sara said, but if you mean secure as in the average Joe not being able to access it and just members, then the links I provided above cover it.
0
 
LVL 4

Expert Comment

by:kssaran
ID: 11674634
Tks 4 adding ur comment Timbo, hmmm, cannot really that itz only for credit card information submission. let us say if the News is highly confidential n they dont want it to be decrypted on the way of itz request, for such scenarios also it is recommended to have a secured site. itz all depends on the clients need. Anyway let Reece decide abt that.

Rgds
Sara
0
 
LVL 3

Assisted Solution

by:swarnajyothirmayi123
swarnajyothirmayi123 earned 100 total points
ID: 11674944
Since you said you are a web designer, most probably are you using Dreamweaver MX 2004. It can be used for programming for designers since it adds all the code for you. It works for php, asp, asp.net.

If you want to learn asp.net it is quite easy, you can download the asp.net quick start tutorials. Before that you have to learn the programming basics for the language you are going to learn.

Basically it is only the syntax you have to become familiar with.
Programming in any language will use datatypes(string, integer etc whether the variable will store a string or number etc), loops (while, for , if , select case etc), functions and procedures etc. You learn these basics and then start with simple programming like the login page and user registration page. When you complete these you will have basic understanding of how dynamic sites work. Also in your way you will learn to use database queries to query the database for inserting, updating and deleting data. Sql queries are quite easy for simple work and these queries are like pure english where u can understand by looking at the query what is being done.
eg.
select username, password from users where username='swarna' and password='08067977';
update users set password='2334343' where username='swarna';
etc

And for tutorials, just google for the tutorials you want to learn .(ASP tutorials, PHP tutorials etc)

I think you said you want secure site, are u telling that u will be using a login page by giving your username and password and then you go to the admin page and then you can access the add news content page. If that is your requirement, you can have the usernames and encrypted passwords in database just query the database if the username and password or correct and then allow the user to enter data.

Thanks
Swarna Jyothirmayi Pemmaraju  
0
 

Author Comment

by:wo33er
ID: 11676310
All i can say is WOW at the responce, well done !. Also im sure iv explained wrong above, security is a issue but i dont really need dedicated security from third parties (ie. no credit card details etc of important).

Instead of the pass and login what i am MORE interested in is how to create forms on a page, where i fill it in. Click 'SUBMIT' and it will then use whatever i wrote in the simple form, and display it on my website in the style that i desire.

The same way that say PHP NUKE and CUTE NEWS works, my personal site is : www.wo33er.com : its not a large site, just for small buissness matters and portfolio.

I found the following link from this site : http://www.w3schools.com/ : which may have what i need, im going to look right away.

If anyone can describe what is needed for a simple :

* Page with a form on it,
* User fills in the form and submits,
* The info wrote in the form is displayed on the say.. news page for example in the desired style wanted (the style of the site obviously).

To learn how to do dynamic php forms which add data into a desired sytle has been a dream of mine for a very long time, and now with summer, i have the time needed to get learning. Any help to get me going would be amazing. Maybe i think im imagining that the whole situation above works alot more complicated than i imagined :(.

THANKS FOR UR HELP SO FAR ! :D - Reece
0
 

Author Comment

by:wo33er
ID: 11676346
http://www.w3schools.com/php/php_intro.asp - This looks like SPOT ON what i want to learn to be honest.
0
 

Author Comment

by:wo33er
ID: 11676377
P.S Im new :). Qbasic and Vbasic V begginer is all i know coding whise, i specialise in the design area usually, i would love to be adapt at both.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:wo33er
ID: 11677124
After reading about a bit i think what i need is SQL/MySQL update with php ONLY being a way to show it and lay it out, not acutally perform it. Which is new to me.
0
 

Author Comment

by:wo33er
ID: 11683313
Ok, its gone quiet :(. But here is what i have done so far :::

<?php
$conn=odbc_connect('Base','','');
$sql="SELECT * FROM Test";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{ exit("Error in SQL");
}
echo "<table width=500 border=0 cellpadding=0 cellspacing=0 align=center>";
echo "<tr><td colspan=4><img src=images/newsbg/news_01.gif></td></tr>";
echo "<tr>";
echo "<td background=images/newsbg/news_02.jpg width=5>&nbsp;</td>";
echo "<td background=images/newsbg/news_03.jpg>Title Name</td>";
echo "<td background=images/newsbg/news_03.jpg>User</td>";
echo "<td background=images/newsbg/news_04.jpg width=5></td>";
echo "</tr>";
while (odbc_fetch_row($rs))
{
$title=odbc_result($rs,"Title");
$user=odbc_result($rs,"User");
$news1=odbc_result($rs,"News1");
echo "<tr>";
echo "<td background=images/newsbg/news_02.jpg width=5>&nbsp;</td>";
echo "<td background=images/newsbg/news_03.jpg>$title</td>";
echo "<td background=images/newsbg/news_03.jpg>$user</td>";
echo "<td background=images/newsbg/news_04.jpg width=5>&nbsp;</td>";
echo "</tr>";
}
echo "<tr>";
echo "<td background=images/newsbg/news_02.jpg width=5>&nbsp;</td>";
echo "<td background=images/newsbg/news_03.jpg colspan=2><br>$news1</td>";
echo "<td background=images/newsbg/news_04.jpg width=5>&nbsp;</td>";
echo "</tr>";
echo "<tr><td colspan=4><img src=images/newsbg/news_05.gif></td></tr>";
echo "</table>";

?>

Its working great :D !. Which im glad, But now i have the biggest problem, :(.

* How do i make it, so that i can ADD to the database from a form page :|.
* How do i make it so after i added, it goes from 'NEWEST FIRST'
* How do i loop the above code so that it will search 'IF NEXT ROW = "" THEN END' sort of idea.

Thanking You In Advance - Reece Warrender
0
 

Author Comment

by:wo33er
ID: 11683376
Well now im totally lost, i cant understand or work out how to loop so only one row is select and i cant work out even how just to select one row. Maybe i should or started with mySQL, or maybe the difference does not matter. Please help soon :(
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 11685876
You can use a "where" clause in your sql to limit what rows are retrieved into the record set.
http://www.w3schools.com/sql/sql_where.asp
0
 

Author Comment

by:wo33er
ID: 11687604
True, but how :|. I could do it with something like :

SELECT * FROM Test WHERE ID=1

and have in the table this :

ID    NAME                      Date     Description
1     Reece Warremder    Blah      Blah Blah

---

That way it would find the #1 and post that. Thats good, and i will use that for now BUT. I want to be able to ADD from a form on a webpage, without opening the database manually. So how would i get it to work then, as i also want the newest entery to be added first...

something like if statment with a string i assume, i really dont have much of a idea how i will get around this problem, any clues ???.
0
 
LVL 15

Assisted Solution

by:joeposter649
joeposter649 earned 100 total points
ID: 11688556

SELECT id,name,description, max(date)
FROM Test
WHERE ID=1
group by id,name
0
 

Author Comment

by:wo33er
ID: 11691370
Ok i have fixed that problem, i have it all working, now all i need is how to ADD to the database. Anyone ??.
0
 
LVL 2

Assisted Solution

by:DMcLamb
DMcLamb earned 100 total points
ID: 11711078
mysql_query("INSERT INTO table (fieldname1, fieldname2, fieldname3) VALUES ('$fieldvalue1', '$fieldvalue2', '$fieldvalue')");
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now