Jump to content

Ch0cu3r

Staff Alumni
  • Posts

    3,404
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Ch0cu3r

  1. For file uploads to work you need to add the enctype="multipart/form-data" attribute to your <form> tag. <form action="uploader.php" method="post" enctype="multipart/form-data"> <p>File Upload<p> <p>Select file <input name="cv" type="file" size="50" /></p> <input type="submit" value="Upload" />
  2. You'll need to see if the forum has an api to allow you to integrate the forums login with your sites login. You then use the api for registering and logging in users to you site. Heres an API for IPBoard http://www.invisionpower.com/support/guides/_/advanced-and-developers/integration/single-sign-on-sso-r209 xenforo has a few mods for various forms of integration. http://xenforo.com/community/resources/categories/bridges-integrations.17/
  3. You could use regex. $text = '@red: #e51400; @blue: #0076a3;'; preg_match_all('~@(\w+:\s+#[a-f0-9]+);~', $text, $matches); foreach($matches[1] as $match) { list($var, $value) = explode(':', $match); $$var = trim($value); } echo "Red: $red<br /> Blue: $blue";
  4. I got it to work using .html() instead of .text() $("#responsetext").html(response); Also setup your select tag as <select name="customer" id="responsetext"> </select>
  5. Could try array_diff_assoc $array1 = array( 'width' => 400, 'height' => 300, 'start' => 200, 'end' => 100 ); $array2 = array( 'width' => 400, 'height' => 30, 'start' => 20, 'end' => 10 ); $diff = array_diff_assoc($array2, $array1); printf('Values that are lower in $array2 are: <pre>%s</pre>', print_r($diff, true));
  6. Try this rule RewriteRule ^area-([0-9]+)/[^/]+/category-([0-9]+)/ test.php?id=$1&cat_id=$2 [L] Then don't wrap parentheses around regex that you dont want to reference later on. Not relevant
  7. Because you have invalid html code, you've opened two divs but only closed one and you have wrapped the responsetext div around the closing select tag (</select>). Only <option> tags should be within a <select> tag. To make it easier I would apply the responsetext id to the select tag. <select name="customer" id="responsetext"> </select> It works when you comment out the select tags because the browser tries to fix the invalid html code (quirks mode).
  8. What do you mean by this? Have you made the changes suggested by davidannis and scootstah above?
  9. Well you need to change topsite to debtor (your database table name). Next you need to apply the pagination code to your query not the tutorial's queries. The tutorial has left comments in the code telling you what you need to do.
  10. Change <td><span class="title"><? echo $this->pagetitle;?></span></td> to <td><img src="url/to/site/logo.jpg" alt="<? echo $this->pagetitle;?>" /></td> to apply the site logo.
  11. field3 contains an empty object, which you're trying to convert to a string. PHP cannot convert an object to a string unless you define a __toString method, but that is out of your control as the api is defining the serialized object. If all need is field1 and field20 value then don't use a loop just do $product = $result->products->product; echo $product->field1; echo $product->field20; If you want to write these values to your var_dump.txt file then use $product = $result->products->product; $txt = "field1 = {$product->field1} field20 = {$product->field20}"; file_put_contents( '/vardump.txt' , $txt, FILE_APPEND );
  12. What I meant was post the code for this method (from the pagebuilder class). function showHeader($pagetitle = '') {
  13. Never used var_export. Used to the output from print_r try using foreach ($result->products->product as $field => $value) { echo $field . ' = ' . $value . '<br />'; } If you want to get each fields value manually you'd use $product = $result->products->product; echo $product->field1; //... etc ... echo $product->field20;
  14. Post the code for the showHeader method this is code you'll probably need to modify.
  15. What api are you using as the serialized array structure you posted does not seem to be in php format. What does this return printf('<pre>%s</pre>', print_r($result, true));
  16. I said that wrong. -204.1 is lower than -204. So the nearest whole number is -205
  17. Then you need to use ceil for negative numbers $part = trim($part, " <>"); $part = ($part > 0) ? floor($part) : ceil($part); floor rounds numbers down. -205 is lower than -204.1
  18. When the image is uploaded you save the images path to the database. When you want to display the image you echo the images path into the <img> tag eg echo '<img src="' . $row['image_path']; '" />';
  19. You get the selected checkbox values from the $_POST['element_0'] array. Example code to see what was selected. echo ' You have selected: ' . implode(', ', $_POST['element_0']);
  20. Define your array then serialise it using $.param. <script> $(function() { $("#btn_test").click(function(){ // key : value values = { "test_type": "any old type", "test_mode": "any mode" } $.post("sessions_set.php", $.param(values)); }); </script> In your PHP code you'd use a loop to define the $_SESSION vars foreach($_GET as $key => $value) { $_SESSION[$key] = $value; }
  21. You need to echo the variables so their values are outputted into the javascript <?php if($username && $userid) : ?> var theName = "<?php echo $username; ?>"; var theMail = "<?php echo $email; ?>"; <?php endif; ?>
  22. My code is not a copy and paste solution only a guide. I do not know how your shopping cart works so I cannot tell you where and what you need to change.
  23. Its actually 35.24 but the int rounds it down to nearest integer. Are you sure that these are the same values from the original code on the older computer?
  24. The first foreach loops through each post array within $posts. The second foreach loops over the elements (body, stamp, post_id, user_id) in the post.
  25. You just answered your question.
×
×
  • 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.