|
I would argue that the code functions perfectly well & answers the question.
The problem it seems, is that the question doesn't match desired outcome.
I've answered the question and you still don't have what you want. Perhaps you could consider making the question actually relate to your query?
|
|
|
|
|
hi all,
Can any one tell me how can i export data to MS-Word i.e., to a .doc file or .docx file using php ?
Thanks in advance.
|
|
|
|
|
Have a look at using word ml (word xml) format, then just push out all your data as xml text which can be read in word. (Just push it to the http stream with application/msword content type).
Hope this helps, not done this in PHP but the concept remains the same
|
|
|
|
|
hi
I am working on a website & i am new to php i want to extract the entire details from a row in the database on to different text boxes. Is it possible to do so.
Any help would be great for me.
Thanks in advance.
|
|
|
|
|
I guess you mean you will extract a row of data with each column being placed into a text field?
if so it would kinf of look like this
$fld1 = '';
$fld2 = '';
$fld3 = '';
$sql = "select * from aTable";
$rst = mysql_query($sql);
if(mysql_num_rows($rst)>0)
{
$fld1 = $row['col1'];
$fld2 = $row['col2'];
$fld3 = $row['col3'];
}
echo "<input type='text' value='".$fld1."'>";
echo "<input type='text' value='".$fld2."'>";
echo "<input type='text' value='".$fld3."'>";
Hope that helps =)
|
|
|
|
|
That helped thanks cjoki
|
|
|
|
|
Hi all,
I am having once problem that is i have exported all the date to the doc in php but i am not able to export the image to doc.
Can any one tell me how can i export images and data to a doc ?????
Thanks in advance.
|
|
|
|
|
A colleague of mine came up with phpLiveDocx[^], a Zend Framework component and can read and write DOC and DOCX files in PHP on Linux, Windows and Mac.
But I haven't worked with it, might be helpful to you.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
its something about mail merge...
|
|
|
|
|
Oov. . That could be nice.
So those people has played with the docx file format and has developed a script to generate a word document.
Hmm... like html2pdf conversions.
If people need to use in all platforms then why not convert it to a PDF.
There are lots of open sources written in simple php to convert so including images.
for all the users FYI. DOMPDF.com.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Hi guys., am having with duplicate entry on the DB when the Page is refreshed..
any solution please,. what am trying to do is when the data is added, the portion of the page loads, not the whole page, am using AJAX to load potion of the page..
help guys, thanks..
|
|
|
|
|
You need to check for duplication of data before
inserting it into database for all values you are
inserting.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
A refresh will resubmit $_POST variables, that if you are using them in your page logic, means the logic will repeat. These values are stored on the users browser so using unset to clear the post variable will do you no good, you need to do 2 things the first is as the other poster says, make certain the information does not already exist. The second is when the data is processed send the user to a specific URL. This will keep the user from refreshing the page and having post vars repeated.
On a side note if you are echoing any information before you redirect the user, they will get a error message (headers already sent or some such). You can fix this with eith redirect by using javascript or you can redign your code to put all the echo'd information into a variable and echo that just after you redirection code.
|
|
|
|
|
I assume you are using an ajax framework which uses iframe to submit your form. In that case you are doing a normal refresh like you press F5. Or if you say that you are using javascript to reload the page like window.location.reload() then you will face that problem whether you are using F5 or reload using javascript. whatever. use window.location.href = window.location.href. this is like assigning a string to as the new url instead of meaning to the browser as reload. so the browser will load the page as a new request instead of page refresh. so we are reassigning a new(same) url (requesting the browser to load that page) instead of requesting the browser to reload the page. so the only difference here is loading a page and reloading a page.
To load a page use window.location.href = window.location.href (new request)
To reload a page use window.location.reload(). (refresh the same)
I suppose that your problem lies within this.
If you are not using ajax then use the redirect option in php to the same controller(page) to change the last loaded url. for example if you are posting your form data to a page called post.php in that after processing the database operation redirect to again the same post.php. by doing so you are changing the last request as a get request. and after that when you refresh the browser will issue a get request and not the previous post request because it will do a reload only with the last request.
DO YOU NEED A SAMPLE CODE?
IF THIS DID NOT SOLVE YOUR PROBLEM THEN USE
INSERT IGNORE INTO table (field1,field2) VALUES(1,2);
Better i should blog this answer with more possible combination.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
I need to color a certain region of the map and for this I need the corner points' latitude and longitude.I am able to find latitude and longitude of any point in the map via the url "http://www.earthtools.org/" but I am not being able to find the corners of any region?for eg. I need to color Stockholm Sweden but I am facing problem with finding the actual border of Stockholm (Sweden) i.e what sub cities are included within Stockholm and what sub cities lies at the border of Stockholm?
Can anybody help me to find the borders of any region?
|
|
|
|
|
Can you elaborate more on your question?
Which API are you using and or from where you are getting Map?
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Use geonames.org
or google.com geocoding.
but you need to do a lot of distance processing and angles with the lat and lng.
Use polyline option in google map or relative to it in your map tool.
That would be interesting. at least for me. haha.
I did plotting of an express bus route in the US map using google map and javascript. Interesting.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
|
I have used PHPFamilyTree but its not good .
Can't I get the 1 I posted
|
|
|
|
|
|
Thank you so much for your kind answer. Now I am posting it in the Collaboration / Beta Testing .
|
|
|
|
|
I'll give you a clue ...
.
.
.
.
.
.
.
.
.
.
.
.
It's a Saturday. CP is nearly always quiet at weekends. So, give it time, somebody somewhere might just take up your ideas, but then again, there may not be much interest in them, who knows! but time will tell.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Amazing !
I am really impressed by ur answers
THANK YOU !
|
|
|
|
|
its urgent & no on is replying yp there . I am still waiting for somebody to assist
|
|
|
|
|
Noman, if it is that urgent, I suggest you temporarily make do with an existing script or scripts (as suitably modified), as I suggested previously, whilst proceeding to produce the necessary specification and requirements until such time that you are able to start the coding and eventual testing, then, continue to call for collaboration here and elsewhere until such time you have a product that meets your needs. If you are able to design and code, then ask question here if you run into trouble, but don't forget, we here are not mind readers, we need proper information of what might be troubling you. Also remember, any advice sought could potentially take a lot of time for replies to appear, CP is not a paid-for service.
As I suggested above, there may or may not be people interesting in pursuing such a venture, personally, I'm not. However, certainly there are suitably qualified PHP and MySQL database chaps as members here at CodeProject, but, they may already have their time committed elsewhere in both their day job and in their "private" projects, or indeed, with their family commitments.
If you can't get collaborators here or elsewhere and you become desperate, I don't care to suggest these people, but, in your case of "urgency", "RentaCoder", is an option - a poor option - but an option nonetheless.
modified 1-Aug-19 21:02pm.
|
|
|
|