Jump to content

small php problem


phpmaster11

Recommended Posts

ok, i have been learning php over the last 8-9 months and have really took off with it. I ve been practacing all the time and belive one day i could get a job doing somthing i love. At the moment and doing a bit of freelancing and have just got my first client. He wants a website with a fully automatic login and register feuture. I have tried for about 2 das getting it to work but have had no look with it so far.

 

Its probaly just a small error but i can see whats wrong.. It could jsut be a problem with my browser.

 

<html>

<div id="login box"></div>

 

<?php

echo "My Login Page";</$>

<php>

 

<?$ <Login></Login>

<?$ <Password></Password>

<css>

Blue=login box border$>

Medium Green=Text color$>

Green=background$>

</css>

 

Link to comment
Share on other sites

That code doesn't event represent PHP at all. What are you trying to do?

 

pfft.. i think i know what im talking about  ive been programming in php for over 9 months now..

9monts is nothing. Correct PHP syntax is like

<?php

$var = 'some value';

echo $var;

call_some_function_here();

?>

What you posted is not event close to PHP.

 

?? No, im using i think APPLE or something

What! As in Apple Mac OSX? That is not even PHP thats a computer operating system.

Link to comment
Share on other sites

<html>

<div id="login box"></div>

 

<?php

echo "My Login Page";</$>

<php>

 

<?$ <Login></Login>

<?$ <Password></Password>

<css>

Blue=login box border$>

Medium Green=Text color$>

Green=background$>

</css>

 

 

Closest I can figure...

 


<html>
<div id="login box"></div>

<?php
echo "My Login Page";
?>

<form>
Login <input type="text">
Password <input type="text">
</form

<css>
Blue=login box border$>
Medium Green=Text color$>
Green=background$>
</css>


 

:confused::wtf:

Link to comment
Share on other sites

I really cannot fathom what you're working with. and googling returns nothing on these strange </$> tags... i think you are quite mistaken on some things, good sir.

 

:intoxicated:

 


<?php
include("config.inc.php");
session_start();
if (!isset($_SESSION['user'])){
header("location: login.php");
exit();
}

//filepath
$filename = $_FILES['file']['name'];
$filename = explode(".",$filename);
$fileid = uniqid();
$fileurl = "http://" . $_SERVER['HTTP_HOST'] . "/image.php?loc=" . $fileid . $filename[0] . "." . $filename[1];
$dbfileurl = $fileid . $filename[0] . "." . $filename[1];
$filepath = getcwd() . "/imageup/" . $fileid . $filename[0] . "." . $filename[1];

//file restrictions	
if (
$_FILES['file']['type'] == "image/jpg"
|| $_FILES['file']['type'] == "image/gif"
|| $_FILES['file']['type'] == "image/jpeg"
&& $_FILES['file']['size'] < 1048576
)
{
if($_FILES['file']['error'] > 1)
	{
	exit ("<center>There has been an error uploading your file:" . $_FILES['file']['error'] . "</center><br />");
	}
	elseif (file_exists($filepath))
	{
	echo "<center>A file with this name already exists.</center>";
	}
	else
	{
	echo $dbfileurl;
	$filesize = $_FILES['file']['size']/1000;
	$filesize = number_format($filesize,0);
	move_uploaded_file($_FILES['file']['tmp_name'],$filepath);
	echo "<center>Your file has been succesfully uploaded</center><br />";
	echo "<div class=\"upload_info\" align=\"center\">";
	echo "<center>File uploaded: " . $_FILES['file']['name'] . "<br />";
	echo "File type: " . $_FILES['file']['type'] . "<br />";
	echo "File size: " . $filesize . " KB<br />";
	echo "Storage location: " . "<a href=\"$fileurl\">$fileurl</a>" . "<br />";
	echo "expiry date: ";
	echo "</div>";
	$username = $_SESSION[user][name];
	mysql_query("INSERT INTO `imageup` (url, user) VALUES ('$dbfileurl', '$username')") or die ("could not save file url in db" . mysql_error());
	}

}
else
echo "<center><b>Invalid file</b></center>";




?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.