only one
Members-
Posts
437 -
Joined
-
Last visited
Never
Everything posted by only one
-
i used to have a code that did that sort of thing only for users online.... ill see if i can find it
-
my old code... might still have some of my old stuff in it <?php session_start(); echo('Upload image<br><br>'); $path = "uploads/"; if (!isset($HTTP_POST_FILES['userfile'])){ echo " <FORM ENCTYPE=multipart/form-data ACTION=?page=Upload METHOD=POST> <p>The file:<br> <INPUT TYPE=file NAME=userfile style='border: 1px solid #222222; background-color: #111111; color: #888888'> </p> Name: <br><input type=text name=name size=25 style='border: 1px solid #222222; background-color: #111111; color: #888888'> <p> Descritption:<br> <textarea cols=25 name=description style='border: 1px solid #222222; background-color: #111111; color: #888888'></textarea> </p> <p> <INPUT TYPE=submit VALUE=Upload style='border: 1px solid #222222; background-color: #111111; color: #888888'> </p> </FORM> "; }else{ if($name==NULL){ echo "<font color=red>Error!</font>: Please give you image a name<br><FORM ENCTYPE=multipart/form-data ACTION=?page=Upload METHOD=POST> <p>The file:<br> <INPUT TYPE=file NAME=userfile style='border: 1px solid #222222; background-color: #111111; color: #888888'> </p> Name: <br><input type=text name=name size=25 style='border: 1px solid #222222; background-color: #111111; color: #888888'> <p> Descritption:<br> <textarea cols=25' name=description style='border: 1px solid #222222; background-color: #111111; color: #888888'></textarea> </p> <p> <INPUT TYPE=submit VALUE=Upload style='border: 1px solid #222222; background-color: #111111; color: #888888'> </p> </FORM>"; }else{ if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) { if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/png")) { if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "The file already exists, try calling your file a different name.<br>"; }else{ $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path . $HTTP_POST_FILES['userfile']['name']); if (!$res) { echo "upload failed!<br>"; exit; } else { echo "upload sucessful<br><br>"; } echo "File Name: ".$HTTP_POST_FILES['userfile']['name']."<br>"; echo "File Path: <a href=uploads/".$HTTP_POST_FILES['userfile']['name']." TARGET=_BLANK>uploads/".$HTTP_POST_FILES['userfile']['name']."</a><br>"; echo "File Size: ".$HTTP_POST_FILES['userfile']['size']." bytes<br>"; echo "File Type: ".$HTTP_POST_FILES['userfile']['type']."<br>"; echo "<img src=uploads/".$HTTP_POST_FILES['userfile']['name']."><br>"; }}}}} ?>
-
jetje man dat is en helebool troop (sorry voor mijn slechte nederlands)
-
from what i can see thats a pretty long way of doing what your doing... any files you want to get just put them in a sperate folder from your www folder linke pages/ or something, so no one can edit your header to include their page... now what you want to do is your filexists function and include the page $page=$_GET['page']; if (file_exists($filename)) { include("pages/$page.php");} now its a simple matter of adding the next page and minusing the last page $next_page=$page+1; $last_page=$page-1; i dont thin your that stupid not to know how to do that.. now you can do your echos... (place them where you want...) echo "<p>base_url=http:// ."$_SERVER['HTTP_HOST']".</p>\n";
-
depends on your php version...
-
i dont wanna know how old you php version is.. in the new ones you dont need all the ""''
-
if($_POST["action"] == "Upload Image") { unset($imagename); if(!isset($_FILES) && isset($HTTP_POST_FILES)) $_FILES = $HTTP_POST_FILES; if(!isset($_FILES['image_file'])) $error["image_file"] = "An image was not found."; $imagename = basename($_FILES['image_file']['name']); //echo $imagename; if(empty($imagename)) $error["imagename"] = "The name of the image was not found."; if(empty($error)) { $newimage = "uploads/" . $imagename; //echo $newimage; $result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $newimage); if(empty($result)) echo "Profile Pic updated"; }else{ echo "Invalid Filename, Please change its name to your username."; $error["result"] = "There was an error moving the uploaded file."; }} extract of a code i made a long time ago to upload images...
-
obviously theres a problem with the TypeText() function... ive never heard of it before but try this Type_Text() instead
-
[SOLVED] SESSION works on one computer but not another
only one replied to billskipton's topic in PHP Coding Help
id advise using mysql to insert the persons ip and have an auto increaing id for it -
$variable = $row['thefeild'];
-
Need Help With My Login/Log-Out Script?
only one replied to phpQuestioner's topic in PHP Coding Help
use sessions -.- -
Need help setting up cartweaver in dreamweaver - php
only one replied to wtracey's topic in PHP Coding Help
bit of advice, never use dreamweaver for anything but css and html, it never gets anything else the way you want it -
i dont really use php for this sort of stuf much, thats why im a bit puzzled aswell
-
oké nederlands toch.. ik kan en betje ik weet je problem, eerst het file bestaat niet $file = "../nieuwsbrief/archief/newsletter_" . $jaargang . "_" . $editie . ".html"; if (file_exists($file)) { $fp = fopen ($file, "w+"); fwrite($fp, constructBody($jaargang,$editie,$db_lerareninfo)); fclose($fp); }else{ copy($HTTP_POST_FILES['jaargang']['editie'], ../nieuwsbrief/archief/newsletter_ .$HTTP_POST_FILES['jaargang']['editie']); fwrite($fp, constructBody($jaargang,$editie,$db_lerareninfo)); fclose($fp); } ?> ik denk dit werkt, als niet zeg zo
-
ok ive never done this with a pdf before but ill see if i can get something to work... select for your table what you want using mysql... <?php $result = mysql_query(SELECT * FROM your tabel); // you have to edit this $row = mysql_fetch_array($result); $text = $row['text']; $filename = "file.pdf"; //name of file $file=fopen($filename,'w+'); //open file fwrite($file,$_POST[text]); //write to file fclose($file);//close file ?> should work.. i hope :S
-
your silly @ symbols block any errors on that line... $cs = mssql_connect ( 'server\server', 'User', 'timbuktu' ) or die ("Could not connect to database: ".mssql_get_last_message()); mssql_select_db('db',$cs); take me out.. now youll get your error
-
$result = mysql_query("SELECT * from `products` WHERE pID='prodId' ") or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "$prodId"; if($prodMap > 0 || $prodMap!= NULL) $prodPrice = $prodMap; elseif($prodPrice < 10) $prodPrice = $prodPrice + ($prodPrice * .50); elseif($prodPrice >= 10 && $prodPrice < 50) $prodPrice = $prodPrice + ($prodPrice * .25); elseif($prodPrice >= 50 && $prodPrice < 150) $prodPrice = $prodPrice + ($prodPrice * .15); elseif($prodPrice >= 150 && $prodPrice < 400) $prodPrice = $prodPrice + ($prodPrice * .10); elseif($prodPrice >= 400 && $prodPrice < 100) $prodPrice = $prodPrice + ($prodPrice * .06); else $prodPrice = $prodPrice + ($prodPrice * .05); $prodPrice = floor($prodPrice); $prodPrice = $prodPrice + 0.99; $result = mysql_query("UPDATE `products` SET `pPrice`='$prodPrice', `pInStock`='$prodQuant' WHERE `pID`='$prodId' "); } use a while loop not an if...
-
[SOLVED] overwritten VAR - must be something silly
only one replied to pstanbra's topic in PHP Coding Help
in you form action do you have action=page.php?brick=$brick ? -
[SOLVED] overwritten VAR - must be something silly
only one replied to pstanbra's topic in PHP Coding Help
<?php $_GET['brick']; if($brick==NULL){ echo "error"; }else{ echo "$brick"; } ?> that what u want? -
just array all the characters you dont want to let through....
-
if(USER) { return $code_text; }else{ return $adcode; if <<Guest clicks on ad, then << Guest sees $code_text wtf is the point in this first? if(USER) { then if($adcode==NULL){ echo "<a href=link for ad code&adcode=$adcode>"; }else{ echo "your iframe.."
-
Help I'm Capturing spammers IP’s what do I do with them?
only one replied to Nomax5's topic in PHP Coding Help
report them to their webprovider, google it... -
[SOLVED] Problem getting all variables to pass through forms
only one replied to tryingtolearn's topic in PHP Coding Help
<?php global $your variable; ?> that what you wanted? -
your gonna have to make a new table, then insert the person name and the topic id, pretty simple
-
Formatting emails that go to my site members
only one replied to alwaysinit's topic in PHP Coding Help
yea, use html...., put all you stuff in a table with a bg color n stuf...