473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to embed javascript code in head tags after uploading an mht/html file using php

245 100+
Hi Geeks,
I have upload a file using php normal form submission.

Now what i want is when i upload that file, i open that file using php and when i found head tag i embed a script line. e.g.
Expand|Select|Wrap|Line Numbers
  1. <script src="ab.js"></script>
How can i do that using PHP?

Awaiting of your response geeks.

kind regards,
Mohsin Rafique
May 30 '11 #1

✓ answered by dlite922

Use regex to find the head tags (its contents). Insert it as the last line, re-insert into file with replace().

get hacked by hackers who found a way to make they're scripts run on your site. :)

Don't call us names, we're not geeks. It's not nice.


Dan

1 1871
dlite922
1,584 Expert 1GB
Use regex to find the head tags (its contents). Insert it as the last line, re-insert into file with replace().

get hacked by hackers who found a way to make they're scripts run on your site. :)

Don't call us names, we're not geeks. It's not nice.


Dan
Jun 1 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Georg Andersson | last post by:
hi i've created a html-file containing a frameset. the document in one frame enables the user to change the content of the other frames. but i want to modify the current html-files in the frame...
2
by: Sam Kon via .NET 247 | last post by:
Can any one of you let me know, how can I replace a pattern in an html file using C#? I have the contents of the html file stored in a string. I just need to replace some of the elements which have...
0
by: Dhanasankar S via DotNetMonster.com | last post by:
Hai friends, Please give me an idea to read the content in the body part of a HTML file from another HTML file using Javascript. -- Message posted via http://www.dotnetmonster.com
0
by: egp | last post by:
Hi guys, I have a database using Ms Access 2003 connected to VB6 using ADODB Connection and I want to know how to: - display Ms Access report in VB using VB code then print it out - backup and...
23
by: vishwa040 | last post by:
Hi folks I want to read a xml file and then write the contents to a text file
5
by: moddster | last post by:
Hi Guys. I am a newbie to perl and need some help with a problem. PROBLEM: I have to parse an HTML file and get rid of all the HTML tags and count the number of sumbissions a person has through...
1
Inbaraj
by: Inbaraj | last post by:
Hi.. I want to generate a HTML file using C# in runtime... Can any one say me how to do this.. It is urgent for me i need this file to generate report... Plz help me with sample coding... ...
4
by: MarkTingson | last post by:
Hello, Can anyone here tell me how to open a html file using VB6??? Thanks in advance..
1
by: javaflower | last post by:
in JSP , this is the code snippet to upload a file <li><html:file property="myFile" value="../img/buttons/browse_button.gif"> </html:file> in my struts action class, i am fetching it like, int...
10
chandru8
by: chandru8 | last post by:
Hi to all Can any one explain me to read data from an html file. iam have written the code to read an html file using file system object, but it reading the source code. thanks to all
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.