EzPortal - Portal Software for Forums

EzPortal - Made to Fit Your SMF Forum - Glad You Found Us!
+- +-

UserBox

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Recent Posts

New built in translations for six langauges! by EzPortal
March 26, 2024, 11:15:32 pm

Smiley missing in shoutbox 2.1.4 by hustreamload
July 26, 2023, 08:14:02 am

Re: Theme Select Box question? by Shades
March 15, 2023, 06:49:49 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 02:09:24 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 01:55:53 pm

Re: Theme Select Box question? by EzPortal
March 09, 2023, 01:47:42 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 01:34:07 pm

Re: Theme Select Box question? by EzPortal
March 09, 2023, 12:20:17 pm

+- HTML Menu


Sample HTML Block Usage - You May Custom Code it, as needed!

Recent Topics ezBlock

New built in translations for six langauges! by EzPortal
March 26, 2024, 11:15:32 pm

Smiley missing in shoutbox 2.1.4 by hustreamload
July 26, 2023, 08:14:02 am

Theme Select Box question? by Shades
March 15, 2023, 06:49:49 pm

Where is the facebook button color? by EzPortal
February 28, 2023, 06:45:09 pm

Display on Mobile - SMF 2.1.3 and EZ 5.5.2 by BugginIn
December 29, 2022, 04:07:13 pm

Blocks Help by Riggs1973
November 20, 2022, 12:59:30 pm

Surface ol lite theme release Free! by Steffen K.
November 18, 2022, 03:57:24 am

Undefined index: href by EzPortal
October 04, 2022, 08:49:59 pm

SMF-ezportal_column_5.cache): failed to open stream: No such file or directory by EzPortal
June 04, 2022, 11:40:13 am

Arcade block error: failed to open stream: No such file or directory by Shades
May 20, 2022, 02:47:13 pm

Author Topic: PHP MySQL Script  (Read 10197 times)

0 Members and 1 Guest are viewing this topic.

Offline Tyrantis

  • Posts: 3
  • Karma: 0
  • Gender: Male
PHP MySQL Script
« on: December 16, 2009, 06:50:00 pm »
I built this script for use, and works fine as a file hitting it from the server. But in an EZblock it seems to not hit the database and displays the variable names rather than the actual database information.

Code: [Select]
<?php

//Script to display applicants.

//database to use
$db_name "firespr_members";
//table to use
$table_name "application";

//connection info
$connection = @mysql_connect("localhost""username""wouldn't you like to know")
or die(mysql_error());

//establish the connection to database
$db = @mysql_select_db($db_name$connection) or die(mysql_error());

$sql "SELECT * FROM $table_name ORDER BY id";

$result = @mysql_query($sql,$connection) or die(mysql_error());

while (
$row mysql_fetch_array($result)) {

$id $row['id'];
$character stripslashes($row['character']);
$real_name stripslashes($row['real_name']);
$forum_name stripslashes($row['forum_name']);
$address stripslashes($row['address']);
$city stripslashes($row['city']);
$state stripslashes($row['state']);
$zip stripslashes($row['zip']);
$country stripslashes($row['country']);
$other_clubs stripslashes($row['other_clubs']);
$armor_type stripslashes($row['armor_type']);
$armor_class stripslashes($row['armor_class']);
$region stripslashes($row['region']);
$email stripslashes($row['email']);
$joined stripslashes($row['joined']);
$birth stripslashes($row['birth']);
$is_18 stripslashes($row['is_18']);
$read_codex stripslashes($row['read_codex']);







$display_block "<p>
<br><br>
<strong>Email: </strong> 
$email <br>
<strong>Character: </strong> 
$character <br>
<strong>Real Name: </strong> 
$real_name <br>
<strong>Forum Name: </strong> 
$forum_name <br>
<strong>Address: </strong> 
$address <br>
<strong>City: </strong> 
$city <br>
<strong>State: </strong> 
$state <br>
<strong>Zipcode/Postal Code: </strong> 
$zip <br>
<strong>Country: </strong> 
$country <br>
<strong>Other Clubs: </strong> 
$other_clubs <br>
<strong>Armor Type: </strong> 
$armor_type <br>
<strong>Armor Class: </strong> 
$armor_class <br>
<strong>Region: </strong> 
$region <br>
<strong>18 or Older: </strong> 
$is_18 <br>
<strong>Read Codex: </strong> 
$read_codex <br>
<strong>Applied On or Last Edit: </strong> 
$joined <br>
<strong>Birthdate: </strong> 
$birth <br>
<strong><a href=\"appimage.php?id=
$id&image=image1\"> Image1 </a></strong><br>
<strong><a href=\"appimage.php?id=
$id&image=image2\"> Image2 </a></strong><br>
<strong><a href=\"appimage.php?id=
$id&image=image3\"> Image3 </a></strong><br>
<strong><a href=\"appimage.php?id=
$id&image=image4\"> Image4 </a></strong><br>
<strong><a href=\"appimage.php?id=
$id&image=image5\"> Image5 </a></strong><br>

</p>"
;

echo "$display_block";

}



?>


Any thoughts would be appreciated.

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1299
  • Karma: 67
Re: PHP MySQL Script
« Reply #1 on: December 16, 2009, 06:54:50 pm »
Are you putting in a php block?
If so try removing the <?php and ?> and just put the code.
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline Tyrantis

  • Posts: 3
  • Karma: 0
  • Gender: Male
Re: PHP MySQL Script
« Reply #2 on: December 16, 2009, 06:57:02 pm »
No using the page manager. Sorry I am kind of writing for this groups site, and don't use EZportal myself. So probably used wrong terms.

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1299
  • Karma: 67
Re: PHP MySQL Script
« Reply #3 on: December 16, 2009, 07:23:20 pm »
The page manager does not support php code at this time only html
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline Tyrantis

  • Posts: 3
  • Karma: 0
  • Gender: Male
Re: PHP MySQL Script
« Reply #4 on: December 16, 2009, 07:36:05 pm »
That explains things, thank you so much.

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
23286 Views
Last post January 11, 2013, 12:25:40 pm
by EzPortal

+-SMF Gallery

Quick Menu


Powered by EzPortal