Hello there and thanks for the helping hand you are offering. PHP newbie here! So here is my problem:
On my website I have a flash image gallery.The way the gallery works is by uploading pictures in a folder and editing? an xml file.(pics.xml) where it adds the following code when you upload a picture:
Now I have users that upload products they sell on the website or they advertise their business(hotels, jewellers, car resellers,...) So for every "product" they post they upload their pictures to a specific path and I keep their pictures path in a mysql database.
I m trying to work a solution so that everytime a visitors clicks to see a product he gets the flash gallery for that product. This means I have to create/edit the pics.xml file so that it only contains the pictures for that specific post.
So the user open a view_product.php which includes a php file that contains the flash. The flash gets the pictures for the gallery from the pics.xml file.
Any ideas on how to work out this problem?
Edit: I just uploaded the php file that edits the xml file if that is any help. I guess I could edit that file each time a user views a post but i dont think that's a good idea!
Notice from rvalkass:
You need CODE tags around any code you place in a post.
That PHP file works by completely wiping and replacing the XML file each time you upload a new picture. If you only want certain pictures displayed then you need to limit which pictures the function that generates the XML can see. I would recommend creating a folder for each product, and put the images related to that product in its folder.
Then, take out the XML generating part of the upload script and put it in a new page. Make it accept a variable (the product name) each time it is run. Then adjust the path for the folder it is reading from so that it has that variable stuck on the end. This would limit it to only using images for one product. It would also put the XML file in the same folder as the images - so you'd end up with a separate XML file for each product. Then you need to find some way for the Flash gallery to accept a variable from PHP, so it can be told where the XML file is.
Sorry if thats not very clear, feel free to ask if you want it explained better and I'll give it a go
That PHP file works by completely wiping and replacing the XML file each time you upload a new picture. If you only want certain pictures displayed then you need to limit which pictures the function that generates the XML can see. I would recommend creating a folder for each product, and put the images related to that product in its folder.
Then, take out the XML generating part of the upload script and put it in a new page. Make it accept a variable (the product name) each time it is run. Then adjust the path for the folder it is reading from so that it has that variable stuck on the end. This would limit it to only using images for one product. It would also put the XML file in the same folder as the images - so you'd end up with a separate XML file for each product. Then you need to find some way for the Flash gallery to accept a variable from PHP, so it can be told where the XML file is.
Sorry if thats not very clear, feel free to ask if you want it explained better and I'll give it a go
So the XML file is the key here! I had another flash that would accept a php variable but if you clicked the flash it would take you to a different website.
the php file that contains the flash must be in the same folder as the xml file. So if i create a folder for each product, and upload the pictures there, create the xml and add the php(flash) file then it should work and it wouldnt mess things up? I guess working too many hours doesn't help thinking of the obvious. I m gonna try this solution and post my results. In the meantime if anyone has any other solution I d be glad to read and give it a try also!
Well i finally made the files to be created automatically.
So now when i am at english/products/77(prod_id)/gallery.php i get to see the flash movies as it is supposed to be When I try to load the movie in a file in english/offer.php?id=77 the movie loads but it doesnt show the menu, the settings or the images.
Does anyone know why?
This is the code in english/products/77(prod_id)/gallery.php
The movie loads ok, but it is supposed to use the following files and folders: products/77/gallery.swf (which loads) .../77/menu.xml .../77/settings.xml .../77/splash.img ../77/images_folder/ ../77/images_folder/pics.xml ../77/images_folder/images.jpg ../77/images_folder/thumbs/ ../77/images_folder/thumbs/images.jpg
The thing is i want to have a thumbnail for it as well so i can click on the photos i want to see.
The post above has a good flash gallery but its not what i want. It also takes too long to load so i just want something simple clean but gives alot of options at the same time. so far all my gallery does is load external images.. and you press back or forward ..
Is anyone here good at actionscript in flash at all?
What you should know: HTML, PHP basics (executing php scripts) Examples: Using AJAX Using
iframe Download Examples Using this script you can display a random quote/fact every time a
visitor clicks the link. It happens dynamically without reloading the whole page. Useful for keeping
a site fresh and lively. For example, you can have it in "About Me" page of a website which is
rarely updated. All the quotes are stored in a text file separated by a line break. Although I have
included a sample collection, you are free to modify or create your own. Thanks to Davi....
running on Ubuntu 8.04 with an XAMPP - php5.2.5, Apache 2., etc Getting this error when I try to
access an sNews CMS which requires mod_rewrite and is installed locally: QUOTE Apache/2.2.8
(Unix) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8e PHP/5.2.5 mod_apreq2-20051231/2.6.0 mod_perl/2.0.2
Perl/v5.10.0 configured -- resuming normal operations /opt/lampp/htdocs/jim/snews/.htaccess:
RewriteBase: argument is not a valid URL /opt/lampp/htdocs/jim/snews/.htaccess: RewriteBase:
argument is not a valid URL Using this link: http://localhost/jim/snews/snews16_ema....
I did create this topic mainly because I want to know everything about that configuration file. I
will post other replies if I want to know more depending on your experience. Is this code correct
for that file: CODE $host="localhost"; $dbname="XXX"; $dbuser="XXX"; $dbpass="XXX";
$connection=mysql_connect($host, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname)
or die(mysql_error()); ?> Add your suggestions or improve it.....
Well, i was just wondering if something simple and basic could be made (like a small map where you
could move around on, like you click up, and your position moves up and reports it to the
database..etc) with co-ordinates in php . Taking the x-axis and the y-axis into consideration.
Things like maps which online games have such as web-based space games or legacy-game.net. Thanks
for any feedback, ~Aldo....
Hey I want to create a very simple file browser, so that, it reads all the sub-folders which are
places in a directory, and the files inside the sub-folders (It reads only files inside sub-folders
and list them in simply. ) Also, it creates a directory (any name) inside each sub folder. My
Following code reads on the files inside the main directory, it does not read the files inside the
sub-folders.. I appreciate any help. CODE $path = "./"; $dir_handle = @opendir($path) or
die("Unable to open $path"); while ($file = readdir($dir_handle)) { if($file == "." || $fil....
Hello, i'm not sure if this can be done with php or not but what i need is a way to make an php
file that have an html form on it and it will take the info you put in to that form and write it to
an existing php file, for example: if i have the file news.php and the file news_update.php. if you
went to news_update.php you would get an form with a text area for you to write a new addition for
the news.php file and when you hit submit it will add what you typed in the form to the file
news.php. If this is going to be a big code or a hard one to make but some one think....
edit:sorry for the mistake it is php not html and its with not whith my code checking script= CODE
$file = '$CHECK'; if (file_exists($file)) { echo "The file $filename exists"; } else
{ echo "The file $filename does not exist"; } ?> my question is how to check the file whith
html example:on a page a text box is provided and a button the user writes a file name (or website)
the user clicks on the submit button then it checks and show it (with the code above) i got the
code CODE $filename=$_POST ; if (file_exists($filename)) { echo "The....
Is it possible pass flash variables to be processed in PHP language? Example: Enter Login and
password in a flash aplication and this variables (login and password) to be used in PHP?....
Hey fellow coders, I'm having a problem. If you output a im indentifier in php with gd libary.
With this method for example: CODE header("(anti-spam-(anti-spam-(anti-spam-content-type:)))
image/png"); $imgWidth = 50; $imgHeight = 50; $image=imagecreate($imgWidth, $imgHeight);
$colorBlack = imagecolorallocate($image, 0, 0, 0); // first color you define with colorallocate is
also the color of the background of your image imagepng ($image); imagedestroy ($image); // This
gives you a page with a black image of 50x50 pixels. ?> If i look at the source c....
On MediaWiki, the URL of the content is http://YOURWIKI.com/index.php/Blah Is it possible to
create a page or two that doesn't have a file extension? If so, how is it done?....
Can someone please give me a code that I can use to put a login box on my website, that will login a
user into my phpBB Forum? Sort of like Having my phpBB Forum Intergrated with my Website? Thank you
so much if you can! /angel.gif" style="vertical-align:middle" emoid=":angel:" border="0"
alt="angel.gif" /> Ex. ....
I will pay for this. More info on payment on bottom of post. Alright I know just about everything
about CSS and Ruby on Rails I know more then enough to make certain apps, but i have never been good
at PHP. I do know that this script would be fairly short though. Does anyone know how to make this
web photo gallery with PHP only. I don't want MySQL. No need for it. In my root folder I'll
make a gallery folder. Inside of that will be photography, illustrations, personal, etc. Inside of
those is where I want the script. So there wil be a script for each one, but....
I need to add a facility on my customer's website so his clients can send him jobs, typically
5mb - 50mb. I've looked around the web and researched this, and tried a few tests (failed), but
my brain's beginning to hurt. Could someone please tell me the best way to go about this,
please. The site is done in Flash, but I'm sure a link to an html page would be ok if necessary.....
I was really board a few days ago and decided to make a trap17 board status image for my sig
/tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> That is the
current beta. I'm still working on it so that it might display the most recent post or
somthing, i'm not sure. After I finish it ill give out the source code but if you want one
right now you can pm me and ill set one up to get the info on your account ^.^ So I was wondering
how you members liked it? You'll probably think that its a waste of time, but alas as I sai....
This is really simple script. Well at least this part is, but it could be extendable. Only problem
is that it's not really for massive websites with hundread of visitors a day, but rather for
small ones. But it is a good script to figure out how to make a visitor counter script. Anyway
here's the snippet. CODE function getVisits($variable) { $visits = array(); if
($handle = opendir('stats/')) { while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") { array_push($visits, $file); } ....
I am at the moment trying to program my own forum, but i need more then a single category, here is
my source: CODE function cat () { include("functions/functions.php"); echo '
Forum '; global $catid; $db = new db; $db->connect(); $connect =
$db->query("SELECT * FROM eb_forum WHERE catecory = '1'"); # START GET CATEGORYS #
$catz = array(); while ( $cat = mysql_fetch_object( $connect ) ) { /*echo "
{$cat->name} Topics: Replies: ";*/ $catz .= " {$cat->name} ....
This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
Scripts site. Just in case the site may not show, I will include the code here: List of things
needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
script below with name (i.e. watermark.php) CODE // this script creates a watermarked image
from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly transparent
gif image with the watermark - goes in the same directory as this script // where this....
i've started to learn php..im familiar to basics of php and mysql now.Now for example i want
that some user can register to my website , and after that he can Login and log out , and he can see
his profile.is there any tutorial about this ? or any helping url .. or any helping answer please
/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />....
In search of dynamically changing quote, saying or all other types of text on an image I came across
a code that I have modified to fit my initial usage. This procedure requires two files and short
knowledge of PHP. If you are familiar with Trap17's sig rotation code you will understand this
procedure very fast. Code 1: dynamic_sig.php (you can rename this to index.php and you'll see
at the end why) Code 2: a simple text file named anything (I will call it name.txt ) Code 1
CODE header("Content-type: image/png"); $image = imagecreatefrompng("../i....
Well, I am making a full CMS system for my site, and want to make the index.php file to include the
view.php?id=1 file. I tried with this code, but it didn't work: CODE This is the error
I get: CODE Warning: main(view.php?id=1) : failed to open stream: Invalid argument in
C:\server\xampp\htdocs\test\index.php on line 1 Warning: main() : Failed opening
'view.php?id=1' for inclusion (include_path='.;C:\server\xampp\php\pear\') in
C:\server\xampp\htdocs\test\index.php on line 1 So what can I do?....
i have never tried to have files uploaded and i am still not able to do so. here is the codes that i
am using right out of the php manual and it still isnt working. i have also listed the
warnings/errors listed on the resulting page. my permissions are set to 777 also. i have a folder
set up on my server as "uploads". i am however not sure if i have a default temp folder on my
server. can anyone help me figure out what i am not doing correctly or what my next step is? this
is the form that i am using: html Code: CODE Choose a file to upload: ....
Hey all, I decided to write a script which writes some text to a file, but I have a problem when I
execute the script, I get a fatal error: QUOTE(homepage) Fatal error : Call to undefined
function: file_put_contents() in /home/cmatcme/public_html/afile.php on line 55 This is the
code I'm using to write the file: $ipfnsdoc = "/home/cmatcme/public_html/afolder/afile.txt";
if (!is_readable($ipfnsdoc)) { echo "File cannot be read"; $stopload = 1; } if
(!is_writable($ipfnsdoc)) { echo " \nFile cannot be written to"; $stoploa....
is there a php function that lists the content of some folder.... example: /New folder new.txt
left.gif download.zip dc.exe ....so is there..? /rolleyes.gif' border='0'
style='vertical-align:middle' alt='rolleyes.gif' /> ....
I know its possible to put many pages inside 1 file. But how? Lets say you have a guestbook with
different pages for signing and viewing. How to make so those pages are in 1 file? /huh.gif"
style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" />....
I put the login for the forums on the index of my site. (mysite.com/index.php) I want to be able to
log on there, then have it go to another page of my site (mysite.com/members/index.php), and link
the forums from that page, rather than it redirecting me straight to the forums. Anyone have an idea
on how to accompolish this?....