-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
[SOLVED] get confused with uploaded file
MadTechie replied to robert_gsfame's topic in PHP Coding Help
OMG.. you really need to re-think that code! also use code tags! Oh and you should have 3 for jpegs image/jpg image/jpeg image/pjpeg -
True, order by timestamp would be idea, but autonumber maybe fine So add ORDER BY `timestamp` DESC ORDER BY `ID` DESC before the limit
-
assuming you have less than 100020 records, this will work, DELETE FROM `table` LIMIT 20 , 100000
-
[SOLVED] get confused with uploaded file
MadTechie replied to robert_gsfame's topic in PHP Coding Help
You seam to have code missing, ie $find=mysql_fetch_array(' if ( this is probably the route I would take <?php require_once ('config.php'); //Check if file exists in database $query = mysql_query("SELECT * FROM table"); $find = mysql_fetch_array($query); if (! empty($find['upload'])) { echo $find['upload']; echo "<td><font face=arial size=2><a href=page2.php>delete</a></font></td>"; } elseif(!empty($_FILES)){//Check file has been sent $limit_size = 10000; $filesize1 = $_FILES['file']['size']; $filetype1 = $_FILES['type']['type']; $filename1 = $_FILES['file']['name']; //Check up load details if (($filesize1 >= $limit_size) || ($filetype1 != 'image/jpeg') || (file_exists("upload/" . $filename1))) { echo "Max 10 Kb in JPG format and must not exists yet"; } else { //Moved Accepted upload to folder $path1 = "upload/" . $filename1; if (copy($_FILES['file']['tmp_name'], $path1)) { //Display filename echo "File Name :" . $_FILES['file']['name'] . "<BR/>"; } else { echo "<font face=arial size=2>Failed to upload!</font>"; } } }else{ echo "<font face=arial size=2>No image uploaded yet!</font>"; } ?> -
Without seeing any code anything is going to be guess work, if its the resize script then its likely to be a timeout or memory, you can probably remove that possibility but asking the client to upload a file, that you have already uploaded and tested (a very small jpeg), checking the error logs may reveal the problem, or you could even echo a message at different parts ie
-
, I know you know now, but for others change the now() to the field name of your date
-
I'm about to go to bed now, so i'll fing out the code in the morning but a quick how to go to youtube load up a video, and take note of the v= in the URL ie http://www.youtube.com/watch?v=okoPt9WIoDQ $V = okoPt9WIoDQ; Then View Source and find var swfArgs Now on that long line your find "t": after that is the token ie "t": "vjVQa1PpcFMUrnFuKkS6Z9g3DPHo%3D" $Token = vjVQa1PpcFMUrnFuKkS6Z9g3DPHo%3D $V = okoPt9WIoDQ Once you have both of these, add them to the following URL http://www.youtube.com/get_video?video_id=$V&t=$Token so the final URL for the FLV is http://www.youtube.com/get_video?video_id=okoPt9WIoDQ&t=vjVQa1PpcFMUrnFuKkS6Z9g3DPHo%3D Hope that makes sence
-
It really depends on the query, personally i create an alias ie $SQL = "SELECT *, NOW() as theDate FROM table"; $timestamp = $list['theDate']; echo date("d/m/y",$timestamp) but you can also do this $SQL = "SELECT *, DATE_FORMAT(now(),'%e/%m/%y') as theDate FROM table"; echo $list['theDate']
-
if your doing it via PHP then echo date("d/m/y",$timestamp) but for pure SQL then SELECT DATE_FORMAT(now(),'%e/%m/%y') as formatTime Hope that helps
-
Read here session_regenerate_id
-
Okay.. I'm not going to read all of that, the problem is simple.. a field name doesn't exist in the table find the line that is causing the error and change from mysql_error() to $sql.mysql_error() review the line and compare the field names to the ones in the table
-
Garethp's Javascript would only download the current FLV file, if you want to view the actual files then I think they would be stored outside the public access directory and are purely parsed/steamed on request. I have my own version of a "YouTube Ripper", that a wrote purely because a friend asked me to fix one he found, that was badly coded. (I'll have a look for it)
-
What are you trying to do ?
-
try changing include(../sessions.php) to include("include/session.php"); could you give me an idea of the file names and folder, so i know what's where (only the PHP ones)
-
when you login, does the url end with login.php ? it strange but it looks like sub-code.. in anycase okay searching for a function called it maybe misleading, so 1. you need to look for a file that contains code like this $form = new something the code probably include a file with the word form in the name, ie form.class.php check the included file first but your looking for a file that has code like this class something{ the something will be the same as from search 1
-
define
-
same problem really, but use include_once (just incase) <?php include_once("../include/session.php"); //added if($session->logged_in){
-
$_SERVER['SERVER_NAME'] will only give you the domain you probably want $_SERVER["PHP_SELF"], Quick tip add this line of code echo "<!-- This file is:".$_SERVER["PHP_SELF"]." -->"; and load up the first template, and view source and look for 'This file is' copy the text after it, and use that in your statement also remember the $_GET maybe used to pick the page, ie ?page=home, you could use that instead ie if ($_GET['page'] == 'home')
-
Ahh okay.. well this code function procUpdateLevel(){ global $session, $database, $form; shows that $session, $database, $form are being used So i am hoping session.php has all the parts we need okay, is adminprocess.php in the same folder as admin.php (assuming it is) update the top part admin.php from <? /** * Admin.php to <?php include("../include/session.php"); /** * Admin.php and try that
-
okay, now does sessions.php have a lines that says. include "constants.php"; or require"constants.php"; it may also be include_once or require_once, also see if you can find a file that includes "sessions.php" (same idea as above) the reason i ask, is to try to get an idea of what type of setup is used, for example he may of created a file called config.php that includes the above and calls the classes, if you wish, you could upload the files here and i could have a quick look, (you require 10+ posts to upload last time i checked) but you could zip+ mail them if you like
-
<form action="" id="form2"> should be <form action="" method="POST" id="form2">
-
[SOLVED] File Exists On Another Server
MadTechie replied to The Little Guy's topic in PHP Coding Help
Well that's a shame because it works here with that URL. -
First off please use code tags (#) by the looks of things the admin.php shouldn't be access directly as $form, $database and $session are not set, I'm going to take a guess but assume his forgot to include a common.php or functions.php or config.php file if you can find a function called isAdmin() function isAdmin( then you could probably work out the code from their
-
[SOLVED] File Exists On Another Server
MadTechie replied to The Little Guy's topic in PHP Coding Help
Have you tried all the suggestions ? i know at least 1 of them will work -
1. click Privileges 2. click Add a new User 3.1.User name = test 3.2 Host: LocalHost 3.3 Password = pass 3.4 Retype = pass 4. Global privileges tick all in Data & Structure 5. click go Now click the Databases tab Create new database enter name (ie testing) click create Then Create new table on database testing .. i think the tutorial plays form here