Jump to content

Get info from a post


fife

Recommended Posts

Hi.  I have built a form on a page call join.php  On this form I pass a variable in this manner;

 

 $url = "thankyou.php?val_id=".$validation."";        
header("Location: {$url}");  

 

So on the next page (which is the thankyou for registering page I want this page on load to find the user from the $validation and then email the user.  I have done this many times but for some reason this time the output is "No database selected!"  There really is though.  Also I can see in the browser window the code I have passed so its not like that is not working!  Here is the code,  can anyone see my error because I just have no idea whats up!

 

 

<?php  include(thedatabase.php'); 
session_start(); 

$val_id = $_GET['val_id'];
$FullRec__query=sprintf("SELECT * FROM users WHERE val_id= %s", $val_id);
$FullRec = mysql_query($FullRec__query) or die(mysql_error());
$userInfo = mysql_fetch_array($FullRec);

  
  $user = $userInfo['username'];
  
  
  mail($userInfo['email'],"Validation Link From Us","Dear ".$userInfo['username'].",\n\nThank you for signing up to www.thesite.co.uk. Please find below you validation link to gain access to the site.\n\n  link:\nhttp://www.thesite.co.uk/val_entrance.php?validation_id=" . $_GET['val_id'] . "\n\nTeam site\n\n\n\nFor a full list of terms and conditions please go to the main area on your page and click the terms at the bottom of the page!");
?>

Link to comment
Share on other sites

<?php

$hostname_thebizconnect = "name";
$database_thebizconnect = "database";
$username_thebizconnect = "user";
$password_thebizconnect = "password";
$thesite = mysql_pconnect($hostname_name, $username_thebizconnect, $password_thesite) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

Link to comment
Share on other sites

sorry i was being distracted by my boss then who thinks he knows the issue but really he has no idea.  Here is the proper connect file again,

 

<?php

$hostname_thebizconnect = "name";
$database_thebizconnect = "name";
$username_thebizconnect = "user";
$password_thebizconnect = "password";
$thebizconnect = mysql_pconnect($hostname_thebizconnect, $username_thebizconnect, $password_thebizconnect) or trigger_error(mysql_error(),E_USER_ERROR); 
mysql_select_db($database_thebizconnect); 
?>

 

Basically whats going on was my boss was trying to prove that merging dreamweaver code with your own code is quicker than writing your own!  Don't get me wrong i preffer to write my own but now we have started and ended up with this issue.  I really want to know the error so I can then say to him "see, here is the error! Wouldn't it have been much quicker to write my own code" lol.  Anyway, now I'm getting the internal server error 500.  Like its trying to send but failing somewhere.

Link to comment
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.