$string="City" $consonants=array("B","b","C","c","D","d","F","f","G","g","H","h","J","j","K","k","L","l","M","m","N","n", "P","p","Q","q","R","r","S","s","T","t","V","v","W","w","X","x","Y","y","Z","z"); foreach($consonants as $chk2) { if(strpos($string,$chk2)!= false) { $ans2[]=$chk2; } } if(isset($ans2)) { $comment2="Consonants in this string: ".join(" ",$ans2); } else { $comment2="Consonants in this string: None"; } echo "".$comment2."<br/>"; so the error is that the displayed consonants does not include the first letter. what could be wrong?

Member Avatar
Member Avatar
+0 forum 3

i have an echo statement. which am looping columns. and i want to use this onerror command <img src="http://subinsb.com/to-an-image" onerror="this.src='img/delogo.jpg';"/> but not working. how do i do this. thanks echo ' <div class="col-lg-5 col-md-5 col-xs-12"> <h4 class="font_head_check">' . $title . '<span class="box_type_unik">For Sale</span></h4> <p class="font_check">' . $town . '</p> <span class="label label-info">GH¢ ' . ($currency == 2 ? number_format($price * $ratio) : number_format($price)) . '</span> <span class="label label-default"></span> <p class="agent_det_unika"><br/>' . substr($description, 0, 400) . '</p> </div> <div class="vertical-line" style=""></div> <div class="col-lg-2 col-md-2 col-xs-12 col_comp_img"> "<img src="'.$logo.'" class="img-responsive result_comp_logo" onerror="this.src='img/delogo.jpg';"> <br/> <p class="font_unik_comp" style="display:none;">Sunda Estates</p> <p class="num_unika_size">' . $phone . …

Member Avatar
Member Avatar
+0 forum 3

Hi. There is a textarea in my page. I type a text in the textare and then in the script there is: $text = nl2br(htmlentities($_POST['text'])); Now what is the problem? When i type: `I'm fine.` It will be sent to db and will be printed, in both place as: `I'm fine.` What is the solution for that?

Member Avatar
Member Avatar
+0 forum 2

Hi. With `$u_agent = $_SERVER['HTTP_USER_AGENT'];` i can get the users information but i just want to echo the OS that users use, something like: Linux,Ubuntu How can i get this out from the $u_agent variable?

Member Avatar
Member Avatar
+0 forum 11

Hi. I'm working on my own CMS, i want the script to echo 3 posts in every page, and want the script to echo from the recent post and back to the oldest post. I mean like this: For example there is totaly 30 posts; First page => posts 30-29-28 Second page => posts 27-26-25 .... This is my script: <?php include('connection.php'); $error = FALSE; $result = FALSE; try { $row = $conn->query("SELECT MAX(id) AS last_id FROM Posts")->fetch(PDO::FETCH_OBJ); echo $row->last_id; echo "<hr>"; $last_id = $row->last_id; $total = $conn->query("SELECT COUNT(id) as rows FROM Posts") ->fetch(PDO::FETCH_OBJ); $perpage = 3; $posts = $total->rows; …

Member Avatar
Member Avatar
+0 forum 16

Hi. In my CMS, when i type a content for a new post in the textarea, like this: one two three four five six and then click the submit button, it will save in the db table like the way i have typed, every word in a separate line. But when the script echo the post on the page, i see all words are in one line like this: one two three four five six Why? Do i have to type tags like <br> while typing the content on the text area?! But users must feel free to write their …

Member Avatar
Member Avatar
+1 forum 13

Hi ... I wrote a script to send a feedback form to an email. Here's the script below; //PHP CODE: <?php session_start(); $submitted = FALSE; ini_set("SMTP","mail.sitecghana.com"); if (isset($_POST['send_message_button'])) { $submitted = TRUE; // The form has been submitted and everything is ok so far… $name = htmlspecialchars($_POST['name'], ENT_QUOTES); $email = htmlspecialchars($_POST['email'], ENT_QUOTES); $message = htmlspecialchars($_POST['message'], ENT_QUOTES); if ($email == "") { // if the email is blank… give error notice. echo "<p>"."Please enter your Email address so that we can reply to you."."</p>"; //pop_alert('Please enter your email'); $submitted = FALSE; // Set this to FALSE so that it the message …

Member Avatar
Member Avatar
+0 forum 2

i've two files one is send-data.php which contains html form and another one is receive-data.php, i am converting the form value as session value into second file and printing using echo. but it's not printing the output. //send-data.php <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form action="receive-data.php" method="post"> <input name="cardno" type="text" size="30" /> <input name="Send" type="submit" value="submit" /> </form> </body> </html> //receive-data.php <?php session_start(); $_SESSION=['cardno']=$_POST['cardno']; echo "Pageviews=". $_SESSION['cardno']; ?>

Member Avatar
Member Avatar
+0 forum 2

Here is the page: <?php include( "mypath.php" ); include( "{$filepath}/config/clientdbconnect.php" ); if ( ------------------------- ) { #exit( "Security Violation" ); } include( "header.php" ); $sqle = "select * from helpconfig where cid = '1'"; if ( !( $resulte = mysql_query( $sqle ) ) ) { exit( mysql_error( ) ); } while ( $rowe = mysql_fetch_array( $resulte ) ) { $ticketlimit = $rowe['ticketlimit']; $ticketdlimit = $rowe['ticketdlimit']; $flash = $rowe['flash']; } $interface = grab_template( "support_center_head.html", $cusid ); $sqle = "select * from helpconfig where cid = '1'"; if ( !( $resulte = mysql_query( $sqle ) ) ) { exit( mysql_error( ) ); …

Member Avatar
Member Avatar
+0 forum 4

hello. im not sure if this is the right forum because it is about php echo AND js but since it is about echoing i thought this forum will be better. sorry if i asked in the wrong forum. Anyway, so i want to know if echoing a js script will work? Like for instance as usual we write js in <head> but if it were to be echoed, is that something that is done? i was thinking of echoing a script for datetimepicker plugin. i tested this: echo "<script src='js/jquery 1.8.2.js'></script>"; echo "<script src='js/jquery-ui 1.8.2.min.js'></script>"; echo "<script type='text/javscript'> $(document).ready(function(){ …

Member Avatar
Member Avatar
+0 forum 5

Ok, so here is the problem. Below is a fairly simple code that will count the number of members registered to a site. The html works just fine but the php doesn't display anything unless I do something like `if($result>0)`--- then it will display everything to the right of the zero. If I use the code below, I get nothing. I'm hoping it's some stupid mistake instead of XAMPP not working correctly (the same thing happened on another page I tried to see using XAMPP). <!DOCTYPE HTML> <html> <head> <script src="javascript/login.js"></script> <script src="javascript/registerscript.js"></script> <script src="javascript/unsubscribe.js"></script> <script src="javascript/password.js"></script> </head> <body> <?php …

Member Avatar
Member Avatar
+0 forum 5

hi I am having trouble on echoing a sum from a table, The mysqul works and give me the wantted result and looks like SELECT sum(brick) FROM `goodship` this is the code i am trying to get to show it on the site, <html> <head> <?php $con=mysqli_connect("hostwiththemost.com","bulderbob","superscreatpassword","shipstable"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } ?> </head> <body> <?php $result = mysql_query($con"SELECT SUM(brick) FROM goodship"); while($row=mysql_fetch_array($result)) { echo $row['SUM(brick)'] ; } ?> </body> </html> any see why this is not working ? thanks.

Member Avatar
Member Avatar
+0 forum 6

Hi. I just wonder, is it possible, to validateform , which has been "echoed" in PHP using JavaScript function? See code below <?php if(isset($_SESSION['email'])){ echo"You are looged in as ".$_SESSION['email']. "</br> "; echo' <form action="confirmlogout.php" id"logoutform" method="post"> <input type="submit"id="sub" name="sub" onclick="" value = "LOG OUT" /> </form></br>'; } else{ echo '<h3>Please fill up registration form, to create user account</h3> <form action="signup.php" id="signform" method="POST" onSubmit="validate()"> <ul> <li>Please enter your first name: &nbsp;<input type="text" id="fname" name="fname" autofocus autocomplete="" /><div id="erfname"></div></li> <li>Please enter your last name: &nbsp<input type="text" id="lname" name="lname" onFocus="validate()" /><div id="erlname"></div></li> <li>Please enter your flat number: &nbsp<input type="text" id="hno" name="hno" /><div …

Member Avatar
Member Avatar
+0 forum 3

By examining the first, third and last (seventh) fields of the /etc/passwd file, determine the userid and login shell for your username, the user root, and the user nobody (yes, there is a system user with the username "nobody"). Create simple files in your home directory, called my.uid, my.shell, root.uid, root.shell, nobody.uid, and nobody.shell, which contain only the appropriate information on a single line. For example, if the user nobody's login shell were /bin/bash, the following command would easily create the appropriate file. `[student@station student]$ echo /bin/bash > nobody.shell` `[student@station student]$ cat nobody.shell` `/bin/bash` I don't know how to find …

Member Avatar
Member Avatar
+0 forum 1

<?php $a=""; $b=""; $c=""; if(isset($_GET["plus"])) { $a=$_GET['eknum']; $b=$_GET['donum']; $c=$a+$b; } ?> <form action="index.php" method="GET"> <input type="text" name="eknum" value=" <?php echo "$a"; ?> " /> <br> <input type="text" name="donum" value=" <?php echo $b; ?> " /> <br> <input type="text" name="execute" value=" <?php echo $c; ?> " /> <input type="submit" value="sum" name="plus"> </form>

Member Avatar
Member Avatar
+0 forum 2

Hi, i'm trying to select two values from my database. $nc ='North Carolina'; $t ='Hello'; $q = 'SELECT COUNT(state, title) AS c FROM all WHERE state = "' . mysql_real_escape_string($nc) . '" AND title = "' . mysql_real_escape_string($t) . '"'; $rq = mysql_query($q); $fetch = mysql_fetch_assoc($rq); $count = $fetch['c']; echo = "$count"; I need it so it will only echo out the number of posts from North Carolona and with the title Hello. It doesn't echo out nothing.

Member Avatar
Member Avatar
+0 forum 3

Hello, I'm having a problem with my code. It seem to only echo out the picture name from my database and not the picture. This is my code search.php $result = mysql_query("SELECT * FROM all WHERE (`title` LIKE '%".$query."%') OR (`add_type` LIKE '%".$query."%')") or die(mysql_error()); if(mysql_num_rows($result) > 0) { while($results = mysql_fetch_array($result)) { $photo = $results['image']; echo " ".$results['image']."<a href='http://www.mysite.org/br/s.php?id=$id'><img src='/cate/upload/ $photo' width='100%' height='100%'></a>"; } } This is where i save my picture -> /cate/upload/ I think i have to leave the $result code, the only thing i need is to transform the $result['image']; to echo out the picture, not …

Member Avatar
Member Avatar
+0 forum 3

this is my php code for my profile.php. it is to display the users name after login. <?php session_start(); require "connect.php"; if($_SESSION['name']) { $name = $_SESSION['name']; $query = mysql_query("SELECT name FROM register WHERE name ='$name'"); $numrows = mysql_num_rows($query); if(1 == $numrows) { while ($rows = mysql_fetch_assoc($query)) { echo "Welcome, ".$rows['name']."!"; } } } ?> i want to display this: while ($rows = mysql_fetch_assoc($query)) { echo "Welcome, ".$rows['name']."!"; } inside html. ive tried but it isnt working. this is the code i did: <?php while (@$rows = mysql_fetch_assoc(@$query))?><h3><?php echo "Welcome, ".@rows['name'] ?></h3> but error : Parse error: syntax error, unexpected '[', …

Member Avatar
Member Avatar
+0 forum 7

so i wanna echo a result from my database and i have successfully done that but im trying to place the result at a specific place on my page. this is the code if($result) { { echo "<div class='total'>"; echo "<b>Your Total Income is $total</b>"; echo "</div>"; } } and it is appearing at the top left corner of the page but i want it to be at the centre next to a table. ive tried placing the code in my html code where i want it to be but 'undefined variable : result' error came out instead. so could …

Member Avatar
Member Avatar
+0 forum 8

I'm just trying to echo a string to the browswer with the following code: <!DOCTYPE html> <html> <body> <h1>Hello World!</h1> <?php echo "My first PHP script!"; ?> </body> </html> but it doesn't show up in the browswer. The "Hello world!" header shows up but not the php statement. I know it must be something very simple. Could someone help me out?

Member Avatar
Member Avatar
+0 forum 1

Example 1 below works: echo "<p><h2>".$results['title']."</h2>".$results['shortdesc']."</p>"; I need to make the title linkable to the page url. I'm probably putting the ' and " in the wrong places for the link part. Example 2 - I've added the url code but does not work: echo "<p><h2><a href=http://www.example.com/".$results['url'].".$results['title']."</a>"</h2>".$results['shortdesc']."</p>"; Any help would be appreciated. Thx.

Member Avatar
Member Avatar
+0 forum 2

so i have xampp installed on windows the address is localhost and i have a page test.php to preview my code a couple days ago everything worked fine when echoing <?php echo '<'.htmlentities('?php if ($_SESSION['Username']=='nume') { echo 'right name'; } else { echo 'wrong name'; } ?').'>'; ?> and when i tried to test it yesterday the page showing is blank why?

Member Avatar
Member Avatar
+0 forum 8

Greetings friends. Please help me to understand this issue. 1 echo"<tr><td>< a href=\"home.php?num=$num\">$num</a></td><tr> 2 echo"<tr><td>$num</td></tr>"; Basically i wanted to have link for variable $num. I couldn't proceed because of following issue. However second command worked fine for me. issue : first echo returns below mentioned output. < a href="home.php?num=23434">23434 second echo returns correct output value 23434. question: Please make necessary changes to get link with first echo command. Thanks

Member Avatar
Member Avatar
+0 forum 8

<!DOCTYPE HTML> <html> <head> </head> <body> <form action="2.php" method="post"> <table width="400" border="0"> <tr> <td>Ders sayisi :</td> <td><input type="text" name="sayi" /></td> </tr> <tr> <td><input type="submit" name="gonder" value="Gonder" /></td> </tr> </table> </form> <?php if(isset($_POST['gonder'])) { for($i=1;$i<=$_POST['sayi'];$i++) { echo "$i.ders"." "."<input type='text' **name='e$i'** />"." - "." <select name='dersler'><option **value='a1'**>A1</option> <option **value='a2'**>A2</option><option **value='b1'**>B1</option> <option **value='b2'**>B2</option><option **value='c'**>C</option></select>"."<br>"; } } //...... ?> </body> **Bold Text Here** How can I use html elements in echo command with php ? for example I want to calculate the average of lessons in these ones by using name tags.

Member Avatar
Member Avatar
+0 forum 4

`$data= "echo * from table1 where id=$_post[ID] "` can anyone see why this line duz not compute please ?

Member Avatar
Member Avatar
+0 forum 3

Hi there, I need a simple socket server which will echo a client message to all connected clients. I've found this easy py script below, but it only echos the string to the client that sent the message. Any way to mod this so that it will send the message to all clients connected? ...yes, this is probably really simple, but I have very little understanding of python... [URL="http://www.pvmgarage.com/2011/03/a-multi-threaded-persistent-echo-socket-server-in-python/"]http://www.pvmgarage.com/2011/03/a-multi-threaded-persistent-echo-socket-server-in-python/[/URL] [CODE]from socket import * import threading import thread def handler(clientsock,addr): while 1: data = clientsock.recv(BUFSIZ) if not data: break msg = 'echoed:... ' + data clientsock.send(msg) clientsock.close() if __name__=='__main__': HOST = …

Member Avatar
Member Avatar
+0 forum 4

I've got a mysql query that should return a single cell SELECT `download` FROM `images` WHERE `owner_un`='$owner' AND `url`='$url' How would I echo the result of this? Thanks for any help

Member Avatar
Member Avatar
+0 forum 4

I have a problem want to be solved. I have three pages. page1.php, page2.php page1.php has a form with two text field. one text field is for name and another is for number. there is a submit button and a "next" button too. using session I want show given name into page2.php and create checkboxes that according to given number. (e.g if I write 4 in number text field in page1.php then 4 checkboxes will appear in page2.php, if 8 then 8 checkboxes. I want solve this problem using session. page1.php <body> <p> <?php session_start(); ?> </p> <form id="form1" name="form1" …

Member Avatar
Member Avatar
+0 forum 5

Hey guys, I am trying to dynamically parametize my url, but it gets lost and I have no idea why. Perhaps some insight from you guys will help. Here's the code: while($row = mysql_fetch_assoc($getID)) { echo "<tr>"; echo "<td><a href='View.php?id='" . $row['ID'] . "'>" . $row['ID'] . "</a>" . "<br />" . "-" . $row['Description'] . "</td>"; echo "<td style='text-align:center; width:35%'>" . $row['dateCreated']. "</td>"; echo "</tr>"; } In View.php I have this to try and debug: if (isset($GET['ID'])) echo $GET['ID']; else "Not set"; When I am redirected to this page, nothing displays and the url reads View.php?id= Why is it …

Member Avatar
Member Avatar
+0 forum 7

I have a business directory website that users can create listings in. I already have the listing functionality mostly working. An example of the code i use is this: <div id="companyName"> <?php echo $row_getListing['company_name']; ?></div> What I want is a code like this to get an image from the logo row in my table unless there is no image in that row then it instead gets a placeholder image from my images folder. Can anyone help?

Member Avatar
Member Avatar
+0 forum 6

The End.