How to create this admin panel in php?

Hi all

I am designing an Admin panel in php which has option to upload file and text both.
I have managed seneraio of text How can I manage file uploading…?

I am facing problem here
suppose in textarea user has inserted a video know I have two seneraios to handle
1)Upload that video file in proper directory
2)Add saved path in database to in place of video src.

How can I manage these senraios ?

Function is same as sitepoint but I want file position saved properly.I need to create JSON further
from this data for android and iOS.

Have a search down this forum, there are lots of file upload scripts that people have required help with that would give you a start on the code. Simply a case of adding an <input type="file"> to your form and dealing with the upload in your PHP code.

But how can I extract input type==file from inside textarea

although I can do this but main thing
I need to preserve all those file input in same order for creating JSON api for android

How can I do this?

Well, you wouldn’t normally put in in a textarea, you’d have a separate input for it. I can’t see how you’d do it from a textarea - you could extract the filename in PHP, but your PHP wouldn’t be able to force the client machine to upload the file for obvious security reasons. Why do you want it from in a textarea rather than doing it the normal way? Or are you talking about some kind of drag-and-drop enhanced text entry box rather than a standard html textarea input?

No idea about JSON api for Android, sorry.

Just take a simple example of sitepoint when we post a question

we can add smiley,text,blockquotes,files I need similar kind of system for my admin panel also how can I do it?

And I can get value on server side but then I need it to seprate and maintain same order in which they are inserted.

You want to drag and drop?

No I have JQuery code that will add on button click

Only thing I want is to get all files,texts,images in server side in same order and after manipulation on some of them
like changing video file path and some small things store in database and then generate same order based JSON api for android app

Just keep in mind that the text editor in the Sitepoint forum isn’t a textarea. I can’t help any further unfortunately, but I suspect when you select a post editor to use, it will have sample code on how to retain post order and so on.

1 Like

like this is my requirement actually if you can suggest any help for this

I am designing a web application which has blog writing features like user can insert image,text,files at any place.

I have designed its UI problem I am facing is getting those value in server side and store them in same sequenance as they entered in textarea.

suppose In case information is in this order
video
text
image
text
text

so then I need to store that data in same order for further processing to create JSON

and same for others

I believe he is talking about BBcode, but the kind where you can see the actual visiual/ video. So kind of like CKEditor. I believe he wants to be able to place the video and/ or images and move them freely within said text area.

I also don’t believe it is possible to separate what is image and what is text and so forth using PHP because someone can easily attempt to spoof that idea. Someone can do

https://some-random-domain-that-does-not-exist/images/random_picture.pngThis is a text spoof.

And then your PHP Will most likely grab all that text with it. Unless you know a way to do it better. I agree with @droopsnoot. You should have separate fields where you can reference the filename in your blog and embed it that way. That way, you can also have the Json reference the filename without having to try and parse the video or image from the message where it’ll take a lot of effort to do.

Can you explain it I didn’t get it that If I need to maintain an order in server side in which they are entered in front end.How can I do this?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.