Jump to content

Richzilla

Members
  • Posts

    61
  • Joined

  • Last visited

    Never

Everything posted by Richzilla

  1. Thanks chaps. Worked perfectly. You work fast!!
  2. Hi All, i'm kinda new to javascript and have avoided it for my much prefered php. I'm trying to write a very simple script to rotate our shopping surveys. i want Shopzilla and pricegrabber to appear on different days. I'm getting errors on the following code - <script type="text/javascript"> <!-- var d=new Date(); theDay=d.getDay(); shopzilla="<script language="JavaScript" src="https://evaleu.shopzilla.com/js/pos_xxxxx.js" type="text/javascript"></script>"; pricegrabber="<script type="text/javascript" src="https://www.pricegrabber.com/rating_merchrevpopjs.php?retid=xxxx"></script> <noscript><a href="https://www.pricegrabber.com/rating_merchrev.php?retid=xxxx" target=_blank><img src="https://images.pricegrabber.com/images/mr_noprize.jpg" border="0" width="272" height="238" alt="Merchant Evaluation"></a></noscript>"; switch (theDay) { case 1: document.write(shopzilla) break case 2: document.write(pricegrabber) break case 3: document.write(shopzilla) break case 4: document.write(pricegrabber) break case 5: document.write(shopzilla) break case 6: document.write(pricegrabber) break case 0: document.write(shopzilla) break } //--> </script>
  3. I do have GSD installed after all!! SO the questions is what's the best way to resize my images? ANy good sites with tutorials?
  4. http://www.jungletekno.co.uk/phpinfo.php
  5. I have MySql version 5.0 How do i find out if GD has been installed?
  6. Hey all, I'm uisng PHP to upload image files to my site through a form. The filename is added to my database so i can refference the image. I now need to be able to keep this file and also resize it to a uniform size. I have been looking around for hours trying to find a script that works, but no luck yet. I don't have access to my server so I can't install GD. I can see that there are other tools in PHP that allows me to do what I want to do. Anyone got any good scripts that I can use please?
  7. Bump. All i need to do is work out a way of resizing images that are on my server and then reuploading them. Anyone know how to do this?
  8. Yes it does seem pointless as many residential internet users don't have fixed IP addreses
  9. Hi All, Back again. This time I'm really stuck. So, I'm currently uploading an image from a forms page along with the information to my server and also adding the filename etc to my sql database. I'm checking that the files are only jpg and gif files and that they are less than 3MB in size. I'd like to now resize this image and upload alsoto the same location as the large image but with the extension _small. e.g - largeimage_small.gif So essentially I'd like to add the large image to the server and also the small resized image (max 150 pixel width). I can find a way of resizing the image by opening it as is below. So far the script for upload the image is working really well. Now I need to have the smaller image version added also. Any help would be greatly apprecaited. You're all such wizards and I'm still a mear novice. Here's the code - [code <? $event = $_POST['event']; $date = @$_POST['date']; $flyer = @$_POST['uploaded']; $user="xxxx"; $pass="xxxx"; $host = "xxxx"; $dbase="xxxx"; $table = "events"; mysql_connect($host,$user,$pass); mysql_select_db($dbase) or die("Unable to select database"); $query = "SELECT * FROM events WHERE event ='$event'"; if ($result = mysql_query($query) or die(mysql_error()) > 0) { if (mysql_num_rows($result)) { echo "Error : This event is already in the database"; } else { $filename = basename($_FILES['uploaded']['name']); if((!empty($_FILES["uploaded"])) && ($_FILES['uploaded']['error'] == 0)) { $tag = "events"; $ext = substr($filename, strrpos($filename, '.') + 1); $goback = "<a href=\"http://www.mysite.co.uk/add_event.php\">back</a>"; if (($ext == "jpg") || ($ext == "gif") && ($_FILES["uploaded"]["size"] < 3000000)) { $newname = dirname(events).'/upload/'.$filename; if (!file_exists($newname)) { //Attempt to move the uploaded file to it's new place if ((move_uploaded_file($_FILES['uploaded']['tmp_name'],$newname))) { echo "You have successfully entered the following information into the database - <br> <br> Event : $event <br>Date : $date <br>Flyer : "; $query = "INSERT INTO events VALUES ('','$event','$date','','$tag$newname')"; $result = mysql_query($query) or die(mysql_error()); // How do I now open the image to resize it??? $image = open_image('$tag$newname'); $width = imagesx($image); $height = imagesy($image); $new_width = 150; $new_height = $height * ($new_width/$width); $image_resized = imagecreatetruecolor($new_width, $new_height); imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); //How do I now move the file to my server and also add the filename to my database?? mysql_close(); } else { echo "Error: A problem occurred during file upload! Please go $goback and try again"; } } else { echo "Error: File ".$_FILES["uploaded"]["name"]." already exists. Please rename and go $goback and try again"; } } else { echo "Error: Only jpg and gif files under 3MB are accepted for upload. <br> Go $goback and try again"; } } else { $query = "INSERT INTO events VALUES ('','$event','$date','','')"; $result = mysql_query($query) or die(mysql_error()); echo "You have successfully entered the following information into the database - <br> <br> Event : $event <br>Date : $date <br>"; mysql_close(); } }} ?> code]
  10. sorry my bad. i must have somehow cahnged the GET to POST and hence it wasn't pulling in the right ID number. What a plonker!!
  11. sorry, yes I've changed that. however, now nothing is gettig echoed in the result, nor is it giving me any errors. anything else you can see?
  12. Over night having changed nothing on my server and my php page I cannot add anything through scripts to my database. The script I was using to great success is below. For absolutely no apparent reason I can no longer update anything to the mySQL databse. Nothing has changed on the working page. I don't even get any error messages, such as cannot connect etc. Is there anything in the setup or admin of mySQL that can be causing this? Essentially, the script below is updating data on the database from a form on the previous page. I'm then echoing out the new result which is correct. However, when going back to the previous page the old data is still there and the database remains unchanged!! What is going wrong??? [code<? $id = $_POST['id']; $event = $_POST['event']; $date = $_POST['date']; $user="xxxx"; $pass="xxxx"; $host = "xxxx"; $dbase="xxxx"; mysql_connect($host,$user,$pass); @mysql_select_db($dbase) or die("Unable to select database"); $query = "UPDATE events SET event='$event' , date='$date' WHERE id='$id'"; $result = mysql_query($query) or die(mysql_error()); $query = "SELECT * FROM events WHERE id='$id'"; $result=mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $event = $row['event']; $date = $row['date']; } mysql_close(); ?> <? $page = $_GET['id']; $link = "<a href=http://www.mysite.co.uk/update_event.php?id="; $goback = ">go back</a>"; ?> <br> <table width="900" border="0" align="center"> <tr><td> <span class="trk_list_headers">You have updated the following information on the database : <br /></span>: </td> <table width="900" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="30%" align="left"><span class="time_main_text">Event : </span></td> <td width="70%" align="left"><span class="style1"><? echo $event ?></span> <br></td> </tr> <tr> <td width="30%" align="left"><span class="time_main_text">Date : </span></td> <td width="70%" align="left"><span class="style1"><? echo $date ?> </span><br><br /></td> </tr> <tr> </td> <table width="900" align="center"><span class="time_main_text">If this information was incorrect please <? echo "$link$page$goback" ?> and correct the error. </span></td> </table>
  13. Here's a script that took me about a week to write. It's a method of uploading images through php into my webserver and adding the file names and locations to the sql database - <? $event = $_POST['event']; $date = @$_POST['date']; $flyer = @$_POST['uploaded']; $user="xxxx"; $pass="xxxx"; $host = "xxxx"; $dbase="xxxx"; $table = "events"; mysql_connect($host,$user,$pass); @mysql_select_db($dbase) or die("Unable to select database"); $query = "SELECT * FROM $table WHERE event ='$event'"; if ($result = mysql_query($query) or die(mysql_error()) > 0) { if (mysql_num_rows($result)) { echo "Error : This event is already in the database"; } else { $filename = basename($_FILES['uploaded']['name']); if((!empty($_FILES["uploaded"])) && ($_FILES['uploaded']['error'] == 0)) { $tag = "events"; $ext = substr($filename, strrpos($filename, '.') + 1); $goback = "<a href=\"http://www.mysite.com/add_event.php\">back</a>"; if (($ext == "jpg") || ($ext == "gif") && ($_FILES["uploaded"]["size"] < 3000000)) { $newname = dirname(events).'/upload/'.$filename; if (!file_exists($newname)) { //Attempt to move the uploaded file to it's new place if ((move_uploaded_file($_FILES['uploaded']['tmp_name'],$newname))) { echo "You have successfully entered the following information into the database - <br> <br> Event : $event <br>Date : $date <br>Flyer : "; $query = "INSERT INTO events VALUES ('','$event','$date','','$tag$newname')"; $result = mysql_query($query) or die(mysql_error()); mysql_close(); } else { echo "Error: A problem occurred during file upload! Please go $goback and try again"; } } else { echo "Error: File ".$_FILES["uploaded"]["name"]." already exists. Please rename and go $goback and try again"; } } else { echo "Error: Only jpg and gif files under 3MB are accepted for upload. <br> Go $goback and try again"; } } else { echo "You have successfully entered the following information into the database - <br> <br> Event : $event <br>Date : $date"; } }} ?> form page before - <form enctype="multipart/form-data" action="/events/event_ul.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="3000000" /> <tr> <td width="30%" align="left"><span class="time_main_text">Rave : </span></td> <td width="70%" align="left"><span class="style1"><input type="text" name="event" /><br> </tr> <tr> <td width="30%" align="left"><span class="time_main_text">Date : </span></td> <td width="70%" align="left"><span class="style1"><input type="text" name="date" /><br> </tr> <tr> <td width="30%" align="left"><span class="time_main_text">Flyer Image : </span></td> <td width="70%" align="left"><span class="style1"><input name="uploaded" type="file" /><br /></span></td> </tr> <br /> <tr> <td width ="30%" valign="top" align="center"><input name="UPDATE" type="submit" class="trk_list_main" id="UPDATE" value="Submit"/><input name="Clear" type="reset" class="trk_list_main" id="Clear" value="Reset"/></td> </form> Please don't ask me to descibe all this. I hope it's quite self explanatory. I have no idea about AJAX so I'll leave that one alone.
  14. thanks for the quick responses, sadly the first response has a syntax error where there's a missing } closing the first statement. The second code causes this error - Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
  15. Hi All. I'm trying to stop my file upload system adding the same files to my database. The script below is a much simplified version of what I'm using. It's getting frustrating as I can't get this to work. I have a page previosu to this that posts up the details form a previous form. The form and everything works fine apart from the duplicate check. <? $event = @$_POST['event']; $date = @$_POST['date']; $flyer = @$_POST['uploaded']; $user="xxxxx"; $pass="xxxxxx $host = "xxxxx"; $dbase="xxxxx"; $table = "events"; mysql_connect($host,$user,$pass); @mysql_select_db($dbase) or die("Unable to select database"); $query = "SELECT FROM events WHERE event ='$event'"; $result = mysql_query($query); if ($result !== FALSE){ echo "Error : This event is already in the database"; } else { echo "This is a new event"; } ?>
  16. Hi all, Sorry to post this in this section, but there wasn't one for p3p privacy certificates. I'm sure most of you all are aware of what this as I truely hope you can help me. I run a search marketing agency and are having some issues with the p3p privacy policy and IE7. We have setup our privacy policy and everything works fine with IE6 and FF2, however we still have cookie blockages with IE7. I'm at a loss as to how to proceed from here. Here's our privacy policy - http://feeds.shopsubmit.co.uk/w3c/p3p.xml According to the p3p validator we have a syntx error - http://validator.w3.org/p3p/20020128/p3p.pl?uri=http%3A%2F%2Ffeeds.shopsubmit.co.uk Any idea what we are doing wrong and how can i get our cookies unblocked in IE7? All that we are doing is setting a cookie of 30 day length on the persons browser so when they go to checkout we know who the referrer was. The cookie contains the ID information of the referrer and the product ID of the item clicked. Our tracking then sends back information from the mercahnts receipt page which includes, order total, number of units bought and the orderd ID number. Nothing more than that. So essentailly the question is, have we set the p3p xml up correctly? Please help as we are losing revenue every minute that this isn't fixed. Thanks for reading.
  17. Hi Team, Thank you all so much for the help. The actual reason for all this headache is that those b@starrds at Microsoft make you jump through hoops to set a cookie on someones browser. We have to setup a p3p.xml file to get validation for our cookie. It's proving to be almost impossible. Does anyone know who to ask to help us out? I've been doing it all day and I'm about ready to scream and go crazy!! If any of you lot know, here's the problem - Header http setup for the http://feeds.shopsubmit.co.uk/ProcessProductCheckout.ashx file <% Response.AddHeader 'P3P', 'policyref="http://feeds.shopsubmit.co.uk/w3c/p3p.xml", CP="NON DSP ADM DEV PSD CUSo OUR IND STP PRE NAV UNI"' %> <%@ WebHandler Language="C#" CodeBehind="ProcessProductCheckout.ashx.cs" Class="ShopSubmitWeb.ProcessProductCheckout" %> p3p.xml file - http://feeds.shopsubmit.co.uk/w3c/p3p.xml Bascially it's saying that the cookie is invalid as it can't find the privacy document which is clearly stated a the top of our xml file. I'm going crazy over this!!!
  18. Hi All, The AJAX code hasn't worked. We have decided to go back to square 1 with all of this. The single pixel call is working on some sites but not on others. There really is absolutely no explanation for this. The code for the call is below - <!---- Shop Submit Tracking Code ----> <?php $_SERVER['REQUEST_TIME']; $ts = date(U); echo "<img border=\"0\" src=\"http://mysite/ProcessProductCheckout.ashx?mId=77&cs=".$costvar."&it=1&oi=".$order_id."&timestamp=".$ts."\" />"; ?> <!---- End Shop Submit Tracking Code ----> When this code runs it assimilates the data correctly and as far as i can see it should work, but it doesn't. This works 100% in Firefox and on some sites in IE. WHat is possibly going wrong? We've gone round and round in circles on this for a week and no solution is imminent. Is there anything that we can do now?
  19. Hi All, Thanks very much for your input. The change of image has sadly not worked. I fear that this mercahnts server is stopping any tracking calls using images. It's very strange, but even a very simple page that works on other sites doesn't with this merchant. I like the idea of the AJAX above. Any chance you can ammend the code so that it includes the tracking call? I have no idea about AJAX and I have no idea whre to put the call. Thnaks for the help so far guys. I feel that we are very close.
  20. Thanks for the input Kat, but the timestamp info at the end is there to do that. That didn't work either. The error now is with the javscript. I have a feeling that - 'new ActiveXObject' is teh source of the problem. Any further ideas people?
  21. I have recently setup a web marketing agency, but our tracking scripts are having some major issues. We have 2 codes which we place onto the mercahnts website. 1 is a Javascript and the other is a 1x1 pixel tracking call to our database. The problem is that we cannot get the tracking code to work with both versions of internet explorer. Sadly the majority of shoppers use IE as opposed to Firefox. Here's the codes - mId = merchant number cs = basket value it = items ordered oi = purchase number This goes in the header - <SCRIPT type="text/javascript"> function getCheckoutUrl(mId, cs, it, oi) { if (document.all) { var ticks = new Date().getTime(); var urlStr = "http://mysite/ProcessProductCheckout.ashx?mId=" + mId + "&it=" + it + "&oi=" + oi + "&cs=" + cs + "&tm=" + ticks; xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP"); if (xmlHttpRequest!=null) { xmlHttpRequest.open("GET", urlStr); xmlHttpRequest.send(null); } } } </SCRIPT> This goes into the body onload tag - <BODY onLoad="getCheckoutUrl(77, <?php echo $prodprice; ?>, 1, <?php echo $ordID; ?>);"> This is the main body - <!-- BEGIN my site tracking code --> <?php $_SERVER['REQUEST_TIME']; $ts = date(U); $browser = $_SERVER['HTTP_USER_AGENT']; if (!(stristr($browser, 'MSIE'))) { echo "<img border=\"0\" src=\"http://mysite/ProcessProductCheckout.ashx?mId=77&cs=".$prodprice."&it=1&oi=".$ordID."&timestamp=".$ts."\" />"; } ?> <!--end tracking code--> So basically, the script in Firefox produces the pixel link and sends through the order inforamtion. Under IE the javascript doesn't work. We started off using just the pixel image for both IE and Firefox, but we found that the image was being cached under IE and not calling for a new image. Overall IE is causing us massive issues. Does anyone have a solution to the above code? Any help would be massively apprecaited.
  22. I'm not using checkboxes or specific feilds to destinguish between columns. It's just standard search box. I want to search for any number of different values. Effectively i need to use a AND/OR statement for the selection of the fields, however i don't think this is possible.
  23. try removing this part and see what happens - (user_id, user_name, user_pass, user_sec)
  24. When conducting a php sql search i get some great results, however i want to expand my results so that when multiple search terms are added it will display all relevant fields. $query = "SELECT * FROM Mixes WHERE dj LIKE '%$var%' OR event LIKE '%$var%' OR tracklist LIKE '%$var%' OR date LIKE '%$var%' ORDER BY event ASC"; From the above search i can only get single results from 1 field. I want to be able to seperate the search term into individual items that can be referrenced in the database. So for example i search for a dj name and also an event they play at i get zero results, however if i search for them individually i get the results i want. How do i expand the code to display the result of both the dj and the event or any of the other fields? I presume that i need to be able to set each search item into an individual variable and then use them to search. Any ideas?
×
×
  • 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.