Jump to content

Seamless

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Seamless's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok, i edited my php.ini to show errors and this is the error i get even though i have increased the memory_limit in the php.ini to 128MB [quote] Allowed memory size of 134217728 bytes exhausted (tried to allocate 15488 bytes) [/quote] I'm getting a bit nervous now, i've never altered the memory_limit so i have a few questions: 1. Is there a maximum i can increase it to? 2. What are the effects of increasing it? Seamless
  2. i'm not getting one, the server i'm using has errors turned off by default. Is there a statement i can use which will display an error like mysql_error(); does? I don't really want to have to go in and edit my php.ini, but if i have to i suppose i can. Seamless
  3. cheers for the thought but i have checked 'post_max_size' its set at 8MB and upload_max_filesize is set to 10MB. Thats why i'm a bit stuck, could it be the execution time perhaps?
  4. hi, i'm not an expert but i don't think the error you have quoted relates to the code you are showing. but regarding the error you are showing (correct me if i am wrong) doesn't the less than or equal to have to be like this: =< Seamless.
  5. Hi, I have written a page to parse the uploading of images. I usually test it with the default images you get with windows XP (you the sunset one etc..) and everything worked fine... It uploads the image resizes the original outouts it and then creates a thumbnail and again outputs it. Until... I tried uploading a larger jpeg (3.1Mb) it uploads it to the php tmp directory and it gets as far as [code] imagejpeg($image_p,$target,$jpegqual); [/code] and gives up. here's a snippet from the page, like i said everything works fine until the imagejpeg part. [code] if($filetype == "image/pjpeg" or $filetype == "image/jpeg"){ list($orig_width, $orig_height) = getimagesize($tmp_name); $ext = ".jpg"; $target = $uploaddir.$new_name.$ext; $target_small = $uploaddir."thumbs/".$new_name.$ext; $width = $orig_width; $height = $orig_height; $width_small = $orig_width; $height_small = $orig_height; // RESIZE LARGE IMAGE if($height > $max_height){   $width = ($max_height / $height) * $width;   $height = $max_height; } if($width > $max_width){   $height = ($max_width / $width) * $height;   $width = $max_width; } $image_p = imagecreatetruecolor($width, $height)or die("Cannot Initialize new GD image stream"); $image = imagecreatefromjpeg($tmp_name)or die("Cannot Initialize new GD image stream2"); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height); imagejpeg($image_p,$target,$jpegqual); [/code] i've checked the syntax and i don't think its that does anyone have any ideas?? Thanks in advance Seamless.
  6. Thanks for your suggestions i am using a session for the users to login anyway so that is probably the best solution. Although i kinda wanted to solve the problem rather than create a workaround. But you just triggered my memory when you mentioned headers i had not included [code] header("Cache-control: private"); [/code] beneath session_start(); at the top of the two pages, so i have added it and that has solved the problem! I don't know why i did not include it as i usually do. A lesson learnt for me now, i won't be making that mistake again! Thanks for your help Seamless
  7. cheers for the reply. there are 2 seperate files: 1. form.php 2. form-parse.php your part right -  a form on form.php posts variables to form-parse.php. I think you are a little confused about the next part, maybe my explaination wasn't very good... Here's the script my form posts its variables to - form-parse.php [code] <? $x = 0;     $form_error = " "; if(!$_POST[customer]){ $form_error .= "<p>A customer is required.</p>"; $x++; } if(!$_POST[cust_contact]){ $form_error .= "<p>A customer contact is required.</p>"; $x++; } if($_POST[cust_contact_email]){ if(!validate_email($_POST[cust_contact_email])){ $form_error .= "<p>A valid email address must be entered for the customer contact email.</p>"; $x++; } } if(!$_POST[part_des]){ $form_error .= "<p>A Part Description is required.</p>"; $x++; }     if(!$_POST[change_des]){ $form_error .= "<p>Details of the change is required.</p>"; $x++; } if(!$_POST[effects_des]){ $form_error .= "<p>Effects of the change is required.</p>"; $x++; } if($_POST[action1] == "0" or $_POST[action_by1] == "0" or $_POST[custom_action1] == ""){ $form_error .= "<p>At least 1 action must be selected.</p>"; $x++;     } if($x > 0){ echo "<p><b>Please correct the errors below.</b></p><br />"; echo "$form_error"; echo "<form action=\"create-change.php\" method=\"post\"> <input type=\"hidden\" name=\"customer\" value=\"$_POST[customer]\" /> <input type=\"hidden\" name=\"cust_contact\" value=\"$_POST[cust_contact]\" /> <input type=\"hidden\" name=\"cust_contact_email\" value=\"$_POST[cust_contact_email]\" /> <input type=\"hidden\" name=\"part_des\" value=\"$_POST[part_des]\" /> <input type=\"hidden\" name=\"cust_part_number\" value=\"$_POST[cust_part_number]\" /> <input type=\"hidden\" name=\"bwm_num\" value=\"$_POST[bwm_num]\" /> <input type=\"hidden\" name=\"samples\" value=\"$_POST[samples]\" /> <input type=\"hidden\" name=\"cost_charge\" value=\"$_POST[cost_charge]\" /> <input type=\"hidden\" name=\"cust_order_num\" value=\"$_POST[cust_order_num]\" /> <input type=\"hidden\" name=\"total_cost\" value=\"$_POST[total_cost]\" /> <input type=\"hidden\" name=\"change_des\" value=\"$_POST[change_des]\" /> <input type=\"hidden\" name=\"effects_des\" value=\"$_POST[effects_des]\" /> <input type=\"hidden\" name=\"delivery\" value=\"$_POST[delivery]\" /> <input type=\"hidden\" name=\"compatibility\" value=\"$_POST[compatibility]\" /> <input type=\"hidden\" name=\"action1\" value=\"$_POST[action1]\" /> <input type=\"hidden\" name=\"custom_action1\" value=\"$_POST[custom_action1]\" /> <input type=\"hidden\" name=\"action_by1\" value=\"$_POST[action_by1]\" /> <input type=\"hidden\" name=\"action2\" value=\"$_POST[action2]\" /> <input type=\"hidden\" name=\"custom_action2\" value=\"$_POST[custom_action2]\" />                 <input type=\"hidden\" name=\"action_by2\" value=\"$_POST[action_by2]\" />                 <input type=\"hidden\" name=\"action3\" value=\"$_POST[action3]\" /> <input type=\"hidden\" name=\"custom_action3\" value=\"$_POST[custom_action3]\" /> <input type=\"hidden\" name=\"action_by3\" value=\"$_POST[action_by3]\" />                 <input type=\"hidden\" name=\"action4\" value=\"$_POST[action4]\" /> <input type=\"hidden\" name=\"custom_action4\" value=\"$_POST[custom_action4]\" /> <input type=\"hidden\" name=\"action_by4\" value=\"$_POST[action_by4]\" />                 <input type=\"hidden\" name=\"action5\" value=\"$_POST[action5]\" /> <input type=\"hidden\" name=\"custom_action5\" value=\"$_POST[custom_action5]\" /> <input type=\"hidden\" name=\"action_by5\" value=\"$_POST[action_by5]\" />                 <input type=\"hidden\" name=\"action6\" value=\"$_POST[action6]\" /> <input type=\"hidden\" name=\"custom_action6\" value=\"$_POST[custom_action6]\" /> <input type=\"hidden\" name=\"action_by6\" value=\"$_POST[action_by6]\" />                 <input type=\"hidden\" name=\"action7\" value=\"$_POST[action7]\" /> <input type=\"hidden\" name=\"custom_action7\" value=\"$_POST[custom_action7]\" /> <input type=\"hidden\" name=\"action_by7\" value=\"$_POST[action_by7]\" />                 <input type=\"hidden\" name=\"action8\" value=\"$_POST[action8]\" /> <input type=\"hidden\" name=\"custom_action8\" value=\"$_POST[custom_action8]\" /> <input type=\"hidden\" name=\"action_by8\" value=\"$_POST[action_by8]\" />                 <p><input type=\"submit\" value=\"Back\" /></p> <p><b>NOTE: </b>If you don't use the Back button above, you will have to fill out the change form again!</p> </form>";     }else{ // if no errors process the data } [/code] You can see that i've added a form with hidden fields so that when the back button on the form is clicked it posts the data back to the original form on form.php What i'm trying to get at is - I shouldn't need to have that form with hidden fields on form-parse.php because when you hit the back button on the browser the post variables should appear back in the form on form.php like it does on the website i have which is not on an intranet.
  8. Hi, I wonder if any one can help me.. I am developing a drawing register for the company i work for on our intranet. We recently got a new server (Windows 2003) and IIS6, so i installed PHP and MySQL on it. When a user fills in a web form (i'll call it form.php) on the intranet i make the form post the variables to another file (i'll call this one form-parse.php) which parses the data. If they have not entered the required information i display the form errors on the form-parse.php telling them to go back to the original form and fill in the required fields. My problem is that when a user clicks the back button on the browser (from form-parse.php to form.php) after getting an error for not entering data in a required field the $_POST variables are lost and they have to fill in the complete form again. I have included value="<? echo $_POST[variable1];?>" for each of the relevant <input> tags in the original form. I have managed to work around this for now by displaying a "Back" button under the errors which posts hidden post data back to form.php, but this is quite long winded and in my opinion unneccessary. I have not come across this problem before after using a few different web hosting companies.... Could it be a setting in the php.ini file or is this something to do with the server settings and this post is in the wrong forum completely. Thanks in advance Seamless
  9. your absolutely right, i think i was reading into it too much. A new revision would also have a new date (later date). Thanks for your help.
  10. I have been developing an engineering drawing register on a companies intranet. This enables a user to upload a drawing and enter the drawing details. The drawing itself (PDF) is uploaded to the server and the data entered into the MySQL database. I have written some php code to do a search on the drawing database e.g. customer search. The trouble is some customers when issuing a new drawing to the company don't update the revision number only the date of the drawing. Here's my problem: I need a MySQL statement to select the drawings with the highest revsion AND the most recent date. Here's what i have so far. [code] <? $search_vals = array("drg_desc", "drg_num", "cust_id"); while (list ($key, $value) = each ($HTTP_POST_VARS)) { if (in_array ($key, $search_vals)) { if (is_numeric($value) and!empty($value)) { $addtosql .= " $key LIKE '%$value%' AND"; $get_val .= "$key=$value&amp;"; }elseif(!is_numeric($value) and!empty($value)){ $newval = urlencode($value); $topost .= "&$key=$newval"; //used later in reposting $value = addslashes($value); $addtosql .= " $key LIKE '%$value%' AND"; $get_val .= "$key=$value&amp;"; } //fi } //fi } //wend $addtosql = substr("$addtosql", 0, -3); $sql = "SELECT cust_id, drg_num, drg_desc, max(rev) as rev, drg_date, date, filename FROM drawings WHERE $addtosql GROUP BY drg_num"; ?> [/code] There are 3 search fields - drg_desc (Drawing Description), drg_num (Drawing Number) and cust_id (Customer). The above code will select all drawings with the highest revision according to what is entered into the search fields BUT it if there are 2 drawings with the same details but one has a more recent date, it doesn't neccessarily select the latest drawing. So to simplify how do i add a max(drg_date) to the SQL statement to make the query select drawings with the highest revision and the most recent date.
  11. Hi, when extracting data from my database, i have placed and IF statement to output the results. For example in the db column 'city' i have set the default to '0', when a user updates their information they often input what i expect and that is their City. So i inserted an IF statement shown below: [code] <?php //db connection info etc.. if($row[city] == "0"){ // the user did not input their city   echo "<p>Not Given</p>"; }else{ // the user inserted information   echo "<p>$row[city]</p>"; } ?> [/code] While browsing through my database i noticed that some users 'city' columns contain nothing, which is ok, because it is not a required field in my form. So i modified my IF statement below: [code] <?php //db connection info etc.. if($row[city] == "0"){ // the user did not input their city   echo "<p>Not Given</p>"; }elseif($row[city] == ""){ // the db column conatins nothing   echo "<p>Not Given</p>"; }else{ // the user inserted information   echo "<p>$row[city]</p>"; } ?> [/code] But this does not seem to work. I don't know if the user entered nothing or if they entered a space or even if using the "" in my code is correct. Now i could correct this when i parse the form by adding an if statement stating: [code] <?php if(!isset($_POST[city]){   $city = "0"; } ?> [/code] But once again if it contains a space how do specifiy that in my if statement. I hope some one can shine some light on this for me, Thanks in advance Seamless
  12. [!--quoteo(post=372574:date=May 9 2006, 08:29 AM:name=v3x)--][div class=\'quotetop\']QUOTE(v3x @ May 9 2006, 08:29 AM) [snapback]372574[/snapback][/div][div class=\'quotemain\'][!--quotec--] Dumb question but how do you make it execute a PHP script? [/quote] well after some research i'm entering this into my cron settings via cpanel: curl -s -o /dev/null [a href=\"http://www.my-website.com/crons/check-links.php\" target=\"_blank\"]http://www.my-website.com/crons/check-links.php[/a] i'm not getting an email now saying there is an error, so can i assume that as long as the php script is correct its doing its job? Seamless.
  13. [!--quoteo(post=372296:date=May 8 2006, 10:36 AM:name=Lofty)--][div class=\'quotetop\']QUOTE(Lofty @ May 8 2006, 10:36 AM) [snapback]372296[/snapback][/div][div class=\'quotemain\'][!--quotec--] If Ober's answer doesn't, check with your ISP. Many ISP's disable user crons, but when talked to nicely will set individual ones up foryou. [/quote] I've set chmod on all my cron file to 777 and i am now getting different errors: /home/my-username/www/my-website/crons/check-links.php: line 1: ? : No such file or directory /home/my-username/www/my-website/crons/check-links.php: line 2: : command not found /home/my-username/www/my-website/crons/check-links.php: line 3: =: command not found /home/my-username/www/my-website/crons/check-links.php: line 3: : command not found /home/my-username/www/my-website/crons/check-links.php: line 4: =: command not found /home/my-username/www/my-website/crons/check-links.php: line 4: : command not found /home/my-username/www/my-website/crons/check-links.php: line 5: =: command not found /home/my-username/www/my-website/crons/check-links.php: line 5: : command not found /home/my-username/www/my-website/crons/check-links.php: line 6: =: command not found /home/my-username/www/my-website/crons/check-links.php: line 6: : command not found /home/my-username/www/my-website/crons/check-links.php: line 7: : command not found /home/my-username/www/my-website/crons/check-links.php: line 9: syntax error near unexpected token `(' /home/my-username/www/my-website/crons/check-links.php: line 9: `$connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") or die ("Couldn't connect to server."); ' The files are php, and if i access them via a browser they work correctly that way, am i doing something else wrong? Thanks Seamless
  14. Hi There, i wonder if anyone can help me.... i have some php scripts in a directory on my web server and want them to run and specific times using a cron tab. I thought i had set them up correctly but the email confirmation it sends when it performs a cron says: /bin/sh: line 1: /home/my-username/public_html/my-website/crons/check-links.php: Permission denied what am i doing wrong? can anyone shed some light on it. Thanks in advance Seamless.
  15. hmmm, maybe i'll look into that :P Cheers Liam...
×
×
  • 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.