Jump to content

crouchjay

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by crouchjay

  1. The process works in such, that when the user decides to crop an image, it gets stored in tmp.  The cropped image is displayed, where they have the choice of either NEW IMAGE, RECROP, SUBMIT Here is the code for recrop selection [code]if ($_POST['recrop']) { unset($display); unset($image);             //Path to image             $imgfile=$_REQUEST['display'];             //Image Name             $image=$_REQUEST['imgfile'];             //Delete cropped image             unlink($imgfile); } //If Image name found get Original Image if($image != "") $display="userImages/$username/largeVersion/".$image; //goto image crop html page include_once( "HTML/createProfileImage.html" ) [/code] So the original cropped image gets deleted from the file system, this has been proved, but after the second recrop of the image the original still displays until the refresh button is pushed. If there is any more code you want to see just let me know. Thanks Jay
  2. On a portion of my site the user is able to crop the images to liking, but the cropped image stays when trying to recrop the same image, but when I press the refresh button the newly cropped image replaces the previous cropped image.  How do I fix this?  Jay. Thanks a lot for the help.
  3. I am trying to delete all users from table usersonline after 30 minutes of inactivity.  The query runs, but nothing happens.  How else can I approach this? Thanks in advance Jay. [code]$query="SELECT * FROM usersonline WHERE DATE_SUB(NOW(), INTERVAL 30 MINUTE) <= LastTime";[/code]
  4. How do other sites take care of this problem? Do I need to create a deamon that checks connectivity of users every so often?
  5. I have a table for users that are currently online, how do I set them offline if they click the close browser button? Can I retrieve this action? Thanks for your help?
  6. You need to install GD 2.0 Don't worry this is very easy. You can look for instructions on the official page. Don't have it right now, but you can google it. Basicly, You find the code snip in php.ini.recommend and unmark it. <- forget the actuall word describing the action so it will look like this -> extension=php_gd2.dll instead of -> ;extension=php_gd2.dll Jay
  7. Found the problem, I am stupid. I had already moved it, I needed rename().
  8. Thanks, but unfortunately that didn't work. I also tried changing the slashes around but that didn't help either. [code] $image=new Image(); $file=$_FILES["imgfile"]['type']; $ext=$image->verifyImage($file); if(strlen($ext)>4){echo $ext; exit();}//Display error message, needs to be finished $filename='temp_img'.$ext; $image->setFilename($path_username_temp.'\\'.$filename); $error=$image->uploadImage("imgfile", $path_username_temp, '\\'.$filename); $success=move_uploaded_file($_FILES["imgfile"]['tmp_name'], 'C:\Apache2\htdocs\GP2\imageEditing\\'.$_FILES["imgfile"]['name']); if($success==false) echo "false"; else echo "true"; [/code] This is what the code looks like around it. The rest works as intended. Jay
  9. [code]$success=move_uploaded_file($_FILES["imgfile"]['tmp_name'], 'C:\Apache2\htdocs\GP2\imageEditing\\'.$_FILES["imgfile"]['name']);[/code] I have WINDOWS OS and all file directory names are correct. It returns false. Please help Thanks. Jay.
  10. I have created a value and want to post it on the next page so: [code]$value=$_POST['value']; <input type="hidden" name="<?php echo $value; ?>" /> url...?value='.$value.'[/code] but when I put the cursor over the link the value is shown blank, but I know there is a value there. Is this the correct sequence of steps if you want to save a value to use later? Jay,
  11. I want to create a new row of data, but I need the query to return the newly created rowID. How do I go about doing this? Jay,
  12. I am not sure how others due it or if there is a simplar way but you can go "DESCRIBE table" And that will return +--------------------------------------------------------------------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------+----+------+---------+------------------+ | id | int(11) | | PRI | | auto_increment | +--------------------------------------------------------------------+
  13. MySQL or maybe MyISAM table does not except the latter value. How do I get around this? $x="Dont Care" $y="Don't Care"; INSERT INTO table SET column = '$x' <----inserts INSERT INTO table SET column = '$y' <----Does not insert
  14. Thank you. Cleared up the problem.
  15. [code]mysql_connect("localhost","root") or die(mysql_error()); [/code] I am not totally sure, but I do believe you need a password in there. Jay
  16. I am trying to retrieve a value from an I frame [code]var found = window.frames[course].forms[frm1].elements[golfcourse];[/code] and then when the user presses the submit button send the variable found with the other data chosen. So basically what is happening is; I am using an Iframe to search for courses then when the user has found a course it appears in an input text field. After the user chooses the course then the proceed to the main page and finsh filling out the form. The other fields I want submitted along with the course. How do I go about doing this? Thanks in advance. Jay
  17. The following is the code. I keep getting a Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/crouchja/public_html/mysql.class.php on line 5. <?php class mysql { **I am assuming this is line 5--> private $linkID; //MySQL link identifier private $host; //MySQL server host private $user; //MySQL user private $pswd; //MySQL password private $db; //MySQL database private $result; //Query result private $querycount; //Total queries executed /* Class constuctor. Initializes the $host, $user, $pswd and $db fields. */ function mysql($host, $user, $pswd, $db) { $this->host = $host; $this->user = $user; $this->pswd= $pswd; $this->db = $db; }//End of mysql constuctor /*Connects to the MySQL database server. */ function connect() { try { $this->linkID = @mysql_connect($this->host,$this->user,$this->pswd); if (! $this->linkID) throw new Exception ("Could not connect to the database server1."); }//End of try catch (Exception $e) { die ($e->getMessage()); }//End of catch } /* Selects the MySQL database. */ function select() { try { if (! @mysql_select_db($this->db, $this->linkID)) throw new Exception("Could not connect to the database server2."); }//end of try catch (Exception $e) { die ($e->getMessage()); }//end of catch } }
  18. crouchjay

    onchange

    [!--quoteo(post=371026:date=May 3 2006, 09:22 PM:name=lead2gold)--][div class=\'quotetop\']QUOTE(lead2gold @ May 3 2006, 09:22 PM) [snapback]371026[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code] <form name="form" action="cars.php" method="get"> <SELECT name="sort" onchange="document.form.submit();"> <OPTION value="ford">ford</OPTION> <OPTION value="toyota">toyota</OPTION> </SELECT> </form> [/code] [/quote] Is there a way to do it with out the form since I already have I form? I don't want everything submitted.
  19. crouchjay

    onchange

    <SELECT "cars" onchange="window.location='cars.php?sort=value'"> <OPTION value="ford">ford</OPTION> <OPTION value="toyota">toyota</OPTION> </SELECT> I am trying to pass the selected value through. I have tried the search attribute of location, but that was false. I am really stumped. Thanks.
  20. Thank you so much, that works
  21. [!--quoteo(post=370567:date=May 2 2006, 04:52 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 2 2006, 04:52 PM) [snapback]370567[/snapback][/div][div class=\'quotemain\'][!--quotec--] OK, so who cares about the x and y values? Surely these are separate images - one for delete and the other for add and they have different names so you can tell which was clicked. [/quote] <form action="test3.php" method="post" > <input type="checkbox" name="languages[]" value="csharp" />C# <br /> <input type="checkbox" name="languages[]" value="jscript" />jscript <br /> <input type="checkbox" name="languages[]" value="perl" />perl <br /> <input type="checkbox" name="languages[]" value="php" />php <br /> <input name="delete" type="image" src="images/delete_btn.gif"/> <input name="submit" type="image" src="images/send_btn.gif"/> </form> if(isset($_POST['submit'])) { echo "You chose the following languages. <br/>"; foreach($_POST['languages'] AS $language) echo "$language<br/>"; } if(isset($_POST['delete'])) { echo "has been deleted. <br/>"; foreach($_POST['languages'] AS $language) echo "$language<br/>"; } echo "hello"; this is my code that I am testing with, but nothing happens accept that it prints hello any time I press either.
  22. [!--quoteo(post=370542:date=May 2 2006, 03:34 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 2 2006, 03:34 PM) [snapback]370542[/snapback][/div][div class=\'quotemain\'][!--quotec--] The x and y values will always be the coordinates of where the user clicked the image reative to its upper-left corner. You can't change that! You can't expect a user to click the correct pixel. You can't get "several" values with one click. Explain what you're trying to do and we'll help. [/quote] Instead of using regular submit buttons I want to use images, but I have 2 things that needs to happen, one is either delete selected items or add selected items. Thanks.
  23. I am using an image for a button but when calling if(isset($_POST['delete.x=x-value'])) I know that the values that are passed are x 0-50 and y 0-10, but that is the image dimensions. How do I make x several values instead of hoping the user clicks on the right pixel? Should the x and y values be different form the image? Thanks.
  24. this is my two sets of code snipets. I can get it to work when both are type submits but not as images. How do I go about this? Thank you. <form action="test3.php" method="post" > <input type="checkbox" name="languages[]" value="csharp" />C# <br /> <input type="checkbox" name="languages[]" value="jscript" />jscript <br /> <input type="checkbox" name="languages[]" value="perl" />perl <br /> <input type="checkbox" name="languages[]" value="php" />php <br /> <input name="submit" type="image" src="images/submit_btn.gif" /> <input name="delete" type="image" src="images/delete_btn.gif" /> </form> if(isset($_POST['submit'])) { echo "You chose the following languages. <br/>"; foreach($_POST['languages'] AS $language) echo "$language<br/>"; } if(isset($_POST['delete'])) { echo "has been deleted. <br/>"; foreach($_POST['languages'] AS $language) echo "$language<br/>"; }
×
×
  • 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.