Jump to content

garydt

Members
  • Posts

    321
  • Joined

  • Last visited

    Never

Everything posted by garydt

  1. gary.php is the second piece of code.
  2. Hi, I've uploaded my website to the server and I'm getting this error:- Parse error: syntax error, unexpected T_VARIABLE in /home/c/h/chichesterag/public_html/Connections/gary.php on line 9 This is the first 9 lines of code:- <?php session_start(); ?> <?php require_once('Connections/gary.php'); ?> <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); $gary = mysql_connect("localhost", "root") or die("Error connecting to database<br /><br />".mysql_error()); mysql_select_db("people") or die("Error selecting database<br /><br />".mysql_error()); This is my connecting code:- <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_gary = "localhost"; $database_gary = "chichesterag"; $username_gary = "chichesterag"; $password_gary = "xxxxxx"; $gary = mysql_pconnect($hostname_localhost, $username_chichesterag, $password_xxxxxx) or trigger_error(mysql_error(),E_USER_ERROR); ?> The server's owner doesn't know what the problem is so I'm hoping someone here can help. Thanks, Gary
  3. the database is called people but the online server hasn't any options where i can create a database.
  4. Thanks. So how do i use that program to connect to green on Red's server?
  5. I'm hosted with Green on Red IT Ltd
  6. Clicking on mysql administrator i get- List Tables Create Table Export Data Run SQL and Table List The tables within your database are shown below. Table Records Action newtablee 0 Browse Search Properties Insert Drop Empty Rename Add Create New Table
  7. When I click on mysql i get mySQL mySQL is a powerful database server. mySQL databases can be integrated into web pages opening opportunities for advanced data driven sites and ecommerce. mySQL is currently set-up on this account. Change mySQL Password mySQL Administrator Remove mySQL
  8. I have a cpanel with these options Security FrontPage SSL Error Page CGI Scripts mySQL Dialup Accounts DNS ADSL SubmitXtra
  9. On the server it has a run sql where I can type in commands. Do I need to type in commands and, if so, what?
  10. Now I've put this- <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_gary = "localhost"; $database_gary = "people"; $username_gary = "new"; $password_gary = "garyt"; $gary = mysql_pconnect($hostname_gary, $username_gary, $password_gary) or trigger_error(mysql_error(),E_USER_ERROR); ?> and now i get- Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'new'@'localhost' (using password: YES) in /home/c/h/chichesterag/public_html/Connections/gary.php on line 9 Fatal error: Access denied for user 'new'@'localhost' (using password: YES) in /home/c/h/chichesterag/public_html/Connections/gary.php on line 9 What have I got to do now? Sorry to keep asking.
  11. i uploaded the connections folder and now i'm getting this- Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/c/h/chichesterag/public_html/Connections/gary.php on line 9 Fatal error: Access denied for user 'root'@'localhost' (using password: NO) in /home/c/h/chichesterag/public_html/Connections/gary.php on line 9 This is line 9- $gary = mysql_pconnect($hostname_gary, $username_gary, $password_gary) or trigger_error(mysql_error(),E_USER_ERROR);
  12. I'm sorry, i'm confused. How do I connect the webpage to the table online without haviing a database? on my pc the mysql settings are connection - gary host address - localhost user name - root the database is called people. Don't i need to have these settings on the online server?
  13. Just to let you know, when i try the webpage i get- Warning: require_once(Connections/gary.php) [function.require-once]: failed to open stream: No such file or directory in /home/c/h/chichesterag/public_html/index.php on line 2 Fatal error: require_once() [function.require]: Failed opening required 'Connections/gary.php' (include_path='.://lib/php') in /home/c/h/chichesterag/public_html/index.php on line 2
  14. This is part of my code- <?php require_once('Connections/gary.php'); ?> <?php $gary = mysql_connect("localhost","root") or die("Error connecting to database<br /><br />".mysql_error()); mysql_select_db("people") or die("Error selecting database<br /><br />".mysql_error()); $query_Recordset5 = "SELECT * FROM newtable"; It works fiine on my local pc/server. However when I went onto the online server to setup the database and table their mysql administrator only let me setup the table and not the database properties. I've connected support about creating the database properties but they don't seem to have a clue about it. What can I do?
  15. I've put this now- mysql_connect("localhost","root"); mysql_select_db("people"); $query_Recordset5 = "SELECT * FROM newtable"; $Recordset5 = mysql_query($query_Recordset5, $gary) or die(mysql_error()); $result = mysql_query($query_Recordset5); $row_Recordset5 = mysql_fetch_assoc($Recordset5); $c = $row_Recordset5['visitor']; $c=$c+1; echo $c; $totalRows_Recordset5 = mysql_num_rows($Recordset5); I'm getting no errors now but I'm getting a blank page now. why?
  16. Now I'm getting- Fatal error: Call to undefined function mysql_connect_db() in C:\xampp\xampp\htdocs\cag\index.php on line 7
  17. mysql_select_db($database_newdb, $newdb); $query_Recordset5 = "SELECT * FROM counting"; $Recordset5 = mysql_query($query_Recordset5, $newdb) or die(mysql_error()); I'm getting- Warning: mysql_select_db() expects parameter 2 to be resource, null given in C:\xampp\xampp\htdocs\cag\index.php on line 7 Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\xampp\htdocs\cag\index.php on line 9 What have I got wrong? Thanks.
  18. I'm trying to control the font size through a php variable. I've got- <font size="<?php echo $text; ?>"> but it's not accepting it. Whats wrong? Thanks
  19. I only use $chek once the form submitted. Also, I've tried defining $chek at the top of the script and it still becomes empty when the form is submitted. I've also tried making $chek a session variable and I still get the same result.
  20. Yes, it's in the same script. $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $cd = $_POST['code']; echo $chek; if ($cd!=$chek) { header("Location: code.php?nm=$cd&em=$ema&user=$user&ps=$chek"); exit(); } else { $insertSQL = sprintf("INSERT INTO userinformation (fname, email, password, usernm) VALUES ('$name', '$ema', '$user', '$pass');"); mysql_select_db($database_scopedbconect, $scopedbconect); $Result1 = mysql_query($insertSQL, $scopedbconect) or die(mysql_error()); // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['username'])) { $loginUsername=$_POST['username']; $password=$_POST['password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "forum.php"; $MM_redirectLoginFailed = "loginfail.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_scopedbconect, $scopedbconect); $LoginRS__query=sprintf("SELECT usernm, password FROM userinformation WHERE usernm=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $scopedbconect) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; } } header("Location: forum.php"); } } $c = 0; mysql_select_db($database_scopedbconect, $scopedbconect); $query_Recordset7 = "SELECT * FROM codes"; $Recordset7 = mysql_query($query_Recordset7, $scopedbconect) or die(mysql_error()); $result = mysql_query($query_Recordset7); while ($row_Recordset7 = mysql_fetch_assoc($result)) { $pics[$c] = $row_Recordset7['image']; $num[$c] = $row_Recordset7['number']; $cod[$c] = $row_Recordset7['code']; $c = $c +1; } $totalRows_Recordset7 = mysql_num_rows($Recordset7); $n = rand(0, $c-1); $chek = $cod[$n]; mysql_select_db($database_scopedbconect, $scopedbconect); $query_Recordset6 = "SELECT * FROM codes WHERE number='$n'"; $Recordset6 = mysql_query($query_Recordset6, $scopedbconect) or die(mysql_error()); $row_Recordset6 = mysql_fetch_assoc($Recordset6); $top = $row_Recordset6['image']; $totalRows_Recordset6 = mysql_num_rows($Recordset6); ?> <html> <body> <table width="300" border="0" align="left" cellpadding="0"> <tr> <form action="<?php echo $loginFormAction; ?>" method="POST" name="form1" id="form1"> <td><br /> <img src="<?php print $pics[$n]; ?>" border="0" /> </td> <tr> <td colspan="2"> <input name="code" type="text" id="code" />Enter the above code <tr> <td colspan="2" align="center"><br /> <p align="center"> <label> <input name="Submit" type="submit" value="Submit" /> </label> </p> <input type="hidden" name="MM_insert" value="form1"></td> </tr> </form>
  21. I get the variable - $chek from an array at random- while ($row_Recordset7 = mysql_fetch_assoc($result)) { $pics[$c] = $row_Recordset7['image']; $num[$c] = $row_Recordset7['number']; $cod[$c] = $row_Recordset7['code']; $c = $c +1; } $totalRows_Recordset7 = mysql_num_rows($Recordset7); $n = rand(0, $c-1); $chek = $cod[$n]; When I echo $chek is has a stored variable. Then when I submit a form and I compare $chek with another variable $chek is empty and I've got no idea why. if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $cd = $_POST['code']; echo $chek; if ($cd!=$chek) { header("Location: code.php?nm=$cd&em=$ema&user=$user&ps=$chek"); exit(); } else { $insertSQL = sprintf("INSERT INTO userinformation (fname, email, password, usernm) VALUES ('$name', '$ema', '$user', '$pass');"); mysql_select_db($database_scopedbconect, $scopedbconect); $Result1 = mysql_query($insertSQL, $scopedbconect) or die(mysql_error()); // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } Any help would be great.
  22. I'm trying to get embedded images into email. I've got- $subject = "Message from $user (elvis-people)"; $headers = "From: $from\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; $body = "<HTML><BODY><CENTER> <TABLE BORDER='1'><TR><TD align='center'><FONT COLOR='MAROON'><B><BIG> Here is an image!</BIG></B></TD></TR> <TR><TD align='center'><img src='logo.gif'></TD></TR> </CENTER></BODY> </HTML>"; mail($to, $subject, $body, $headers); I get the table but no image, just the box with the red cross.
  23. That's it. I had a .htacess file and i took it out and phpinfo has changed. Thanks
  24. This is what I'm changing- ; For Win32 only. SMTP = smtp.tiscali.co.uk smtp_port = 25 ; For Win32 only. sendmail_from = me@example.com phpinfo still says smtp = localhost
×
×
  • 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.