Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Filling In For Deleted Images


I am creating an image gallary where the images are numbered 1, 2, 3 etc. Users will be uploading the images so if i need to delete an image, I need the code to be able to check if that number has been deleted and replace it with the next uploaded image. I have the code pulling from a txt file with a counter to name each file.


The problem is that if images "36", "29" and "2" are removed... I need those slots to replaced in numerical order with the next uploaded images. So the next image will be named image "2" and will show up as the 2nd image on the page. Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Repeated Filling
How do I fill up a form continously and submit it remotely? Meaning, the form info comes in from a dbase using php and gets submited to a remote site. All this happens automatically.

Zero Filling Integer
Is there a way in PHP to zero fill an integer to a specified length?
For instance, if I have a two digit number, and I want to zero fill it
to four digits, is there a PHP function I can use? Or do I manually
have to add zeros to the front?

Filling Variables From SQL
I have a dynamic dropdown menu filled with names of people that posted to the guestbook. When I select a user I want info about that user to show up (ip, when posted...)

if(in("show"))

$id = $_POST['info'];
$action = "SELECT * FROM entried  WHERE id = '$id'";
$result = mysql_query($action);

$name_info = ???
              $ip_info = ??
}

How can I fill in those variables (name_info , ip_info ) with information from SQL (fields are name , ip ...)

Filling Out Forms Through Proxies With Php
i'm connecting to the internet via a proxy, and am having problems
filling out forms... below is the code i have, and below that is the
http request i am trying to make it look like. they look the same to
me, but it isn't working, so i guess they aren't...

$proxy = fsockopen("tcp://someaddresshere", 80, $errno,
$errstr);
$temp = "somethingelse=blablabla";
fputs($proxy,"GET somesite HTTP/1.0");
fputs($proxy,"Accept: */*");
fputs($proxy,"Referer: http://someothersitesite");
fputs($proxy,"Content-Type: application/x-www-form-urlencoded");
fputs($proxy,"Content-Length: " . strlen($temp) . "");
fputs($proxy,$temp . "");
while (!feof($proxy))
print fgets($proxy);
fclose($proxy);

with that script, i don't get anything. however, with this http
request, from opera 7.10, i do:

POST http://somesite HTTP/1.0
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera
7.10 [en]
Host: somesite
Accept: text/html, image/png, image/jpeg, image/gif, image/x-xbitmap,
*/*;q=0.1
Accept-Language: en;q=1.0
Accept-Charset: windows-1252, utf-8, utf-16, iso-8859-1;q=0.6, *;q=0.1
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
Referer: http://someothersite
Proxy-Connection: close
Content-type: application/x-www-form-urlencoded
Content-length: xx

somethingelse=blablablaHTTP/1.1 200 OK
Via: 1.1 DELTANS
Connection: close
Content-Type: text/html
Date: Fri, 20 Jun 2003 17:54:37 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12
OpenSSL/0.9.6b DAV/1.0.2 PHP/4.1.2 mod_perl/1.26
X-Powered-By: PHP/4.1.2
Set-Cookie: PHPSESSID=6c6baebea48c1ee4ad562d7fef3a46a4; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Set-Cookie: something
Set-Cookie: something

now the last part of the http request isn't a request persay, but
whatever,....

Form Filling PDF Template
I realise there is a lot written on this subject, but as a newcomer I'm
not having much luck finding a solution to my particular problem.
Grateful for your help!

I need customers to be able to enter information into a form and
receive a non-editable PDF document, by email and/or in the browser,
containing that information (with a specific layout based on a
template) after submitting the data.

I have found numerous libraries like PDFkit etc that might well do
this. I'm not sure if I can install the library onto my host server
though - is it normal to be able to do this?

There's also the Acrobat forms option. However, I need this to be fool
proof. If the client does not currently have Acrobat reader installed
on their computer, would they not be able to view the PDF form, thus
limiting accessibility? I also want to avoid FDF if possible because it
seems that, again, there's the potential for the browser not to open
the file properly, or problems if the client doesn;t already have
Acrobat reader installed.

Filling An Array With A Set Of Values
i know there's a way to fill an array with a predetermined set of values (i.e. 0-999, a-z, etc) but i can't find the right syntax for the task nor find any examples.

Problem Filling An Array
I'm writing code to validate fields in a form before saving to a db. All
the validating functions are in a separate script which is required. All
the validating functions add an error message to an array if the data doesn't
validate. I check if something went wrong with count($theArray).

Here's my code:

Automated Table Filling
Ive put a whole bunch of images into MySql, and am referencing them through PHP. The code is as follows... PHP Code:

Filling MySQL Table From Within PHP
I don't seem to get the following right.

In the following I try to fill a MySQL table named 'mutation'. The first
element is a date but MySQL sees this as 0000-00-00 instead of the
date 2002-11-01. Other problem is the textstring in
$_POST['verklaring1'], in MySQL this stays empty.

<?php
$query = "insert into mutation values (2002-11-01, 1, 4, 1, 4, 10, 330 ,
' $_POST['verklaring1'] ',N,N,N,N)";
mysql_db_query("projects", $query);
?>

Directory Deleted
So far i m using following code for deleting folders and files.But it will
only delete those folders which r empty.I want to delete those folders also
which has some files.pls give me the solution

<?php
error_reporting(0);
include("../connection.php");
$date = date("m/d/Y"); //For finding current current
function dateDiff($dformat, $endDate, $beginDate)
{
$date_parts1=explode($dformat, $beginDate);
$date_parts2=explode($dformat, $endDate);
$start_date=gregoriantojd($date_parts1[0], $date_parts1[1],
$date_parts1[2]);
$end_date=gregoriantojd($date_parts2[0], $date_parts2[1], $date_parts2[2]);
return $end_date - $start_date;
}
?>
....................

Get ID Of Deleted Items
I wonder if there is anything similar to "mysql_insert_id();"
for deleted/updated id's?

If i do a query and DELETE WHERE text_field="",
can i get the id's of the fields that were deleted?

Dynamically Filling Selection Boxes
I was wondering if anyone knows how to fill a selection box with different values depending on a selection made in a nother selection box in the same page. I dont know if what I'm tryin to do can be done or not, at least in PHP. First a quick background:

We have a number of projects running right now, each of which is subdevided into various tasks. Now, I've got two selection boxes. The first contains a list of all current projects. What I want to do is this: when someon selects a project from the first box, I'd like the second box to be filled with a list of the tasks that have been assigned tot hat project.

Filling Form With Database Info
I have a table with 5 fields for a tour business activity list
: (1) id -table key (2) name (3)description (4)picture -text link not
binary(5) country. I would like to create a form that takes all the
activitys an puts it neatly down on site in checkboxes so user can
select activtys.this will be linked to form mail.i would like the
activitys to be seperated by the country they r in?

Filling An Array Depending On A Variable
I want to fill an array with numbers depending on a variable.

On the page for holiday booking, the user gives the date of arrival and the date of departure, now i have written code to determine the number of days the user is staying.

Say this is 5, now i want to fill a variable with the numbers 1,2,3,4,5

If the user stays 3 days the variable should be filled with 1,2,3

I came up with this ....

Session Files Will Not Be Deleted
My problem:

- i dont wan´t to destroy the session
- i want that the session will be deleted by "php" when the gc maxlifetime parameter hits
- i can turn this parameter on what i want - nothing will be deleted!
- in my specail case - i make use of session_save_path - i use my own

Could it be, that "php" doesnt delete session files in own session_save_paths ?

Deleted Php.ini And Cant Produce An Error
I deleted every instance of php.ini on my computer and restarted IIS. I was hoping i could envoke an error so I can figure out which php.ini it was using. But my application runs normally.

Copy() Deleted File?
I use this to upload boxart for games for my site.

Help! Need To Recover Deleted Tables!
Im not sure if Im in the right place here but ..

I am using a unusual combo of PHP MSSQL ODBC and MSAcess on a windows
server 2003 box. All my tables in a database were deleted using the
SQL "DROP TABLE" command. Can these be recovered? And if so, how?

Deleted Record Still Being Counted.
Can anyone see any reason why this query would not return the number of rows containing the correct "EID" "CID" where email address is "cs.com" or "webtv.com".....

for some reason it always returns 1 even if the database is empty. The only other flaw that I see is that I had a record that matched this criteria, then I deleted it from the database, but it still seems to want to count it for some reason. PHP Code:

$_SESSION['data'] Not Being Deleted?
I got a login script that basically does that: checks wether username and password is in a mysql file and then sets the variable loged_in to 1 like that PHP Code:

File Automatically Being Deleted
Whenever index.php or .htaccess are created in a directory, they are automatically deleted. I'm guessing it is some kind of backdoor attack. Setting permissions to read only didn't help.

Does anyone know how to see what is deleting the file? or protect it?

Info Deleted Itself From Database?
I got some info (news system) in a SQL database but after some days it deletes by itself it happened to me once but i thought i didnt remembered that i deleted it but today it happened again...it deleted by itself! lol

I have other tables in the same database so its a table problem...

How can i fix this? Did i miss something at the table configuration?

How To Shortcut Execute Php Script Without Filling Out Form?
There is a website that has two input boxes inside a POST form
that uses the action="rcon.php" here is the code for the form:

<form method=POST action="/rcon.php">
<input size=25 type=text class="sm" name="addr">
<input size=20 type=text class="sm" name="rcon">
<input class="coolbuttonblue" type=submit value="Submit">...

Filling A Text Area With Options From A Select Tag
I read a ACCESS db table and the values from one column i use to fill a select tag (all the code is in a php file inside a iFrame tag): Code:

Efficiently & Safely (re)filling Array From $_POST
I'm using a single script to generate a table with <input>s in each row.
I fill the array with initial values, then write it out to the table
and let the user edit the values. Something like:

$myarray = $array(1, 2, 3, ... 100);
echo 'Enter your changes, then click Submit:'
foreach ($array as $i)
echo '<table tags> <input value="'.$i.'" name="index.'$i.'"> <table
tags>'

When the user clicks Submit, I need to pull the values back into the
array so I can re-display & operate on it. The data is in $_POST, which
is associative and contains stuff other than my array. $_POST contains
something like:

Submit=>submit
someVariable=>someValue
anotherVariable=>anotherValue
index1=>1
index2=>99
index3=>93.2
....
index100=>-3

After doing a quick google search, I tried:

for ($i = 0; $i < count($array); $i++)
{
$name = 'index'.$i;
$array[$i] = $_POST["$name"];
}

It runs, but I get nothing out of $_POST - those key values are unset.

Is my only option to inefficiently iterate through $_POST AND $myarray,
and doing the assignment to the proper element when I find the
corresponding name in $_POST's key?

Can I use the $_POST keys as indexes in a loop? If so, is it *safe* to
do that, and what's the syntax? Something vaguely like:

for ($i = 0, $key = index1; $i < 100 && $key < index100; $i++, $key++)
array[$i] = $_POST[$key];

How Can A Line Be Deleted From A Text File
Since, I cannot seem to delete the last line in a text database using the code below.

What other way can I delete a line from a text file?

I've Deleted Admin Username And Password,
I've deleted my admin username and password which was initially set at test. Now I can't log into my website as the administrator. How do I put Username and Password back so that I can set my own password and username again, log in to my website and edit it. Which file do I have to edit, and where do I re-set the Username and Password?

Updating Id Numbers To Be Consecutive After Deleted Some
I have a list of ip addresses that have accessed my web site and i have check boxes next to them so i can delete whichever ones i want. after i delete them, i want the name_id field to re-autoincrament after the other rows have been deleted. does anyone know how to do this? i know this line can set the autoinc to a new number, but how do i re autoinc the whole table?

Character Deleted And Mail Function
I use the mail function in order to send mail on a LAN Lotus Notes
server (SMTP). I send big html mail with the "MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1" format.
But, in the message, some characters are deleted, one for 10 lines.

After a test, (message with 1234567890), a character is deleted
approximately every 1000 character.
Have you some ideas ? The problem is coming from php or Lotus Notes ?

Script To Access Expired/deleted Domains?
Does anyone know if there is a script available to access expired/deleted domains? If not, does anyone know how do you get access to the daily expired/deleted domains database?

Upload Multiple Images From A Folder At A Time And Watermark The Images
I have a problem with uploading multiple images from a folder at a
time with a single mouse click and water mark the images with text.
Can any body please help me with code and suggestion about this issue?

Stamps/inserts Small Images (logos) Onto Larger Images.
It may be called image stamping or water marking but im not sure. Basically i want a script that prints/stamps a smaller image onto a larger one, the smaller mage being a logo. This will make it harder for people to steal my pictures as they will have my logo on them.

An example of this is with ebay, when you submit a picture of the item your selling ebay will printe a small logo in the bottom right corner of the picture. Could anyone suggest a script for this, just a simple one then i can mess around with it and make it better.

Stamps/inserts Small Images (logos) Onto Larger Images.
It may be called image stamping or water marking but im not sure.
Basically i want a script that prints/stamps a smaller image onto a larger one, the smaller mage being a logo. This will make it harder for people to steal my pictures as they will have my logo on them.

An example of this is with ebay, when you submit a picture of the item your selling ebay will printe a small logo in the bottom right corner of the picture.
Could anyone suggest a script for this, just a simple one then i can mess around with it and make it better.

Reset Row "id's" After Arbitrary Value Deleted
Is there a way to reset the auto_increment value and all subsequent values for that table if you delete an arbitrary row?
example:

row 0 - test info
row 1 - test info
row 2 - test info
row 3 - test info

new auto_increment value = 4

I delete row 2, so table looks like:
row 0 - test info
row 1 - test info
row 3 - test info

the auto_increment is still 4, but there are only 3 rows in the table and the values are not correct. Is there a function or easy way to "reorganize" the row values and reset the auto_increment?

A "few" Old Session Files Never Deleted?
I have session files stored in a special tmp directory specific to a
virtual host instance. The Max_lifetime is long 86400 (1 day) which I
don't suppose is the problem.

Anyway the sessions do indeed expire and "most" of the old session
files disappear as expected.

Not all however. I am finding several old session files with Unix
last mod times weeks in the past.

This behavior observed on PHP 4.2 and 4.3.

Random Images From Google Images
I am trying to set up a page that will show a random image of something on
a web page (e.g. cats) taken from a random Google Image.

I can't find any sample code to do this. Can someone point me to an
example?

Saving Images Using Php And The Images Url
How do I go from having the images URL to putting a copy of the image in a folder or db.

High Resolution Images To Low Resolution Images
Hi,
I wonder is there a way or a function to take a high resolution image
and change it to low resolution ?? I have a directory with a 200
pictures, and want to save them with the same width and height but with
another lower resolution, can I do it automaticly with a script, not
downloading them, changing them with image program and uploading them
again..
Thank you

Help..images!
ack...i know about image generation..but is there a way to have a <img src="image.php"> like thing and have it print the image in the php file, not be a php image, but, one that is take from somewhere else...?

Images
I am making an image administrator. I have the user submit a thumbnail and the full image. I am storing the image file names in a mysql database. When being displayed I want each thumbnail to be displayed in a column and I only want 3 columns per row. So if there is 5 images stored total I would need 2 rows. 3 columns in the first 2 in the second. How do I have PHP automatically do this?

PHP And Images
I posted this elsewhere but got no answer so I thought I would see if anyone
here is smarter. :)

I am creating a image management system and have a few questions, if anyone
could help

1) I read somewhere that storing images in a mysql database as a BLOB
reduces speed and efficiency. Is this true? I don't expect to be serving
many images although they could feasible get up to about 1000. I am instead
opting to just store the filename in the database and use that to grab the
image.

2) Assuming the latter (using just the filename in the database), I have a
question about file storad and dynamic images. Should I create the images
at runtime, including thumbnails, or should I, when the image is first
uploaded, create and save a thumbnail and a web version (maybe a 800 x 600
image) and
discard the high-quality uploaded image? My preview page could generate
anywhere from one to 25 thumbnails so I am a little hesitant to dynamically
create 25 thumbnails on a page; it seems to me that would have a definite
performance problem. However, I am somewhat tempted to do this because I
want the user to have the ability to easily change the thumbnail size and I
don't to have run a script that, everytime they change the thumbnails size,
loops through potentially 1000 images creating new thumbnails.

PHP Images And Gd
I currently run a popular website and need to be able to use PHP in order to produce signatures for each user. I have been learning image manipulation and things from the gd library for PHP - and am able to load images from files and add text .etc

However, my problem is that I need to load two files - for example, background.png and icon.png - and then combine them so they become one image. The background.png will obviously be the base of the image, and then I need the icon.png image to be loaded and placed on top of the background - at a certain position (lets say, at 120,100).

This is the only thing I cannot seem to achieve - I've searched google, I've search through the php.net pages and gd library website, and I've asked on other forums (however nobody seems to want to help me). Code:

Images And PHP
I have a folder full with images, and for security reasons I don't want
anyone to know where the folder is. So, to call images, I know there is
a way to call like a PHP file instead. For example Galley 2 (a
PHP-enabled photo album) safetly tucks away the actual images and in
the image source, it calls for something like
"main.php?g2_view=core.DownloadItem&g2_itemId=12&g2_serialNumber=3".

How do you do that? Do you need to use the database to do this?

Php And Images
I'm writing a module for a Content Management System called 'Site@School'
(siteatschool.sf.net). One of it's requirements is that if any other
software package is used, it must be invisible to the user.

Now I need to resize jpeg and gif images. When I use php extensions like
imagick.so or the gd-lib one, I cannot include them into the module. The
user that installs the module (which can be a school on their ISP's
webspace) must also install the extensions and adapt the sytem's php.ini
file (which is impossible if you don't have root access).

I know recent php versions can be compiled with the --enable-gd option,
but I'm not allowed to make that assumption (maybe an ISP doesn't want it
to enable because of possible security problems for example).

Do you know any solution to this problem? (it should be possible, although
not trivial, to compile and install a package in ones homedirectory)

Pdf Images
I am trying to create a pdf image, but the script that I am using seems to enlarge the image, how can I adjust the script, so that it does not alter the image dimensions. Code:

Php Images ?
How to use imagecreate() function...         

Php Images ?
if i want to create images, what should i do first ? where can i get a good tutorial ? if u can give me a example, i can learn it myself...tq...

PNG Images
Im trying to creat links inside of a imagefilledpolygon but its not working right anyone know how to do this im confused as how to otherwise. Code:

Images
Is there a way to determine where the bottom right corner is of an image through script?

In the script I plan on using, text is placed over an image by entering the x, and y, position of where you want it to go.

For the top left, it would be (0,0), but I'm trying to make it work with a bunch of different images, so manually entering each value is impractical.


Copyright © 2005-08 www.BigResource.com, All rights reserved