legohead6
-
Posts
434 -
Joined
-
Last visited
Never
Posts posted by legohead6
-
-
the thing you have to understand with php is so many things can cause 1 problem, so you may have to do a bit of trial and error to figure things out corbin's first response was one of the more obvious things that may be wrong. but hes not guaranteeing that is the only problem...
PHP takes a lot of Patience and perseverance
-
yes, the best way is to create a session with the username of the user, then on pages that require being logged in you start the page with
if(empty($_SESSION['username'])){ echo "Please Login"; exit(); }
-
i have tried that, i cant get the program to actually start on the computer. i cant make anything start on the localusers computer from a php command... even if i could make a php command that opens notepad i would be happy
tried this
<?php $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run("notepad.exe", 7, false); ?>
and i get
Fatal error: Cannot instantiate non-existent class: com in ******/proxy.php on line 2
-
Well, our school has a firewall, and currently i am just running Putty on my laptop and get around the firewall. this works great, but when my friends want to get in i have to login for them and set it up. what i am wonder is if i can somehow start a SSH connection(to the server the php is running on) with php, and then the user could connect to it in there internet explorer preferences(under proxy settings)
could someone tell me if this is possible? if so point me in the right direction...
-
wow, i just copied the exact code from the other page that works fine to the index, and it still does not work, this is really weird
exact same code on 2 pages, 1 works, the other doesnt
i put an '@' in front of Session start on the index and it works fine now, but who knows the real probelm
-
did that, works great on everypage but the index..
-
tried that. when i remove session start it works, but as soon as i click to another page i loose the session
-
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/matts15/public_html/beta/index.php:1) in /home/matts15/public_html/beta/header.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/matts15/public_html/beta/index.php:1) in /home/matts15/public_html/beta/header.php on line 2
-
Nothing changes with that, funny thing is it is only in the index, i went to one of my other pages(that also includes the header) and it works fine!
-
I have tried moving it, putting it on both pages, etc its not working
-
-
I keep getting the stupid headers already sent, i went through the sticky, and ive tried a ton of things.. i cannot figure out why.
Index.php
<?PHP include "header.php"; echo "<h2>Welcome</h2> <p>Well, i decided that this space earns something better then a white page with links to my other sites, soo here it is! Im not exactly sure how this will turn out, i am also looking for input from others as to what i should put here. Anything is possible!!"; include "footer.php"; ?>
header.php
<?PHP SESSION_START(); $connect=mysql_connect ("localhost", "*****", "********") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("********"); if(empty($_SESSION['user'])){ if(isset($_POST['log'])){ $user2=$_POST['user']; $pass2=$_POST['pass']; $query2 = "SELECT * FROM Members WHERE username='$user2'"; $result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error()); $exist = mysql_num_rows($result2); while($caa = mysql_fetch_row($result2)){ $pass1=$caa[2]; } if($exist = 1){ if($pass1 == "$pass2"){ $_SESSION['user'] = "$user2"; }else{ $login= "<p align=center>Invalid Username/Password<br><form method=POST><table width=100><tr><td colspan=2><h2>Sign In</h2></td></tr><tr><td><b>Username:</b></td><td><input type=text name=user size=10></td></tr><tr><td><b>Password: </b></td><td><input type=password name=pass size=10></td></tr><tr><td><input type=submit name=log value=Login></form></td><td><a href=fpass.php>Forget Your Password?</a></td></tr></table>"; }//end of pass1 }else{ $login= "<p align=center>Invalid Username/Password<br><form method=POST><table><tr><td colspan=2><h2>Sign In</h2></td></tr><tr><td><b>Username:</b></td><td><input type=text name=user size=10></td></tr><tr><td><b>Password: </b></td><td><input type=password name=pass size=10></td></tr><tr><td><input type=submit name=log value=Login></form></td><td><a href=fpass.php>Forget Your Password?</a></td></tr></table>"; }//end of exist }else{ $login= "<form method=POST><table width=100><tr><td colspan=2><h2>Sign In</h2></td></tr><tr><td><b>Username:</b></td><td><input type=text name=user size=10></td></tr><tr><td><b>Password: </b></td><td><input type=password name=pass size=10></td></tr><tr><td><input type=submit name=log value=Login></form></td><td><a href=fpass.php>Forget Your Password?</a></td></tr></table>"; }//end of if login button }else{//if logged in $user=$_SESSION['user']; $login= "<p align=center>Welcome $user!</p>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="#" /> <meta name="keywords" content="#" /> <meta name="author" content="#" /> <link rel="stylesheet" type="text/css" href="http://mattswebpage.com/beta/voodoo.css" media="screen" /> <link rel="stylesheet" type="text/css" href="http://mattswebpage.com/beta/print.css" media="print" /> <link rel="stylesheet" type="text/css" href="http://mattswebpage.com/beta/handheld.css" media="handheld" /> <title>Mattswebpage.com</title> </head> <body> <div class="top"></div> <div class="page_wrap clearfix"> <div class="header"> <div class="header_block"> <div class="logo"><img alt="logo" src="http://mattswebpage.com/beta/img/pc_logo.jpg" /></div> <h1>Mattswebpage.com BETA</h1> What other website do you need? </div> </div> <div class="navbar" id="nav"> <ul> <li><a href="index.php">Home</a></li> <li><a href="about.php">About</a></li> <li><a href="#">Forum</a></li> <li><a href="#">Info</a></li> <li><a href="#">Contact</a></li> </ul> </div> <div class="container clearfix"> <div class="left_column"> <h3>News</h3> <p>Nov 3. New Mattswebpage getting started. Visit beta.mattswebpage.com!</p> </div> <div class="center_column"> <div class="box_right"> <? echo "$login"; ?> </div>
-
My Name is Matt Marwood. I am 16 and have been building websites for 5 years. I am fairly proficient at coding and programming, styling is just not my thing.
Im just looking for a little cash, and if anyone needs some code work done please feel free to contact me at legohead6@shaw.ca, willing to negotiate pricing.
things im good with:
- file managing, merged with database or without(running off the structure of the files on the server)
- online marketplaces
one of my latest code works is http://www.filepile.ca, it is an online file managing site, still under construction. I did all the php and file handling.
-
This may be more javascript, but im hoping someone can help me out. i have a file management site, and currently if you open up a file then it will close when you open another. I would like to fix that. here is the segment of code that i have.
echo "<script> var newwindow; function poptastic(url) { newwindow=window.open(url,'name','height=400,width=400,scrollbars=yes,toolbars=no'); if (window.focus) {newwindow.focus()} } </script>"; $file3 = @str_replace("_"," ", "$file"); echo "<tr><td bgcolor=#B4B4B4><p align=center><a href=\"#\" onClick=\"poptastic('doc.php?f=$doc');\">$file3</p></td><td bgcolor=#B4B4B4>"; echo "<a href=move.php?f=$doc&fo=$folde>Move File</a></td><td bgcolor=#B4B4B4><a href=move.php?f=$doc&d=1>Delete File</a></td><td bgcolor=#B4B4B4><a href=sfile.php?f=$doc>Send File</a></td><td bgcolor=#B4B4B4><a href=doc.php?f=$doc&DD=1>Download</a></td></tr>";
-
take the quotes out, you dont use the quotes with color codes, only with colors
eg <font color=#FFFFFF>
or <font color="Black">
-
Hi, i am just starting to learn about sockets, and have made a simple code, it works great and the google homepage loads, but no pictures are displayed(red x's) and the links arent displayed, the probelm is its trying to link to my website for the pics(EX pic is at google.com/pic.jpg, its trying to find it at example.com/pic.jpg) how could i fix this? i have to set the headers somehow im assuming, but dont know how! could someone please help me out, i am trying to learn sock stuff so please dont just give me a 1000line code without explaning it...
<?php fsockopen ("www.google.com", 80); fwrite($connection, "GET / HTTP/1.1\r\nHOST: www.google.com\r\n\r\n"); while (!feof($connection)) { echo fread($connection,256); } fclose ($connection); ?>
-
i can send mail from mine and declare any random address, great pranking tool!
-
you cannot pull php on a html page...
-
its time to use some common sence, you should be able to figure out alot of these errors on your own, if not then this is too advanced for you skill level
for example
<? } else { echo ?><h2>Must be logged in</h2> <? }
thats around line 29.. it says missing ';' hopefully you can figure out that its saying...
also it would make it alot easier for you if you just use php to echo the html, having the php starting and stoping so much is going to make it challanging.. i would compact down all the html into 1 echo, then use a variable to decide on the error messages, etc, or even another echo, but having all those php start/stops is not very effective...
-
thanks john, fixed.
-
hmm, ill have to pull up firefox again, the code looks abit weird because its got a seperate header and footer pages...... the header page includes the style in it...
ill have to look into rounded stuff, but im really bad with grahpics so bare with me...
-
anything else?
-
ok, well i guess its bulletproof!
-
or just keep trying the page, and it will tell you the line number the error is on.
NEED HELP w/ PHP REGISTRATION PAGE!!
in Applications
Posted
you can make a pretty simple registration page fairly quicky, and its not too difficult, but once you start validating it it can be time consuming and sometimes tricky(making sure emails are formatted correctly/email activation, making sure emails/usernames are not already registered)
here is a code from a relativily simple registration i have. take what you want..