Jump to content

How To Bring Value From Webpage/html To Phpword Code?


EzwanAbid

Recommended Posts

I'm having a problem here which I don't know how to bring data that pass by url and send to PHPWord, so that the passed value can be use as data in my PHPWord..

My system will be accessed by lots of user, and I want to bring the current student info after I click "generate letter" that locate bottom of the queue list for each person..

The data that I want from webpage is :

 

fullname,

student_id,

ic_number,

course,

 

After clicking the "Generate Letter", the PHPWord will print the data according to the selected student in the list :

 

(example)

student name = Ezwan Abid

student_id = 05-201005-00018

ic_number = 12-121212-1212

course = IT - Software

 

and all those data above ( from the 'queue' list html page ) will bring the data to PHPWord and be printed.

Hope someone can help me ASAP. :-\

 

I already upload the file that contain the code :

ApprovedLetter.php = Display the student data that already request a certain letter. The data will be display in table as queue list.

KebenaranProjek-code.php = PHPWord code that contain mysql to bring data from database.

KebenaranProjek-code.php

ApprovedLetter.php

Link to comment
Share on other sites

You do this like you'd send any other value to PHP: By using GET or POST.

How it's handled after PHP receives it, is completely up to you, and totally independent of the delivery method.

 

You have to separate the different problems from each other, otherwise it will be come too complex and thus insurmountable. What you have here are two problems:

  1. Sending a value from a client to PHP. A already solved problem, and the reason PHP came into being in the first place.
  2. Adding variable content to a word document, with PHPword.

 

Once you've solved each problem on their own, you can combine them to get the proper functionality you desire.

Link to comment
Share on other sites

Thank you Christian F for your reply..

 

 

You do this like you'd send any other value to PHP: By using GET or POST.

How it's handled after PHP receives it, is completely up to you, and totally independent of the delivery method.

 

You have to separate the different problems from each other, otherwise it will be come too complex and thus insurmountable. What you have here are two problems:

  1. Sending a value from a client to PHP. A already solved problem, and the reason PHP came into being in the first place.
  2. Adding variable content to a word document, with PHPword.

Once you've solved each problem on their own, you can combine them to get the proper functionality you desire.

 

Yes, that's the problem .. I can't just use POST and GET to receive selected student data into word document, or maybe my code are wrong..

Is there any solution that I can use to bring selected student data into word document? That's my biggest problem now. :sweat:

Link to comment
Share on other sites

Ah, forgot to ask you,, can 1 Foreign key value have more than 1 data of row by using the same 1 Foreign Key value :

Examples :

 

Student table :

 

student_id (PK ) [with value 05-201005-00018]

 

surat table :

 

1. student_id (FK) [with value 05-201005-00018] + [type_of_letter= TamatBelajar]

2. student_id (FK) [with value 05-201005-00018] + [type_of_letter= ExamAkhir ]

 

What I mean here, 1 value from PK, then we use the same PK=FK value but have different data in 'surat' table that is the data in the 'type_of_letter' column.. because 1 student may request more than 1 kind of letter.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.