Jump to content

Rita_Ruah

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by Rita_Ruah

  1. Hello, first of all thanks for the replies... I tried again and managed to made it work with the simple change of structure of my array: // From this: // $array[$i]['name'] // To this: // $array['contacts'][$i]['name'] Thank you
  2. <body> <?php $array = array(); for($i = 0; $i < 2; $i++){ $array[$i]['name'] = substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyz", 5)), 0, 5); $array[$i]['location'] = substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyz", 5)), 0, 5); } $array = json_encode($array); ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> <script> var data = <?php echo $array; ?>; $.ajax({ type: "POST", url: "process.php", data: data, success: function (msg) { console.log(msg); } }); </script> </body>
  3. Even with that output I cant send no data... how would you post this data into a jquery ajax call to other php file?
  4. But I am receiving that with php json_encode... what gives?
  5. Hello, I have an array with this structure: array (size=2) 0 => array (size=2) 'name' => string 'MR A' (length=4) 'location' => string 'A LAND' (length=6) 1 => array (size=2) 'name' => string 'MR B' (length=4) 'location' => string 'B LAND' (length=6) I am trying to send it via Ajax converting the $array with json_encode($array) which results into: [{ name:"MR A", location:"A LAND" }, { name: "MR B", location: "B LAND" }] . But it's giving me an error... each time i make a var_dump from the other file, I find myself stuck with a "undefined". Is the array bad? How should I proceed? Tks EDIT: Please move to the right section (PHP Questions).
  6. Hello, I am trying to create a script to upload videos to youtube automatically... unfortunately I don't understand Oauth2.0, I think it's quite confusing... I cannot find a way to upload videos without login... I want my account details on the php and it automatically uploads new videos in a folder in my site. Any suggestions? Thanks in advance.
  7. Hello, I have a problem with my logic and would like someone to enlighten me. I have two arrays: $array1 contains 1, 2 and 3. $array2 contains 2. I want to know the best way to dinamically check the first array, checks their values, compare to $array2, and insert the missing values in $array2. In my logic: - $array1 is initialized with values 1, 2 and 3; - $array2 is initialized with value 2; - Compare the two arrays; - Insert the missing values (1, 3) into $array2. How can I do this? Can you provide me some code? Thanks
  8. I want to create a simple cms with a simple backoffice so that my parents can use it to add posts to their online cooking book. As I love new ideas, I would want to create a simple cms that instead of a database would use a xml file or something. What main features should I seek, in my head: - 2 or 3 templates - Security (Admin login) - Simple way to add posts - Simple way to edit css (when saving it would save a new css file) Thanks for your feedback
  9. Hello, I haven't found any tutorial regarding this topic, how should I do this? Should the backoffice generate xml? It's a very simple site, but I don't want to use a db. Thanks.
  10. I have this string in Javascript: <MediaFiles> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> </MediaFiles> How can I loop through MediaFile in javascript? It's not a xml, it's a string! Thanks!
  11. It's real code... instead of VIDEO there are urls... @Barand Thanks! =) And in Javascript, how would I do this?
  12. Hello, I have a programming doubt... I think this can apply to every language, imagine this scenario where I have this xml: <MediaFiles> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> </MediaFiles> How can I count the number of occurences of <MediaFile> so I can make a group of every mediafile and do a Random to select one of them? Pseudo-code of what I want: foreach(<mediafile> of <mediafiles>) array[] = mediafile VIDEO;
  13. Hello, I have a programming doubt... I think this can apply to every language, imagine this scenario where I have this xml: <MediaFiles> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> <MediaFile> <![CDATA[VIDEO]]> </MediaFile> </MediaFiles> How can I count the number of occurences of <MediaFile> so I can make a group of every mediafile and do a Random to select one of them? Pseudo-code of what I want: foreach(<mediafile> of <mediafiles>) array[] = mediafile VIDEO; Can you give me an example of php and other for JS? Thanks.
  14. I managed to do it in just fifteen minutes... I feel so ashamed right now... Silly me... Thank you for guiding me in the right direction! just one final question... can you tell me how to change my profile picture? Thanks.
  15. Ok, thank you! My doubt is where to start, I don't know how to work with classes (where can I study them?). I am thinking about something like this: 1 - Select images... 2 - For each image, the script would print the selected image on the pdf, then, a pagebreak would happen. 3 - ??? 4 - PROFIT.
  16. Can you help me? EDIT: how do I change my profile picture? Thanks in advance!
  17. Didn't managed to find a script to do this... can you please link me to an working demo source? Sorry...
  18. Hello, the scanned documents are jpegs. I would like the user to select the images, and then, produce a pdf with all the images (imagine, I scanned 3 pages (I now have 3 jpegs), I select the 3 jpegs, and the output will be a pdf with the 3 images (one in each page of the pdf).
  19. Hello, Is there any easy way to do this? Thanks in advance!
  20. This looks good thanks Whenever I finish the function to paginate (it's a pagination without database), I will tell if it worked! Thank you Jessica!
  21. But I am on my tablet, is there any php editor/run for tablet (android)? Only tomorrow I will be able to try to fix it... please Jessica, if you don't want to give the answer, atleast try to explain to me what to do... I am thinking about: for($i = $_GET['page']; $i <= $num_pages_list+$_GET['page'];i++) { if($i <= $num_pages) { echo $i; } } EDIT: This won't work because the pages aren't limited to 5 right? Damn...
  22. The first part I think that it's assigning the current page for $i, right? Next I have no idea... Please help... I feel dizzy, pagiantion was fine and was my favorite project until this problem I only ask because I am desperate...
×
×
  • 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.