[PHP/MySQL] simple questions

macromp

the retarded one
#1
i'm completely new to php, but have to use it for a uni project. i've got a few questions about the site i'm making for my dad's business using dreamweaver. the site is www.domesticelectrical.net, and as you can see when it first loads up there's nothing in the content frame, i want the "information" page to load up there at the very start but dont know how to do that.

and i'm also trying to get a login script working, i've been using what i think is a pretty good tutorial here but i'm having a problem with the initial loading of the page. if you click the login button you will see what i mean.

Warning: session_start(): Cannot send session cookie - headers already sent... etc

i read another post on the forum with someone having the same kind of problem, but couldnt figure out what i needed to change (dont like programming, find it hard to grasp) i did add thefollowing bit of php as suggested in an earlier thread but it didnt seem to work.

Code:
<?php
ob_start( 'ob_gzhandler' );
?>
i was thinking that it's trying to check the login before the session was started...but i'm not sure.
any help on the matter would be great. i'm using code from the tutorial website, but if you need to see any other code jsut ask what you need and i will post it here.
 

Khayman

I'm sorry Hal...
Political User
#2
make sure that code is right at the top of ANY other code, not just the middle frame code.

for the default page in the middle set the src property to the information page <iframe src ="whatever.php/html" ..... etc
 

macromp

the retarded one
#3
ok that was stupidly easy, the only thing above it was the link to the css file. thank you for that.

one more thing, the "username" and "password" arent fully 'using' the css file. the text color has changed but the size hasnt. can that be changed somehow?
 

macromp

the retarded one
#6
well that didnt take long did it. i have a problem with the database now, i've been into phpmyadmin and entered a username and password into the table, but when i enter those same values into the login boxes and click login, it says that i'm using the wrong password...which i'm not. i'm not getting any errors anywhere, so i dont know where to start trying to debug it...
 

Khayman

I'm sorry Hal...
Political User
#7
Do you get the message 'Incorrect password, please try again.'? if so then you cannot enter the password and username dirctly into mysql because the script you are using is looking for an encrypted password, and as such it won't work if you just type it in plain text into the database, you have to use their register.php page (or modified obviously).

if you got a different error (somthing like Access denied for user: 'userName' (Using password: passWord) ) then check you enrered the correct mysql username and password in db_connect.php page
 

macromp

the retarded one
#8
yeah it's the 'Incorrect password, please try again.' so i've got to modify it to stop looking for an encrypted password...oh dear. thanks

edit: figured it out, just removed the line with the "md5" bit, whatever that means.
 
Last edited:

macromp

the retarded one
#10
hi, i'm back again, i've got all my file uploads and login working fine, there's just one simple thing i'd like it to do. i want a text box on a page and when someone enters text in and submits it it's displayed on a different page, kind of like a news post...but uber simple. the php version of response.write (asp)...i have no idea what it is but would like to know. anyone?

thanks for all your help khayman btw, much appreciated.
 
Last edited:

Khayman

I'm sorry Hal...
Political User
#11
ok, you need a form on the page, normal html form with a text box and submit
Code:
[B] <form action="whatname.php" method="post">
      <input type="text" name="Fname"><br>
      <input type="submit" value="submit">
</form>[/B]

the action attribute tells it where its going
then on that page you could have something like
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
</head>

<body>
<?
      $firstname= $_POST["Fname"];
      echo "Welcome $firstname to our web page";
?>
</body>
</html>
I hope thats kind of what you were looking for
 

macromp

the retarded one
#12
yeah that's the kind of thing i'm wanting, i've got a page with "edit post" and "view post", "edit post" contains the form with the input that you gave me, and "view post" shows what is posted, after clicking the submit button it takes me straight to the "show schedule page", then if i go back to the page with "view post" there is nothing there, i need to save what is posted onto that "view post" page, so next time i come to that page whatever i posted last will be there. if you understand that.
 

Mainframeguy

Debiant by way of Ubuntu
#13
Correct me if I am wrong, but there is a note of caution here (with POST variables)maybe? Because I remember employing exactly the same technique and finding some folks advising against it (maybe on security grounds? or Maybe a compatibility potential issue?) Just thought I'd chip in, hope useful...
 

macromp

the retarded one
#14
security isnt an issue, it's just being used today in my presentation until i can find a proper replacement. i just need a simple way of posting a note, and being able to view it. i've got everything i need for the project but i decided to try and add this at the last minute, and perhaps i shouldn't have. presentation in 1 hour :p
 

j79zlr

Glaanies script monkey
Political User
#15
Khayman said:
add
Code:
td {
font-family: Verdana;
    font-size: 12px;
}
to the css file
Always include a generic font, you should always have serif or sans-serif in a font declaration:

Code:
td {
font-family: Verdana, sans-serif;
    font-size: 12px;
}
As far as security, you have the variable in double quotes, which is what you want. The difference between POST and GET are the way the variables are sent. Read here -> http://www.faqs.org/docs/gazette/superglobals.html
 

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,971
Messages
673,300
Members
89,016
Latest member
Poseeut