How To Insert $filename Into Html Tag?
i want to insert $filename into src=" " using echo;
but i don't know the right syntax to do this.
This was the codes below that unsuccessfully executed.
$filename = "myimage.gif";
echo "<img src=$filename />";
although there was no error but i don't see the image
i guess my insertion to variable inside a src=" " is wrong...
I hope you will help me with this very tiny insertion problem.
View Complete Forum Thread with Replies
Related Forum Messages:
Content-Disposition: Attachment; Filename='' Suggestst Wrong Filename
I have a script that i use for my downloadable files. Bu when i try to download a file with IE it suggests a different filename than what i wrote in the code. For example. If i try to download the file 'download.test.zip' it suggests 'download[1].test.zip' instead. I i use Mozilla Firefox to download the file it works fine... And another question: what does the @-character before require('includes/sys.dbconnect.php') really do? :) I think i read it somewhere but i cant seem to remember what it means...
View Replies !
Dynamically Select The Filename From The Referring Filename.
I am creating a website that has a couple Iframes for content. Now the issue is that I am trying to create the iframe so it will dynamically select the filename from the referring filename. For example: x=section1&cat=page&sid1580uafujn3089efg put the cat value as the filename plus the .php extension outputted to $page so it can be placed in the src="$page" field of the iframe.
View Replies !
How To Insert Tab In An Html Page???
i am making one appllication inwhich the user enters text in textarea field. i am saving this value in database and when user accesses value from database, i want to display text in a format entered by user. i.e. if the user has entered some text in 2nd line then it should be displayed on second line and not after the end of first line in continuation. if user has entered tab in some location, the tab will be displayed while viewing data from database.
View Replies !
Insert/Add Row In HTML Form
I am trying to find out a way to have the user input as many rows as they desire, right now I only have a form where user can only input one row of data, I am wondering if there is a button lets say named "Add Row", after clicking it, the user can then add row into the database automatically? It might be vague, so let me describe it in a more concrete way. Lets say if I need user to enter a receiving report, the record includes date, sender, contents of shipment, qty.
View Replies !
Insert Data In A Html Table
here is the code: <? $a=array(1,2,3,4,5,6,7,8,9,10); $b=array(1,3,5,7,9); $c=array(1,1,2,2,3,3); $d=array_count_values($b); $e=array_count_values($c); foreach($a as $key) echo '<table><tr><td>'.$key.'</table></tr></td>' foreach($d as $key=>$value) echo '<table><tr><td>'.$key.'<td>'.$value.'</table></tr></td>' foreach($e as $key=>$value) echo '<table><tr><td>'.$key.'<td>'.$value.'</table></tr></td>'.
View Replies !
Install PHP W/DreamweaverMX Or Just Insert PHP Code Into HTML?
I am brand new at PHP and Dreamweaver MX. We have Linux/appache. I need to create a form on the web/and communicate data to/from an MS Access DataBase. I saw a great tutorial ref in devshed. If I have Dreamweaver MX, do I need to purchase PHP? Dreamweaver can process PHP code embedded into its HTML, I think but do I need "something" else? What version of PHP is MX using ? Are there other links that provide "PHP script/code" to use to connect to Access?
View Replies !
Insert Data To The Database From An HTML Form
i want to insert data to the database from an HTML form but when i run the script it will insert NULL to the database. On that note i like to request for help from anyone. This is my code <?php include "connect.php" $sql = "insert into TEST values(:name)"; // Parse SQL $stmt = OCIParse($conn,$sql); // Bind php variables to Oracle columns OCIBindByName($stmt,"NAME",$name); // Oracle converts all column names into UPPERCASE // Run SQL OCIExecute($stmt);
View Replies !
Insert Html / Pdf Into "image" Column In MSSQL 2000
I am trying to insert uploaded files into a M$ SQL 2000 database. The uploaded files are validated as either PDF or HTML and then passed to the database. They need to be stored in an image column so that they can be indexed for fulltext searching. Currently I get the following error when inserting the files into the db - "Operand type clash: text is incompatible with image" The files are read into a buffer and then they are prepared for the insert. I have tried both addslashes() and replacing a "'" (single quote) with "''" (two single quotes). I have seen suggestions that the data should be base64encode()'ed but can't get anything to work consistantly.
View Replies !
Insert Values - Table Has Four Columns To Insert Into
I have a bunch of information that I want to insert into a table insert into TABLE values ('hello','I','am','lost'); pretend that the words that are being inserted are coming from a form for another page. In he case I above I have declared that the table has four columns to insert into. What if I do not know how many columns there are?
View Replies !
Insert Into Table - $query = "INSERT INTO Tbl
I have a small problem which I've been working on for a while. PHP Code: $query = "INSERT INTO tbl(username,ip,link) VALUES("Brin' . $result['id'] . '","$REMOTE_ADDR","http://www.domain.com/sub/start.php?username=Brin"' . $result['id'] . ' )"; mysql_query($query); Any ideas?
View Replies !
Get Filename From Url
If I have a url such as: http://www.planetblaze.com/index.htm or http://forum.maidenfans.com/images/header.jpg how can i get just the filename from the end? Is there an easy way? I really dont understand reg expressions especially when urls could have any number of dots,, slashes and dashes.
View Replies !
Get .PHP Filename?
I've been looking thru my PHP functions and can't find what I need - is there a function that will tell me what .php file is currently executing?
View Replies !
Filename From URL
I have a URL like: www.abcd.com/12345 that give a download of a file xyz.jpg. how can I get the string "xyz.jpg" from de www.abcd.com/12345
View Replies !
FILENAME
I have a php script, say example.php, how do i make my script display the filename within the file, so that for example somewhere in the script i have echo "$filename"; the filename is displayed on the screen (my echo script is probably wrong but im rushing this!) THEN!!! how do i take away the ".php" from the file name and replace it with .html so that the page example.php echo's example.html and the page template.php echo's template.html
View Replies !
Filename
I have a temp folder that clients ftp images into. Now if they upload a file called 'White Lilly.jpg' linux adds a backslash to escape the space in the name. so it becomes 'White Lilly.jpg' The problem I am having is once they upload the file, I read the directory for any files inside and rename them, and move them to another folder. Like so $directory = '../tempimages' $directory_stream = opendir($directory); while ($entry = readdir($directory_stream)){ $oldpath = $directory."/".$entry; $newpath = '../../gallery/'.$imageid.'.jpg' $cmd = "mv ".$oldpath." ".$newpath; $ret =0; exec($cmd, $result, $ret); }
View Replies !
Fpassthru With Another Filename
Is it possible to open a file, for example "myfile.exe" and pass i thru with another name, for example "sillyfile.exe"? I've checked the PHP manual, but I can't see a solution for this?
View Replies !
What Is The Current Filename?
I think I'm missing something obvious, but I didn't spot this searching the PHP.net site. I just want a php function or variable to tell me the name of the file in which I (the code being interpreted) currently am. The PHP interpreter knows because if there's an error, it displays the exact filename. In particular, if it's an included file, I want to know its (the included file's) pathname.
View Replies !
Filename Without Extension
i have the below command to make a $file(filename) and a $extension(just the extension), but i am trying to figure out how to add another one to have a variable of just the filename without extension (in addition to the others). if(is_array($files)){ sort($files); foreach($files as $file){ $path_parts = pathinfo("$file"); $extension = $path_parts['extension'] ;
View Replies !
PHP Filename Search - Possible?
I have a directory of pdf files 13344.pdf 21488.pdf etc Users want to search for a particular pdf file and have that displayed to them. ie user searches for: 13344 Is it possible for a PHP script on its own to search a folder based on file name and retrieve the pdf file or will i need to add the files name to a...
View Replies !
Get Filename As Variable
I can get the filename of the PHP document currently being viewed/used to use as a variable? lets say I execute script bob.php, but in it is required/included header.php, which is where I will hopefully be using the above question. Would this give me bob.php or header.php? I want to get bob.php
View Replies !
Filename Parsing....
What I am trying to do is take a filename from a URL (http://example.com/?i=image-t.jpg) and dynamically re-size it based on the "-t" For example, I have an original image that is called "image.jpg" If someone changes the URL to point to: "image-t.jpg" I want to parse the "-t", resize it to a thumbnail and display that. I have the resizing down so no problem there. I just can't wrap my head around regular expressions.
View Replies !
Splitting A Filename
if i have an image at the address: http://www.domain.com/images/picture.jpg how do i get it so that php splits it up and i am left with just picture.jpg?
View Replies !
Getting New Filename Extension!?!
I have an upload page where a user selects the file from his/her computer and a text field to rename the file ex: "JoeSmith". Everything works fine, but on the next page where I post the data to I would like to know the new file name AND the extension that follows. The problem: Since I am renaming the filename it receives the same extension (.gif, .jpg, etc) as the original file type. The only problem is that I can post the filename but I can't figure out how to get the extension along with it. Here's my Code for the Upload page Code:
View Replies !
Filename Parameters
I have a form with action="<? $_SERVER['PHP_SELF'] ?>". If the url is something like www.something.com/product_info.php?id=15 it will go to page product_info.php . I want it to go to product_info.php?id=15 . How's that possible? I could use something like action="<? $_SERVER['PHP_SELF'] ?>?id=$id" but this will not work as not all the pages have a product id parameter in the url.
View Replies !
Concatenate Filename
How would one go about doing the following: if (file_exists('conent'.''.$col_value.'.xml')) seeing that the '' part creates an error, and that you cannot use '' in the filename? For example, what I need is for the filename to look like this: conentFear.xml where the Fear is found in col_value?
View Replies !
Using (file_exists($filename))
I am trying to get PHP working on my server so I can start using it properly, but it always comes back with 'false' when I use the below code. <html> <head></head> <body> <?php $filename = '/path/favicon.ico' if (file_exists($filename)) { echo "YEEEEEEEEEEEEEEEEEEEEES! The file $filename exists"; } else { echo "NO! The file $filename does not exist"; } ?> </body> </html>
View Replies !
Trimming A Filename
I have a form that users use to upload an image, as well as Title field that users can use to default to the file name, or type in one manually. At the moment there's a button to populate the temp field that gets dumped in the Title field when the record is added. However, at the moment it just copies in the full text of the file name's path, eg : c:/images/image.jpg . PHP Code: <input name="uploadFile" type="file" size="55"> <input type="hidden" name="MAX_FILE_SIZE" value="25000" /> </td> <input name="DefautButton" type="button" onClick="Title.value=uploadFile.value?uploadFile.value:'No file'" value="Default"> Â Â Â Â Â Â Â Â Â Â Â Â <input name="Title" type="text" id="Title" size="69"> Is it possible to trim it either here (or I suppose in the upload script) so that it just inserts : image.jpg instead of c:/images/image.jpg ?
View Replies !
Variable For Filename
I need to echo the filename of the PHP page that is currently in use via a template. For example, on index.php, the variable would return 'index,' and on /folder1/folder2/whatever.php the variable would return 'whatever.' It seems like basename() would do the trick, but that still requires specification of the path, which I'd like to avoid.
View Replies !
Echo Just Filename.php
I want to print just the filename from somthing like $_SERVER[PHP_SELF]; The directory varies could be /dir/dir/dir/filename.php or just /dir/filename.php anyway I want to pick out the filename.php part regardless of the directory its in.
View Replies !
Fetching Every Filename
I've a bunch of images en certain directories and I would like to display six of them in a random way. So I need the make an 'ls' command on each one of them, and storing it's complete path into an Array position. And then, select some of the with the random function. My problem is that I do not know how to make a dir / ls command in php and storing results.
View Replies !
Output Filename
I'm trying to grab my web address path and extract the extension of the filename. The filename is located at the end of the address. (e.g.) - images/path/filename.jpg I want to extract the path so I'm just left with the extension after the period. PHP Code: <? $fullurl = $_SERVER['PHP_SELF']; echo "$fullurl"; ?>
View Replies !
Create New Filename
I have a script that passes the param to another page and saves it. what I would like to do is have it give me the option on the second page to save it as is or with a different file name (my input). here is the update.php <?php require('thisfile.class.php'); $thisfile = new thisfile('config.inc.php'); $thisfile->save($_POST); header("Location: config.php"); ?> the file config.inc.php and make it on the server it of course works. but I don't want to have to manually edit the code every time I want to make a new page.
View Replies !
Current Filename
i need to get current filename, strip the extension and add the same name but with .inc on the end $fname = $_SERVER["SCRIPT_NAME"]; $base = rtrim($fname,'.php'); $ext = array($base,'inc'); $data = implode(".",$ext); echo $data;
View Replies !
Insert Statement Doesn't Insert Anything
I have an int field in a database and for teh purposes of this case the insert statement doesn't insert anything into the field using the ' ' syntax however in the mysql database this appears as 0. I was wondering can I still use the empty syntax as follows or will it not work as it is 0 does is this not classed as empty? if (empty($row['intTest'])){ $sns= "empty"; }
View Replies !
Readdir And Then Sorting By Filename
I wrote a nifty 'photo album generating' script I wrote that reads the directory for image files, then presents them in a thumb gallery. How could I get it to sort that list of files (instead of in stored order) by file name?
View Replies !
Filename Without Extension In URL Query
If I have a search submit button, when I click submit button, it will submit the form to search.asp for form processing. This will be the URL: http://www.mycompany.com/search.asp?q=programming But when I do search in google, search doesn't have any file extension. How do they do that? I saw some site are like that too. http://www.google.com/search?hl=en&...G=Google+Search
View Replies !
Convert Filename To Lowercase
I have a load of UPPERCASE files (locally) that I want to read through using OPENDIR() and READDIR(). I want to convert the filenames (BASENAME) of these files to lowercase. I'm using Windows XP locally and couldn't find a way of doing this using the OS. Damned if I'm going to manually adjust several hundred UPPERCASE files in Windows Explorer so I thought I'd try and write a PHP solution. Of course my host uses UNIX which won't allow me to locate files that I have specified as lowercase within my HTML if they are UPPERCASE on the server.
View Replies !
Readfile($filename) With PDF File
I have successfully generated my PDF file, and am now trying to send it out to the client browser. I store PDF file in a secure directory, and then use an intermediate file to send the PDF. The PHP file in question is called ContactTypes.pdf and in apache the .pdf file is configured (for that directory only) to be processed by PHP, and this is working fine. I send a Session ID along with the requested document and I believe this is causing errors: ie: http://www.myserver.com/cgi/Contact...D=12987g3817g4f The PHP then looks at the session, and looks in the database for a PDF file for this session, and then sends it. The following code is used to send the PDF file. The filename is correct, as when I remove the header type, i see the raw PDF code. PHP Code:
View Replies !
Grab Filename From Directory
I have a directory with about 500 or so files in it. I'd like to grab the filename.ext and then insert into a database. I understand the inserting part, but I don't know how to grab the info. I will keep adding to it so the number will only grow.
View Replies !
Getting A Filename Without Uploading The File?
Is there anyway to show the user directories with filenames and have the user select a file? Something like a file upload but w/out the actual upload. I just need the name of the file as a string. I think an actual upload and extracting the name from the FILES array is the only way.
View Replies !
How To Get The Filename Of A Called PHP Script
I'd like to get the filename of a called PHP script. E.g. if you call http://www.test.com/subdir/start.php I'd like to get within the PHP script 'start.php' the name 'start.php'. I've several PHP scripts and of course I could add at the beginning of each PHP script the name of the PHP script itself. But if there's a possibility to read its name from the filename I'd prefer this method.
View Replies !
Delete Images/filename?
I am doing on a php photo album. Here is my table structure for images: CREATE TABLE `images` ( `Id` int(11) NOT NULL auto_increment, `name` text, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; I save the images as a path(e.g. http://localhost/album/images/pic.jpg) in field 'name' of table 'images'. and now i would like to know how to delete the images from both the DB and the directory that i saved the images.
View Replies !
Filename.php5 Extension?
Currently my server is running php 4.0.3 or something like that. I called customer service. They say its running php 5 but I need some filename.php5 extension? What is this? Is this true? Help!!! I'm clueless!!
View Replies !
Space In The Download Filename
I have made a small page where users can upload files and then download them from another, however if there is a space in the filename the download will not work properly. I was just wondering if thats how things are or if there is a way round this?
View Replies !
$_SERVER Echo Just The Filename?
I want to echo just the filename of a current page. When I use something like $_SERVER['PHP_SELF'] it gives the directory and the filename. Any ideas on how to show JUST the filename?
View Replies !
|