Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275322
Share on other sites

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?

 

Link to comment
https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275335
Share on other sites

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....

Link to comment
https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275352
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/55724-solved-gd-library/#findComment-275353
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.