Jump to content

bm4499

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bm4499's Achievements

Member

Member (2/5)

0

Reputation

  1. sorry but u need to read better. I wrote I have tried some of those examples of php.net, especially for you asort, sort and so on. Stop answering questions with other questions. Just give a solution and don't waste our time any longer. The example of an unsorted array is given completely. Go read again.
  2. i saw but tried some and did not get it work
  3. Hi does anyone know how to sort the array below (files) echo "<br /><br /><b>Favorites</b><br />"; $d = dir("/mnt/disk/v1/mfiles/downloads/music/favorites/"); while (false !== ($entry = $d->read())) { if($entry!='.' && $entry!='..') { if(is_dir($entry)) { echo 'true'; $subdirs = get_leaf_dirs($entry); if ($subdirs) $array = asort(array_merge($array, $subdirs)); else $array[] = $entry; } echo '<a href="/scripts/download.php?actie=favorites/'.$entry.'" title="Click here to download this song" target="_blank">'.left($entry,(strlen($entry)-4)).'</a><br />'; } } $d->close();
  4. Does anyone know how to modify this code so that it rounds 2 digits after cumma? style="width:15%;" onchange="document.getElementById('total').value = ((parseInt(document.getElementById('f1').value) + parseInt(document.getElementById('f2').value) + parseInt(document.getElementById('f3').value) + parseInt(document.getElementById('f4').value) + parseInt(document.getElementById('f5').value) + parseInt(document.getElementById('f6').value) + parseInt(document.getElementById('f7').value) + parseInt(document.getElementById('f8').value) + parseInt(document.getElementById('f9').value) + parseInt(document.getElementById('fa').value) + parseInt(document.getElementById('fb').value) + parseInt(document.getElementById('fc').value))*1.50);" I've seen the round function but have no idea to use it in the case above. Normally I work with functions.
  5. Does anyone know how to modify this code so that it deny in case a text field is empty? Next to that I want to multiply it by 1.5. Anyone? onchange="document.getElementById('total').value = parseInt(document.getElementById('f1').value) + parseInt(document.getElementById('f2').value) + parseInt(document.getElementById('f3').value) + parseInt(document.getElementById('f4').value);" thanks a lot in advance!
  6. I would like to post it as variable mailform. An example like require_once with a function also would be good. Ive tried it but seems it is not working.
  7. Can anyone tell me why this code is not working: <?php $d = $_GET['p']; $u = $_GET['u']; $email_to = $_GET['e']; $email_from = "no-reply@mydomain.com"; $headers = "From: " . $email_from; $fileatt = "$d/pdffile.pdf"; $fileatt_type = "application/pdf"; $fileatt_name = "$d/pdffile.pdf"; $email_subject = "Your pdffile"; $email_message = "blablabla"; $email_message .= "Thanks for visiting.<br>"; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data .= "\n\n" . "--{$mime_boundary}--\n"; $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo "Dear $u,<br /><br />blablabla."; } else { die("Sorry but the email could not be sent. Please go back and try again!"); } ?> This code is working properly: <?php $fileatt = "dirname/myfile.pdf"; $fileatt_type = "application/pdf"; $fileatt_name = "dirname/myfile.pdf"; $email_from = "no-reply@mydomain.com"; $email_subject = "subject"; $email_message = 'Hi,<br /><br />blablabla<br>'; $email_message .= "<br /><br />Thanks for visiting.<br>"; $email_to = 'info@mydomain.com'; //$e; $headers = "From: ".$email_from; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data .= "\n\n" . "--{$mime_boundary}--\n"; $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo 'Hi '..'File has been sent to your e-mail address: '; echo '<br />Go check your mailbox and check your spam box.<br /><br />Thanks for your order!<br /><br />blablabla'; } else { die("Sorry but the email could not be sent. Please go back and try again!"); } ?> Maybe it is possible to add it as require_once with a function? I am lost now, strange I cannot get it at work properly with $_post / $_get...
  8. thanks a lot, now it works. Thought there was a possible parameter since it was working in same window. Same window means serverside.... Got it now. Once again, thanks a lot.
  9. Hi, is it possible to use the code below and open it into a new internetexplorer window? The code works properly except I want it as pop-up window. header("Location: http://192.168.10.254/img/Calcday.php?p=$val"); thanks a lot in advance.
  10. Thanks for your reply. I've got it at work. I changed it a bit into an array since that function retreives more values.
  11. Above means that it works within the function itself. function convert($str) { $xml = simplexml_load_string($str); (str)$txt->value; $myvalue= (string)$text->value; echo $myvalue } Here it works but at the place I call the function where I use after functioncall: convert($abcd); echo $myvalue; //here my value is not printed
  12. does anyone knows how to fill this value to a variable (code below works on the screen): (str)$txt->value; echo (str)$txt->value; I need to get the value from the code above into $myvalue (code below does not work): (str)$txt->value; $myvalue = (str)$txt->value; echo $myvalue;
  13. hi, I want to filter things like: $street = ... (this value is below <text identifier="4339a108-f907-4661-9aab-d6f3f00e736e"> as for value) $zip= ... (this value is below <text identifier="ea0666d7-51e3-4e52-8617-25e3ad61f8b8">as for value) $city = ... (this value is below <text identifier="90a18889-884b-4d53-a302-4e6e4595efa0"> as for value). When I see how you do these, then I can filter things like phone, url and so on myself. Thanks in advance.
  14. does anyone know how to decode this XML variable value into string values? I also need to know the oposite way: creating variable values into xml. I've tried several code examples but they did filter the requested data. $xml='<?xml version="1.0" encoding="utf-8"?> <elements> <text identifier="ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02"> <value/> </text> <textarea identifier="a77f06fc-1561-453c-a429-8dd05cdc29f5"> <value><![CDATA[<p style="text-align: justify;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></value> </textarea> <textarea identifier="1a85a7a6-2aba-4480-925b-6b97d311ee6c"> <value><![CDATA[<p style="text-align: justify;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></value> </textarea> <image identifier="ffcc1c50-8dbd-4115-b463-b43bdcd44a57"> <file><![CDATA[images/stories/red/cars/autobedrijf.png]]></file> <title/> <link/> <target/> <rel/> <lightbox_image/> <width><![CDATA[250]]></width> <height><![CDATA[187]]></height> </image> <text identifier="4339a108-f907-4661-9aab-d6f3f00e736e"> <value><![CDATA[Kramer 5]]></value> </text> <text identifier="ea0666d7-51e3-4e52-8617-25e3ad61f8b8"> <value><![CDATA[6000 RS]]></value> </text> <text identifier="90a18889-884b-4d53-a302-4e6e4595efa0"> <value><![CDATA[Eindhoven]]></value> </text> <text identifier="410d72e0-29b3-4a92-b7d7-f01e828b1586"> <value><![CDATA[APK Pick up and return]]></value> </text> <text identifier="45b86f23-e656-4a81-bb8f-84e5ea76f71f"> <value><![CDATA[15% korting op grote beurt]]></value> </text> <text identifier="3dbbe1c6-15d6-4375-9f2f-f0e7287e29f3"> <value><![CDATA[Gratis opslag zomerbanden]]></value> </text> <text identifier="2e878db0-605d-4d58-9806-8e75bced67a4"> <value><![CDATA[Gratis abonnement of grote beurt]]></value> </text> <text identifier="94e3e08f-e008-487b-9cbd-25d108a9705e"> <value/> </text> <text identifier="73e74b73-f509-4de7-91cf-e919d14bdb0b"> <value/> </text> <text identifier="b870164b-fe78-45b0-b840-8ebceb9b9cb6"> <value><![CDATA[040 123 45 67]]></value> </text> <text identifier="8a91aab2-7862-4a04-bd28-07f1ff4acce5"> <value/> </text> <email identifier="3f15b5e4-0dea-4114-a870-1106b85248de"> <value/> <text/> <subject/> <body/> </email> <link identifier="0b3d983e-b2fa-4728-afa0-a0b640fa34dc"> <value/> <text/> <target/> <custom_title/> <rel/> </link> <relateditems identifier="7056f1d2-5253-40b6-8efd-d289b10a8c69"/> <rating identifier="cf6dd846-5774-47aa-8ca7-c1623c06e130"> <votes><![CDATA[1]]></votes> <value><![CDATA[1.0000]]></value> </rating> <googlemaps identifier="160bd40a-3e0e-48de-b6cd-56cdcc9db892"> <location><![CDATA[50.895711,5.955427]]></location> </googlemaps> </elements>';
  15. Does anyone know hot to get a pop-up messagebox that allows visitors of an url (e.g. http://www.mysite.com/image1.png )to open / download / cancel the file. With a *.zip file it works automatic like http://mysite/test.zip but with an image the image automatically opens in your browser
×
×
  • 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.