Jump to content
Larry Ullman's Book Forums

Pasting Example Code


Recommended Posts

I tried to paste a short example of code from a text file so I didn't have to type it all in but the paste options in the header don't work and the method of getting it from the clipboard doesn't work either.  Without an example accompanying the forum question there isn't enough information for someone to adequately answer.

Link to comment
Share on other sites

Okay, could someone elaborate on what is/isn't working? What is happening? etc.?


$q = 'SELECT user_id FROM access_tokens WHERE token=? AND date_expires > NOW()';
$stmt = mysqli_prepare($dbc, $q);
mysqli_stmt_bind_param($stmt, 's', $token);
if (mysqli_stmt_num_rows($stmt) === 1) {
mysqli_stmt_bind_result($stmt, $user_id);

// Create a new session ID:
$_SESSION['user_id'] = $user_id;

// Clear the token:
$q = 'DELETE FROM access_tokens WHERE token=?';
$stmt = mysqli_prepare($dbc, $q);
mysqli_stmt_bind_param($stmt, 's', $token);

Just pasted ^

Link to comment
Share on other sites

Hi Larry,


When I try and paste into the post, nothing will paste.  I tried within code tags and with no code tags.  I tried with right click paste and nothing pastes. I tried with the past button on top of the post box, but again, nothing pastes. There is no error message.


My environment is IE11 within Windows 7 64 bit.



Link to comment
Share on other sites

  • 2 weeks later...
  • 7 months later...

Test code paste with the code start and end:


	{	// opening while loop
		$prog_name = $row_outputs['prog_name']; 
		$proj_name = $row_outputs['name'];
		$projectId = $row_outputs['id'];
		$proj_array = array($projectId); 
		$proj_array_uni = array_unique($proj_array);  
		$projecty = ''; 
		foreach($proj_array as $projectile)
				$projectile = trim($projectile);
this indicates that it will paste correctly in 'Preview' - let's see if it does when I post it.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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