Jump to content

beta0x64

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

beta0x64's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I think he means an image manipulation library like imagick or gd This might do what you want, don't quote me: http://www.php.net/manual/en/function.imagickdraw-annotation.php You could save it in whatever format you desire to minimize the quality loss.
  2. $phone and $company do not have any value inherently. They must receive values sent to the script from the form by the method POST. Look here: $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Comments = Trim(stripslashes($_POST['Comments'])); This is where the variables $name, $email and $comments receive values based on the form values that have been POST'd to the script. There is no space for $phone or $company. You could solve this easily by appending $Phone = Trim(stripslashes($_POST['Phone']); $Company = Trim(stripslashes($_POST['Company']); Also, look at your form. It's a little copy and pasted, I can tell that. <label for="Email" >Company Name:</label> <br /> <input type="text" name="Company Name" id="Company" class="inputValue"/> <span class="required">*required</span><br /> <br /> <label for="Email" >Phone Number:</label> <br /> <input type="text" name="Phone Number" id="Phone" class="inputValue"/> <span class="required">*required</span><br /> needs to become <label for="Company" >Company Name:</label> <br /> <input type="text" name="Company" id="Company" class="inputValue"/> <span class="required">*required</span><br /> <br /> <label for="Phone" >Phone Number:</label> <br /> <input type="text" name="Phone" id="Phone" class="inputValue"/> <span class="required">*required</span><br /> The name attribute is what is used by $_POST, iirc. < /lecture> Here's two functions that can make learning a lot easier. var_dump or print_r. You could do a var_dump($_POST); or print_r($_POST); to get everything inside of that variable. Also if you're really in a pinch, there are many PHP tutorials on the 'net as well as youtube. You could also outsource it! A simple thing like that wouldn't have cost very much. Happy scripting!
  3. I have an idea of what might be causing this. We'll go in varying levels of severity/debugging. Try putting the reply-to immediately after the from. Make sure to \r\n it. If the new last header (Cc:) doesn't work, then you can assume that you need a final \r\n, which is normal in HTTP packets (I'm not sure about SMTP). From RFC2822 (http://www.faqs.org/rfcs/rfc2822.html),
  4. Flash is actually slow and plays flv s not avis or mpg. Also you cut out a lot of the mobile market with flash. Just do an embed. The video player is dependent on the user agent.
  5. I think you should use session variables instead but yea... If you were planning on doing it through a database query, you must watch out for them to get access by changing the ref id to malicious code... Just a warning
  6. You should check if the variables exist before referencing them otherwise. Do this with the isset method. isset($_POST["variables"]);
  7. Sourecode: <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.4.2.js"></script> <script type="text/javascript" src="jquery.tablesorter.js"></script> <script type="text/javascript" src="jquery.table2csv.js"></script> <script type="text/javascript" src="jquery.livequery.min.js"></script> <script type="text/javascript"> // we will add our javascript code here $(document).ready(function() { $("table").addClass("tablesorter").tablesorter(); $("button").livequery("click", function() { $("td input").each(function (idx, elem) { var val = $(this).attr("value"); $(this).html(val); }); $("table").table2csv({ callback: function(csva, name) { $("<form action='gridparser.php' method='post'><input type='hidden' name='filename' value='" + name + "' /><input type='hidden' name='csv' value='" + csva + "' /></form>").appendTo('body').submit().remove(); } }); }); }); </script> if you upload a csv file, then export that csv, it gives the error: Unexpected call to method or property access. jquery-1.4.2.js, line 4075 character 5 That code is: append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.appendChild( elem ); } }); }, Any clues? I tried toying with the IE8 developer tool, but to no avail.
  8. and repeat the row numbers for consistency good idea! that could be done in ajax, too though I have a feeling that the client wants to keep the page as similar to the current setup as possible (this is being exported from Excel, so a wide spreadsheet isn't a new concept
  9. I have a table for, well, displaying tabular data. However, I am curious as to how I can make the best possible user interface... See, it has many columns, and will not fit completely on one page/viewport. What makes this a little bit trickier is that I plan on having an input box at the top for queries, which will return valid rows to this interface. This means that it's pretty flexible at this point. Any ideas? Maybe I'm overcomplicating
  10. Well, there are actually many different ways you could do this, as you can imagine. I don't see why you don't do something like this: echo "<string>"; foreach ($boxdata as $bkey => $bdatum) { echo "$bkey = $bdatum<br />"; } echo "</string>"; this way you don't actually have to deal with two arrays. you can get the key right from the foreach loop
  11. What are you having trouble with figuring out? It certainly sounds like you know what you want to accomplish. I would start out by working through your code in pseudocode. That is, connect to mysql connect to db if table not exists create table numrows = number of rows foreach row in table row = random_number() for i=0;i < numrows;i++ mysql(select status, credits from table where value = i) . . . then figure out what you need to work on to make it happen
  12. What thorpe said. A lot of that could be put into functions as well. Proper spacing, functions, etc.. make for fast, clean, and easy to read (and debug) code.
  13. You have not checked if $error exists there. You only check if it is_array, assuming that it is there, but the only time $error is declared is inside the scope of your if statements. Long story short, add at the top $error = 0 or change the if statement on line 41 to if (isset($error) && is_array($error)) { Also, next time, please put your code in php tags by clicking the php button above the smilies; it's very helpful.
  14. You could use AJAX/jQuery to load the file dynamically. There are many file upload scripts available. How about like http://www.uploadify.com/demo/ ?
  15. <table border="0" cellpadding="2px" width="600px"> <?php $result=mysql_query("SELECT * FROM products"); while($row=mysql_fetch_array($result)){ ?> <tr> <td><img src="<?php $row['picture'] ?>" /></td> <td> <b><?php $row['name'] ?></b><br /> <?php $row['description'] ?><br /> Price:<big style="color:green">$ <?php $row['price'] ?></big><br /><br /> <input type="button" value="Add to Cart" onclick="addtocart(<?php $row['serial']?>)" /> </td> </tr> <tr><td colspan="2"><hr size="1" /></td> You should either use the notation <?php=$row['price']?> or use echo $row['price'], because all this does is reference the variable $row with a key, but not do anything with it. Whatever is echo'd or print'd to the user is what is displayed as HTML. Everything else is processed before the page loads. So yea. Replace those with something sensible!
×
×
  • 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.