
bgbs
Members-
Posts
114 -
Joined
-
Last visited
Everything posted by bgbs
-
How do I css menu to show current page using php? Into each unique page I inserted this code <?php $page = "about"; ?> ( "about" is the name of page used in this example ) Now I'm stock with the rest. Someone suggested that I should write the php like this: <li><a href="about.php" <?php if ($page == 'about') { ?>class="current"<?php } ?>>About</a></li> Is this correct usage? Or is there a better way to do this? Please let me know
-
I cant explain this in one subject line. So please take 10 seconds of your valuable time to hear me out. I have a posting board which has listings of products. When you click on one listing it takes you to view the details of that listing. The details of the listing can sometimes contain a long list of stuff. Now, when you perform a search on a posting board it brings you a list of relevant results. What I want the search to do is when someone clicks on one of the result that search spit out that in the details page it also highlites the word or words which a person performed in the search. Is it possible to do? Are there any scripts that do just that? Please let me know. -Ben
-
I get syntax error because I think you can only use this php syntax outside of the code that I provided. I actually need the proper syntax for the code inside $form Thanks for your help
-
Here is the code that I need help with: $form['info']['name'] = array( '#type' => 'textfield', '#title' => 'Name', '#size' => 35, '#required'=>true, '#default_value' => $record->name, I need to insert this code inside somewhere in this php form so that it will be registered: <p class="guidelines" id="guide_1"><small>Sample Tooltip Guideline</small></p> Does it makes sense what I'm asking? Let me know Thanks for your help
-
My site is becoming very complicated, and it is hard to know what is happening when making changes to the site. I wonder if there is a website schematic software that I can use to start mapping the website and its functions. If anybody knows a way or a software that I can utilize to map the site, and print it out on a big sheet like a blueprint to keep track of my development work flow that will be great. I would think that somehow companies that create complicated sites do utilize some sort of a system to keep track of the way their site works. Thanks ahead of time
-
I run an interactive membership site where members post product ads and receive emails from interested parties. Members use my sites email form to write emails to each other. When a member sends out an email using email form, the form uses a designated gmail address to deliver the message to the recipient. The concern I have is, if the recipient decides to flag the email from the specific sender as spam, it would probably flag as spam the designated gmail address that is used to deliver the message, therefore any other buyer who writes to that seller would also be considered as spammer and never get emails from any member. My question is, is there are solution to this problem?
-
I run an interactive membership site where members post product ads and receive emails from interested parties. Members use my sites email form to write emails to the product seller. When the person sends out an email to the product seller from my site, it uses the designated gmail address for that. The concern I have is, if the other recipient decides to flag the email from the specific buyer as spam, it would probably block the designated gmail address, that acts as a delivery system, as spam therefore any other buyer who writes to that seller would also be considered as spammer and probably will never deliver the email to him. My question is, is there are solution to this anticipated problem?
-
Thanks, that should help me out
-
Ok so help me out, how do I code this correctly? Will this work fine then? echo "<ul>"; echo "<li><a href=\"index.php#$ad\">Trade Floor</a></li>"; echo "<li><a href=\"user.php?v_id=$toid\">My Account</a></li>"; include "inc.last_search.php"; $toName = ""; $toEmail = ""; $fromName = ""; $fromEmail = ""; $emailSubj = ""; $emailBody = ""; $emailSent = "yes"; echo "</ul>";
-
I'm using this php echo code and in the last <li> that is empty right now I'm trying to include a file. echo "<ul>"; echo "<li><a href=\"index.php#$ad\">Trade Floor</a></li>"; echo "<li><a href=\"user.php?v_id=$toid\">My Account</a></li>"; "<li></li>"; echo "</ul>"; This is the code below with the include and some more code below that I'm trying to put into echo. Maybe using echo is not the best way in this case, all help and suggestions appreciated. include 'inc.last_search.php' $toName = "" $toEmail = "" $fromName = "" $fromEmail = "" $emailSubj = "" $emailBody = "" $emailSent = "yes"
-
I guess I confused everybody with my post. I'm not trying to render the actual image in browser, I'm trying to have people view the actual image code in browser so that they can select the code with their mouse, then copy it, and paste it where ever they want. right now it just wants to render the image for me in browser, and I'm trying to avoid that.
-
I know this is a simple question, but how do I write output the actual code in php/html page instead of heaving the image show up? <img src="http://site.com/images/premium-member-logo.png" alt="verified seal" width="140" height="49"> What I'm trying to do is have the above image code be written out in html so that people can select and copy from the page.
-
I got it figured out, I needed to use $value[1] instead of [6] I dont know why though.
-
I placed the space the problem persists. It disregards all the if and ifelse statements and only puts else. if ($value[6] == "WTS") { $colorclass = " class=\"green\""; } elseif ($value[6] == "WTB") { $colorclass = " class=\"red\""; } elseif ($value[6] == "Other") { $colorclass = " class=\"blue\""; } else { $colorclass = " class=\"white\""; } if ($key == 9 && $cellval == "") { $cellval = "anonymous"; } echo "<td ".$colorclass.">".$cellval."</td>";
-
How did you determine that? I tried what you said, and it doesnt work. The script uses values that get inputed using a drop down form. value[6] is assigned to WTS,WTB and Other drop down values. Those value are pulled from file database and spit into a table cell. I dont know where the $array 4 comes in. $value[0] = $_POST['bug_id']; $value[1] = str_replace($delimiter, " ", stripslashes(htmlentities($_POST['name']))); $value[3] = $_POST['priority_id']; $value[6] = $_POST['type_id']; $value[8] = $_POST['status_id']; $value[9] = $_POST['user_id'];
-
Well, I've been working on it a little bit and here is what I came up with, but it is not displaying different colors despite what I've done to edit it. It just displays rows in white. What It should do is determine what value lies in a table cell and change the background color of the entire row. I think its not reading value[6] correctly. echo "<tr>"; $colorclass = ""; foreach ($value as $key => $cellval) { $cellval = $cellval; if ($key == 0) { $cellval = "<a href=\"index.php?page=bug_show&bug_id=".$cellval."\">".$cellval."</a>"; // the bug id is clickable } if ($value[6] == "WTS") { $colorclass = " class='green' "; } elseif ($value[6] == "WTB") { $colorclass = " class='red' "; } elseif ($value[6] == "Other") { $colorclass = " class= 'blue'"; } if ($key == 9 && $cellval == "") { $cellval = "anonymous"; } echo "<td".$colorclass.">".$cellval."</td>"; } echo "</tr>";
-
I'm trying to edit this script to change color for type_id I set type_id values to WTS and WTB, and I need them to show different color. Anyone know? Here is the partial code from the file. Your help appreciated. <?php echo "<tr><th>DEAL ID</th><th>Title</th><th>Severity</th><th>Priority</th><th>Type</th><th>Status</th><th>Submitter</th><th>Opened</th><th>Closed</th></tr>"; $record = OpenRecord("bug", "id,name,severity_id,priority_id,type_id,status_id,user_id,opendate,closedate", $keyword, "status_id num asc", "true"); // list all bugs if (!$record) { echo "<tr><td colspan=\"12\">Empty</td></tr>"; } else { $start_count = 0; $bug_count = 0; foreach ($record as $current_record) { if ($start_count >= $start && $bug_count < $bugs_per_page) { $value = explode($delimiter, $current_record); echo "<tr>"; $colorclass = ""; foreach ($value as $key => $cellval) { $cellval = $cellval; if ($key == 0) { $cellval = "<a href=\"index.php?page=bug_show&bug_id=".$cellval."\">".$cellval."</a>"; // the bug id is clickable } if ($value[8] == "Unconfirmed") { $colorclass = " class=\"blue\""; } elseif ($value[8] == "Under investigation" || $value[8] == "Confirmed") { $colorclass = " class=\"red\""; } else { $colorclass = " class=\"green\""; } if ($key == 9 && $cellval == "") { $cellval = "anonymous"; } echo "<td".$colorclass.">".$cellval."</td>"; } echo "</tr>"; $bug_count++; } $start_count++; } } ?>
-
I'm not a mysql phpmyadmin guru, but I frequently use phpmyadmin to tinkle with the database to make various changes. I run a membership type website in which people open accounts and utilize services. The problem I have is that if I change a password for any registered member using phpmyadmin then the password no longer works; a member cannot login with it. The password field type is set as varchar(64) and function is not set. I tried applying different functions from such as ASCI, password, CHAR,HEX, but nothing I do works. Does anyone know what I'm supposed to do now?
-
I'm looking for a php statistics script that I can integrate into users' accounts. I run an association site and I want to provide statistical data for the members in their account about how many clicks and impressions they get on their ads and account pages. So basically the script needs to be integrated in a way to provide the stats for individual users. Any help appreciated Ben
-
How do I wrap echo with <span></span> properly? echo "<span class='error'>An error has occured: ".$ts_obj->error; I dont know how to put</span> at the end of the error code. Thanks
-
it writes everything beautifully
-
Well, how come I suddenly get privliges when the inc.db.php file is not included?
-
This is weird stuff. This script works on one page, but not in another. All the paths are correct I checked that already number of times. But the page in which I get this error has include inc.db.php file, and if I remove it then the script processes it? I get Warning: error_log(/home/wassoc/public_html/logs/2009-11-25-php-errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/wassoc/public_html/news/wp-settings.php on line 601 this error continues down the page at different lines. Does anyone know why? <?php // Include Wordpress define('WP_USE_THEMES', false); require('news/wp-blog-header.php'); query_posts('showposts=3'); ?><?php while (have_posts()): the_post(); ?> <a href="<?php the_permalink(); ?>"><span class="inline-news-ticker"><?php the_title(); ?></span></a> <?php endwhile; ?> <?php // Turn off all error reporting error_reporting(0); //the reports are not logged to file check /logs/ directory for date function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars) { global $db; // timestamp for the error entry. $dt = date('Y-m-d H:i:s (T)'); // define an assoc array of error string // in reality the only entries we should // consider are E_WARNING, E_NOTICE, E_USER_ERROR, // E_USER_WARNING and E_USER_NOTICE. $errortype = array ( E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice' ); // set of errors for which a var trace will be saved. $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE,E_ERROR,E_WARNING,E_PARSE); $err = "<errorentry>\n"; $err .= "\t<datetime>" .$dt. "</datetime>\n"; $err .= "\t<errornum>" .$errno. "</errornum>\n"; $err .= "\t<errortype>" .$errortype[$errno]. "</errortype>\n"; $err .= "\t<errormsg>" .$errmsg. "</errormsg>\n"; $err .= "\t<scriptname>" .$filename. "</scriptname>\n"; $err .= "\t<scriptlinenum>" .$linenum. "</scriptlinenum>\n"; if (in_array($errno, $user_errors)) { $err .= "\t<vartrace>" .wddx_serialize_value($vars, 'Variables'). "</vartrace>\n"; } $err .= "</errorentry>\n\n"; // save to the error log file, and e-mail me if there is a critical user error. $logfile = '/home/wassoc/public_html/logs/'.date("Y-m-d").'-php-errors.log'; error_log($err, 3, $logfile); //$db->query(" INSERT INTO log_error (errormsg) VALUES ($err) "); if ($errno == E_USER_ERROR||$errno == E_ERROR ||$errno == E_PARSE||$errno == E_WARNING) { mail('[email protected]', 'Critical User Error', $err); } } $old_error_handler = set_error_handler('userErrorHandler'); /********************************************************************** * ezSQL initialisation for mySQL */ // Include ezSQL core include_once "ezsql/ez_sql_core.php"; // Include ezSQL database specific component include_once "ezsql/ez_sql_mysql.php"; // Initialise database object and establish a connection // at the same time - db_user / db_password / db_name / db_host $db = new ezSQL_mysql('user','pass','database','localhost'); $dbt = new ezSQL_mysql('user','pass','database','localhost'); /********************************************************************** * ezSQL demo for mySQL database */ /* // Demo of getting a single variable from the db // (and using abstracted function sysdate) $current_time = $db->get_var("SELECT " . $db->sysdate()); print "ezSQL demo for mySQL database run @ $current_time"; // Print out last query and results.. $db->debug(); // Get list of tables from current database.. $my_tables = $db->get_results("SHOW TABLES",ARRAY_N); // Print out last query and results.. $db->debug(); // Loop through each row of results.. foreach ( $my_tables as $table ) { // Get results of DESC table.. $db->get_results("DESC $table[0]"); // Print out last query and results.. $db->debug(); } */ ?>
-
This php script is driving me insane. This is a simple script which pulls wordpress titles from news directory. It works if I put this code on homepage file. But if I launch this script in a file that is in a sub folder then I get an error even though I do specify require('../news/wp-blog-header.php'); to go back to top level. If I insert the full http:// path, it doesnt work at all. Does anyone know why? <?php // Include Wordpress define('WP_USE_THEMES', false); require('news/wp-blog-header.php'); query_posts('showposts=3'); ?><?php while (have_posts()): the_post(); ?> <a href="<?php the_permalink(); ?>"><p class="border"><?php the_title(); ?></p></a> <?php endwhile; ?>