wrathican Posted June 15, 2007 Share Posted June 15, 2007 i need to enable gd library. i have done it in php.ini but when i restart my apache server i get this error: Unknown(): Unable to load dynamic library './php_gd2.dll' - The specific module could not be found. anyone know why i could be getting this? Quote Link to comment https://forums.phpfreaks.com/topic/55724-solved-gd-library/ Share on other sites More sharing options...
per1os Posted June 15, 2007 Share Posted June 15, 2007 It seems like the directory is not right, where is the php.ini file located and what is the value for the extension_dir setting in the php.ini file ??? Usually the extensions directory is /extensions not ./ the ./ would be assuming that the extensions directory houses a folder which houses the main php files. That is probably ont the case. Quote Link to comment https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275322 Share on other sites More sharing options...
wrathican Posted June 15, 2007 Author Share Posted June 15, 2007 its ok ive found how to change it. thanks for the reply though. but since i have turned on gd library i am having errors with my page. i get this: Notice: Undefined index: id in C:\Program Files\Apache Group\Apache2\htdocs\cms\cms.php on line 53 that line reads like this: $id = $_GET['id']; why is this happening? Quote Link to comment https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275335 Share on other sites More sharing options...
per1os Posted June 15, 2007 Share Posted June 15, 2007 It is just a notice, not really critical but this is how you fix it: $id = isset($_GET['id'])?$_GET['id']:''; // set default value to '' if $_GET['id'] has not been set. the ? and : are called the ternary operator in case you were wondering. Quote Link to comment https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275346 Share on other sites More sharing options...
wrathican Posted June 15, 2007 Author Share Posted June 15, 2007 hmm that made things a bit worse here is what i am using: <?php $id = $_GET['id']; if(!isset($id)) { ?>Please choose a page to edit:</p> <p><?php $query = 'SELECT cont_id, cont_title FROM cy_content'; $result = mysql_query($query); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<a href='cms.php?id={$row['cont_id']}'>{$row['cont_title']}<br>"; } } else{ $query = "SELECT * FROM cy_content WHERE cont_id='".$id."'"; $result = mysql_query($query); while ($row = mysql_fetch_row($result)) { $a = $row[0]; $s = $row[2]; $d = $row[3]; }; //echo "this will show the form."; //echo "$a<br>"; //echo "$s<br>"; //echo "$d<br>"; }; ?><form action="" method="post"> <input name="textfield" type="text" value="<?php echo $s; ?>" /> <br /> <textarea name="textarea" cols="70" rows="10"><?php echo $d; ?></textarea> <br /> <input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="clear" /> </form> in the first section of the if statement it sees if a variable is set if it isnt then it desplays a list of values from a database which are made into links that set the variable if the variable is set it shows a form with the valuse of an array inside the input fields but what is actually happening is when i load the page up a blank form is displayed, even though its not meant to be.... Quote Link to comment https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275352 Share on other sites More sharing options...
per1os Posted June 15, 2007 Share Posted June 15, 2007 hmm that made things a bit worse here is what i am using: <?php $id = $_GET['id']; if(!isset($id)) { ?>Please choose a page to edit:</p> <p><?php $query = 'SELECT cont_id, cont_title FROM cy_content'; $result = mysql_query($query); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<a href='cms.php?id={$row['cont_id']}'>{$row['cont_title']}<br>"; } } else{ $query = "SELECT * FROM cy_content WHERE cont_id='".$id."'"; $result = mysql_query($query); while ($row = mysql_fetch_row($result)) { $a = $row[0]; $s = $row[2]; $d = $row[3]; }; //echo "this will show the form."; //echo "$a<br>"; //echo "$s<br>"; //echo "$d<br>"; }; ?><form action="" method="post"> <input name="textfield" type="text" value="<?php echo $s; ?>" /> <br /> <textarea name="textarea" cols="70" rows="10"><?php echo $d; ?></textarea> <br /> <input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="clear" /> </form> in the first section of the if statement it sees if a variable is set if it isnt then it desplays a list of values from a database which are made into links that set the variable if the variable is set it shows a form with the valuse of an array inside the input fields but what is actually happening is when i load the page up a blank form is displayed, even though its not meant to be.... No you completely missed the point. I set it up on the variable declaration for a reason. $id does not need to be tested the index of $_GET at 'id' needs to be tested are you with me? Maybe this will make it clearer. <?php if (isset($_GET['id'])) { $id = $_GET['id']; }else { $id = ''; } ?> Just checking if $id isset will not do you good because of course it is set as it is being set to $_GET['id'] even if that does not have a value. The notice is being thrown because the index in $_GET at 'id' was not set. Are you with me? Quote Link to comment https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275353 Share on other sites More sharing options...
wrathican Posted June 15, 2007 Author Share Posted June 15, 2007 ahhh yes. i see thanks for that. i will implement it when i get the chance thanks Quote Link to comment https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275556 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.