Computer problems,Computer help
*AX SOFT>>>Programming & Design

Help with embedding code in PHP?


I have this code for generating a page with an image that the user has just uploaded. Here is the code for that page:

<?php

$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

$pfile = fopen("userpics.htm","a+");


// If everything is OK -> store user data

fwrite($pfile, "\n<embed src = \"$target_path\ /><p>");
fclose($pfile);

?>

The problem I have is that all it does is place the image there. I want it to embed a CSS style to it (as possibly a link so i can use the lightbox javascript code - but thats not as important) everything i try keeps getting errors and i really need to get this sorted as its holding everything else up.

Please help thanks

just keep writing the css you want in the fwrite() function.

fwrite($pfile, "\n<embed src = \"$target_path\ /><p>" .
'{font-size:x-small; font-weight:normal;
background-color:".$css["background-si... color:".$css["maincolor"]." }n"'
);

just use a "." to append whatever you want together.

You should be able to make the label embeded a style in your CSS file. Then you can change the CSS values.

i agree with the others

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Charts in JAVA!?!?!?!?

    The latest - jre 6.0.2. Copy the ".jar" file into the JAVA/JRE/LIB/EXT. Then include the jar file in ur classpath. Then import it. O.K.?

    ...
  • I was extracting a file and it shows me that it got a crc error PLZZ hlp....?

    CRC means "cyclic redundancy check". It is a means of checking the integrity of a file. If it fails the CRC, then that means the file is corrupt. There are no really reliable ways ...

  • Can I change a sub file to srt?

    Hi, Don't do that.. i am almost sure it won't work, but you won't screw up anything since u can rename back your file. If u are up to date with your codecs you should probably no...

  • What programming language are learning or have learned and why?

    Programming languages are for writing programs. Java is the most portable (can be ran on many different operating systems.) .Net is the most popular, simply because it's the most powerful l...

  • Know of any good FREE programmes similar to MS publisher?

    You can try Scribus. It is a freeware Desktop Publishing program. The only downside that I have seen with it is that it does not come with a graphics catalogue. But, you can easily find a boatlo...

  • For loop qustion?

    You have to clear the '' from the buffer before you read the next character. If they were to put more into the buffer, then you should loop until you reach the '' #include<...

  • How do I teach myself how to Program?

    If you are starting out and you want to learn a useful language, may I strongly suggest Python. It is free, very powerful, very easy to learn, and has a growing and dedicated user base. It is also ...

  • If i needed to use frontpage for school and i dowloaded a free trial...?

    First of all you should know that Frontpage was discontinued so finding a trial might be difficult. As for the files created with frontpage, they can be accessed on any other computer that has f...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster