Search Results

Search found 3286 results on 132 pages for 'arthur br'.

Page 14/132 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Howcome I cannot make my javascript 'executable' in an address bar

    - by imHavoc
    The second link does not work like the first one. How come? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Dynamic CSS Properties</title> <script language="JavaScript"> function change(){ //document.getElementById("box1").style.visibility = "visible"; var spanArray = document.getElementsByTagName('span'); var number_spans = spanArray.length ; for( var i = 0; i < number_spans ; i++ ){ var target = spanArray[ i ] ; // do something with target like set visibility target.style.visibility = "visible"; } } function change2(){ var spanArray=document.getElementsByTagName('span');var number_spans=spanArray.length;for(var i=0;i<number_spans;i++){var target=spanArray[i];target.style.visibility="visible";} } </script> </head> <body> <a href="javascript:change2();">Change</a> <br /> <a href="javascript:var spanArray=document.getElementsByTagName('span');va r number_spans=spanArray.length;for(var i=0;i<number_spans;i++){var target=spanArray[i];target.style.visibility='visible';}; ">Show Spans</a> <br /> <div style="position: relative; overflow: hidden;"><center> <br><br> <font size="5" color="blue"> 1. just press the <img src="http://up203.siz.co.il/up1/jw2k4az1imny.jpg"> button on the top to see the picture i promise you its so funny!!!!: <br><br><br> <span style="background: none repeat scroll 0% 0% white;"><span style="visibility: hidden;"> <a onmousedown="UntrustedLink.bootstrap($(this), &quot;77a0d&quot;, event)" rel="nofollow" target="_blank" onclick="(new Image()).src = '/ajax/ct.php?app_id=4949752878&amp;action_type=3&amp;post_form_id=3917211492ade40ee468fbe283b54b3b&amp;position=16&amp;' + Math.random();return true;" href="http://thebigbrotherisrael.blogspot.com/2010/04/all-family-guy-characters-in-real-life.html">Press here to see the picture!!!</a> </span><span style="visibility: visible;"></span></span></font></center></div> </body> </html>

    Read the article

  • Client side validation of multiple radio buttons groups

    - by absolutely-free
    This is my code: <html> <head> <title>scoreboard</title> <script> function calculate() { var sum=0; var total=0; for (var i=0; i < document.questions.group1.length; i++){ if (document.questions.group1[i].checked){ sum = parseInt(document.questions.group1[i].value) total = parseInt(total + sum);}} for (var i=0; i < document.questions.group2.length; i++){ if (document.questions.group2[i].checked){ sum = parseInt(document.questions.group2[i].value) total = parseInt(total + sum);}} for (var i=0; i < document.questions.group3.length; i++){ if (document.questions.group3[i].checked){ sum = parseInt(document.questions.group3[i].value) total = parseInt(total + sum);}} alert(total) } </script> </head> <body> <form name="questions"> A:<br> answer a1: <input type="radio" name="group1" value="0"> answer a2: <input type="radio" name="group1" value="1"> answer a3: <input type="radio" name="group1" value="2"> answer a4: <input type="radio" name="group1" value="3"><br> B:<br> answer b1: <input type="radio" name="group2" value="0"> answer b2: <input type="radio" name="group2" value="1"> answer b3: <input type="radio" name="group2" value="2"> answer b4: <input type="radio" name="group2" value="3"><br> C:<br> answer c1: <input type="radio" name="group3" value="0"> answer c2: <input type="radio" name="group3" value="1"> answer c3: <input type="radio" name="group3" value="2"> answer c4: <input type="radio" name="group3" value="3"><br><br> <input type="button" value="total" onclick="calculate()"> </form> </body> </html> How can I replace 'group[x]' in my code by a variable, so the three for-loops are replaced by one (because in reality there are a lot more questions and answers) ?

    Read the article

  • Cannot interact with checkbox in FireFox or Chrome. Works in IE.

    - by Darxide
    Title says it all. Here's the code: <div id="regpage"> <form action="" method="post"> <fieldset style="border:none;"> <div class="label">Username:</div> <input type="text" name="username" class="item" value="" /><br /> <div class="caption">Must be 5-15 characters</div><br /> <div style="clear:both;"></div> <div class="label">Password:</div> <input type="password" name="password" class="item" value="" /><br /> <div class="caption">Must be 6-20 characters</div><br /> <div style="clear:both;"></div> <div class="label">Email:</div> <input type="text" name="email" class="item" value="" /><br /> <div class="caption">Valid email address is required</div><br /> <div style="clear:both;"></div> <input name="terms" type="checkbox" id="terms" value="agree" /><div class="caption2"><label for="terms">I agree to the terms and conditions</label></div> <p><input type="submit" name="register" value="Register" id="register" style="float:left;border:1px solid #999;background:#E4E4E4;margin-top:5px;" /></p><br /> </fieldset> </form> </div> And the id "regpage" is definded in the style.css as: #regpage { width: 356px; height: 150px; color: #000000; font-family: "Tahoma", Arial, Helvetica, sans-serif; font-size: 13px; } If I move the checkbox OUT of it works just fine. But inside it will not interact in Mozilla. I've even tried adding onclick='this.checked="checked"' and it still does not interact. You can click until your blue in the face and nothing will happen. What's the deal! This is REALLY driving me batty.

    Read the article

  • How to find the one Label in DataList that is set to True

    - by Doug
    In my .aspx page I have my DataList: <asp:DataList ID="DataList1" runat="server" DataKeyField="ProductSID" DataSourceID="SqlDataSource1" onitemcreated="DataList1_ItemCreated" RepeatColumns="3" RepeatDirection="Horizontal" Width="1112px"> <ItemTemplate> ProductSID: <asp:Label ID="ProductSIDLabel" runat="server" Text='<%# Eval("ProductSID") %>' /> <br /> ProductSKU: <asp:Label ID="ProductSKULabel" runat="server" Text='<%# Eval("ProductSKU") %>' /> <br /> ProductImage1: <asp:Label ID="ProductImage1Label" runat="server" Text='<%# Eval("ProductImage1") %>' /> <br /> ShowLive: <asp:Label ID="ShowLiveLabel" runat="server" Text='<%# Eval("ShowLive") %>' /> <br /> CollectionTypeID: <asp:Label ID="CollectionTypeIDLabel" runat="server" Text='<%# Eval("CollectionTypeID") %>' /> <br /> CollectionHomePage: <asp:Label ID="CollectionHomePageLabel" runat="server" Text='<%# Eval("CollectionHomePage") %>' /> <br /> <br /> </ItemTemplate> </asp:DataList> And in my code behind using the ItemCreated event to find and set the label.backcolor property. (Note:I'm using a recursive findControl class) protected void DataList1_ItemCreated(object sender, DataListItemEventArgs e) { foreach (DataListItem item in DataList1.Items) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Label itemLabel = form1.FindControlR("CollectionHomePageLabel") as Label; if (itemLabel !=null || itemLabel.Text == "True") { itemLabel.BackColor = System.Drawing.Color.Yellow; } } When I run the page, the itemLabel is found, and the color shows. But it sets the itemLabel color to the first instance of the itemLabel found in the DataList. Of all the itemLabels in the DataList, only one will have it's text = True - and that should be the label picking up the backcolor. Also: The itemLabel is picking up a column in the DB called "CollectionHomePage" which is True/False bit data type. I must be missing something simple... Thanks for your ideas.

    Read the article

  • Account confirmation email sent as SPAM :( PHP

    - by praveen
    Hi, I'm using PHPMailer to send a confirmation email for newly registered users in my social network. But i found out most of them have ended up in user's spam list. (hotmail and yahoo). How to avoid this? This is my script $mail=new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = mSMTPAuth(); $mail->SMTPSecure = mSMTPSecure(); $mail->Host = mHost(); $mail->Port = mPort(); $mail->Username = mUsername(); $mail->Password = mPassword(); $mail->From = mFrom(); $mail->FromName = "SiteName"; $mail->Subject = "SiteName New Account Activation"; $mail->IsHTML(true); $mail->WordWrap = 50; $mail->Body = "<h2>Welcome to " .$sitename. " " .$username. "! </h2><br><br>"; $mail->Body .= "Please click on the link below to verify your email address:<br><br>"; $mail->Body .= "<a href='".$base. "verify.php?a=" .$gen_key."'>".$base. "verify.php?a=" .$gen_key."</a>"; $mail->Body .= "<br><br>Regards<br>"; $mail->AltBody = "Welcome to " .$sitename. " " .$username. "!\n\nTo verify your email address, please click on the link below:\n\n".$base. "verify.php?a=" .$gen_key; $mail->AddAddress($email); $mail->Send(); $mail->ClearAddresses(); Please help. This is really confusing. Thanks in advance

    Read the article

  • PHP array pointer craziness

    - by JMan
    I'm trying to create a "GetCurrentLevel" method that takes a point value as an input and returns what "Level" that corresponds to. I'm storing the Level = Points mapping in an array, but the array pointer is not moving logically when I use it a foreach loop. I've added echo statements for debugging. Here's my class definition: class Levels extends Model { protected $_map = array ( 'None' => 0, 'Bronze' => 50, 'Silver' => 200, 'Gold' => 500 ); public function __construct() { parent::__construct(); } public function GetCurrentLevel($points) { foreach ($this->_map as $name => $threshold) { echo "Level Name: $name<br/>"; echo "Level Threshold: $threshold<br/>"; echo "Current Level: " . key($this->_map) . "<br/>"; echo "Current Threshold: " . current($this->_map) . "<br/>"; if ($points < $threshold) /* Threshold is now above the points, so need to go back one level */ { $previousThreshold = prev($this->_map); echo "Previous Threshold: $previousThreshold<br/>"; echo "Final Level: " . key($this->_map) . "<br/>"; return key($this->_map); } echo "Go to next level <br/>"; } } And here is what I see when I call GetCurrentLevel(60): Level Name: None Level Threshold: 0 Current Level: Bronze //* Looks like foreach immediately moves the array pointer *// Current Threshold: 50 Go to next level Level Name: Bronze Level Threshold: 50 Current Level: Bronze //* WTF? Why hasn't the array pointer moved? *// Current Threshold: 50 Go to next level Level Name: Silver Level Threshold: 200 Current Level: Bronze //* WTF? Why hasn't the array pointer moved? *// Current Threshold: 50 Previous Threshold: 0 Final Level: None But the "Final Level" should be 'Bronze' since 60 points is above the 50 points needed for a Bronze medal, but below the 200 points needed for a Silver medal. Sorry for the long post. Thanks for your help!

    Read the article

  • What should i do to test EasyMock objects when using Generics ? EasyMock

    - by Arthur Ronald F D Garcia
    See code just bellow Our generic interface public interface Repository<INSTANCE_CLASS, INSTANCE_ID_CLASS> { void add(INSTANCE_CLASS instance); INSTANCE_CLASS getById(INSTANCE_ID_CLASS id); } And a single class public class Order { private Integer id; private Integer orderNumber; // getter's and setter's public void equals(Object o) { if(o == null) return false; if(!(o instanceof Order)) return false; // business key if(getOrderNumber() == null) return false; final Order other = (Order) o; if(!(getOrderNumber().equals(other.getOrderNumber()))) return false; return true; } // hashcode } And when i do the following test private Repository<Order, Integer> repository; @Before public void setUp { repository = EasyMock.createMock(Repository.class); Order order = new Order(); order.setOrderNumber(new Integer(1)); repository.add(order); EasyMock.expectLasCall().once(); EasyMock.replay(repository); } @Test public void addOrder() { Order order = new Order(); order.setOrderNumber(new Integer(1)); repository.add(order); EasyMock.verify(repository) } I get Unexpected method call add(br.com.smac.model.domain.Order@ac66b62): add(br.com.smac.model.domain.Order@ac66b62): expected: 1, actual: 0 Why does it not work as expected ??? What should i do to pass the test ???

    Read the article

  • OpenVPN Bridge LAN-to-LAN Configuration?

    - by Shad Reese
    I'm trying to configure an OpenVPN bridge LAN-to-LAN setup. Currently, I have the OpenVPN bridge Server/Client setup up running. On the server-side my br-lan interface has tap0, eth0, and wlan0 in the bridge group. On the client-side the br-lan interface has eth0 and wlan0 in the bridge group, the client tap0 is outside of the br-lan group. Currently the two bridge groups are connected via the wlanO interfaces (server-side is the Access Point - AP and the client-side is the wireless client). My goal is to connect the two bridge groups with a wireless VPN pipe. My network configuration: Server: br-lan: 10.4.96.50 Client: br-lan: 10.4.96.75 tap0: 10.4.96.100 <---- issued by the VPN server. Unfortunately, I'm stuck with using a bridge instead of a routed OpenVPN setup. My question is how (if possible) do I add the client tap0 interface to the client bridge group, as to ensure all traffic between the server/client bridge groups is using the VPN pipe? SERVER CONFIG FILE. config openvpn sample_server # Set to 1 to enable this instance: option enable 1 option port 1194 option proto udp option dev tap0 option key /etc/easy-rsa/keys/server.key option dh /etc/easy-rsa/keys/dh1024.pem option ifconfig_pool_persist /tmp/ipp.txt option server_bridge "10.4.96.50 255.255.255.0 10.4.96.100 10.4.96.200" list push "redirect-gateway local def1" list push "dhcp-option DNS 10.4.96.14" option duplicate_cn 1 option comp_lzo 1 option max_clients 100 option log /tmp/openvpn.log option verb 3 CLIENT CONFIG FILE: config 'openvpn' 'sample_client' option 'enable' '1' option 'client' '1' option 'dev' 'tap' option 'proto' 'udp' list 'remote' '10.4.96.50 1194' option 'status' /tmp/openvpn-status.log option 'log' /tmp/openvpn.log option 'ca' '/etc/easy-rsa/keys/ca.crt' option 'cert' '/etc/easy-rsa/keys/client.crt' option 'key' '/etc/easy-rsa/keys/client.key' option 'comp_lzo' '1' option 'verb' '5' Thanks in advance,

    Read the article

  • Why my 2nd ip from traceroute is not answering the ping anymore?

    - by Pedro77
    My Internet is really laggy today, I did a tracerout and I realize that I'm having no answer from an ip at the beginning of the traceroute. see: Tracing route to 12.129.202.154 over a maximum of 30 hops 1 <1 ms <1 ms <1 ms 192.168.0.1 2 * * * Request timed out. 3 8 ms 8 ms 8 ms bd044008.virtua.com.br [189.4.64.8] 4 9 ms 8 ms 8 ms bd044009.virtua.com.br [189.4.64.9] 5 26 ms 26 ms 24 ms embratel-T0-1-5-0-tacc01.cas.embratel.net.br [200.174.243.21] 6 360 ms 15 ms 12 ms ebt-T0-15-0-12-tcore01.ctamc.embratel.net.br [200.244.140.218] 7 330 ms 349 ms 261 ms ebt-Bundle-POS11942-intl04.mianap.embratel.net.br [200.230.220.10] 8 139 ms 141 ms 139 ms sl-st30-mia-.sprintlink.net [144.223.64.221] Connection diagram: PC - Router configured as access point - Router (192.168.0.1) - Cable modem (192.168.100.1). Well, I think it is odd that the 2nd ip is not returning the ping. I looked some old tracerout logs to see what was the 2nd ip. The ip was: 10.19.0.1 So, what this 2nd ip stand for? How can I find why it is not answering the ping? I don't understand it, if does not answer the ping, how can the packets continue (yeah newbie question)? edit: well, because the hope 3 have a ping of 8 ms the hop 2 request time out should really not be a problem. But it is still odd that the 2nd hop stopped to answer ping request. So my doubts are: 1. Were the ip 10.19.0.1 is from? 2. Why it stopped to answer ping requests? 3. How can hop 7 be smaller than 6 and 8 smaller than 7 and 6!?? Shouldn't the pings be higher for each hop? Like: hop 3 time should be the sum of the hops before it plus its own time (hop 3 = 1+2+3) ??

    Read the article

  • Enable acess without WWW on Ubuntu

    - by TiuTalk
    Hi there... I want to enable the acess to my site without the "www." prefix... I tryed to insert this in my /etc/apache2/sites-available file: <VirtualHost *:80> serverName mydomain.gov.br serverAlias www.mydomain.gov.br ServerAdmin [email protected].br DocumentRoot /var/www/mydomain/ ... (lot's of other configs) </VirtualHost> But this isn't working... :(

    Read the article

  • Server currently under DDOS, not sure what to do.

    - by Volex
    Hi, My web server is currently under a DDOS attack I believe, the messages log is full of these kind of messages: May 13 15:51:19 kernel: nf_conntrack: table full, dropping packet. May 13 15:51:19 last message repeated 9 times May 13 15:51:24 kernel: __ratelimit: 78 callbacks suppressed May 13 15:51:24 kernel: nf_conntrack: table full, dropping packet. May 13 15:52:06 kernel: possible SYN flooding on port 80. Sending cookies. and a netstat has a huge amount of the following: tcp 0 0 my.host.com:http bb176da0.virtua.com.br:4998 SYN_RECV tcp 0 0 my.host.com:http 187.0.43.109:2694 SYN_RECV tcp 0 0 my.host.com:http 109.229.4.145:1722 SYN_RECV tcp 0 0 my.host.com:http 189-84-163-244.sodobr:63267 SYN_RECV tcp 0 0 my.host.com:http bd66839d.virtua.com.br:3469 SYN_RECV tcp 0 0 my.host.com:http 69.101.56.190.dsl.int:52552 SYN_RECV tcp 0 0 my.host.com:http pc-62-230-47-190.cm.vt:2262 SYN_RECV tcp 0 0 my.host.com:http 189-84-163-244.sodobr:63418 SYN_RECV tcp 0 0 my.host.com:http pc-62-230-47-190.cm.vt:1741 SYN_RECV tcp 0 0 my.host.com:http zaq3d739320.zaq.ne.jp:2141 SYN_RECV tcp 0 0 my.host.com:http netacc-gpn-4-80-73.po:52676 SYN_RECV tcpdump shows: 7:11:08.564510 IP 187-4-1xx-4.xxx.ipd.brasiltelecom.net.br.54821 my.host.com.http: S 999692166:999692166(0) win 65535 17:11:08.566347 IP 114-44-171-67.dynamic.hinet.net.1129 my.host.com.http: S 605369055:605369055(0) win 65535 17:11:08.570210 IP 200-101-13-130.pvoce300.ipd.brasiltelecom.net.br.5590 my.host.com.http: S 2813379182:2813379182(0) win 16384 17:11:08.571290 IP dsl-189-143-30-99-dyn.prod-infinitum.com.mx.1615 my.host.com.http: S 281542700:281542700(0) win 65535 17:11:08.583847 IP dsl-189-143-30-99-dyn.prod-infinitum.com.mx.1617 my.host.com.http: S 499413892:499413892(0) win 65535 17:11:08.588680 IP 170.51.229.112.2569 my.host.com.http: S 2195084898:2195084898(0) win 65535 17:11:08.588773 IP gw2-1.211.ru.3180 my.host.com.http: F 2315901786:2315901786(0) ack 2620913033 win 64240 17:11:08.590656 IP 200-101-13-130.pvoce300.ipd.brasiltelecom.net.br.5614 my.host.com.http: S 2813715032:2813715032(0) win 16384 17:11:08.591212 IP 203.82.82.54.15848 my.host.com.http: S 4070423507:4070423507(0) win 16384 17:11:08.591254 IP 203.82.82.54.2545 my.host.com.http: S 1790910784:1790910784(0) win 16384 17:11:08.591289 IP 203.82.82.54.28306 my.host.com.http: S 578615626:578615626(0) win 16384 17:11:08.591591 IP gw2-1.211.ru.3191 my.host.com.http: F 2316435991:2316435991(0) ack 2634205972 win 64240 17:11:08.591790 IP 200-101-13-130.pvoce300.ipd.brasiltelecom.net.br.5593 my.host.com.http: S 2813659017:2813659017(0) win 16384 17:11:08.593691 IP gw2-1.211.ru.3203 my.host.com.http: F 2316834420:2316834420(0) ack 2629074987 win 64240 I'm not sure what I can do to limit/mitigate this, currently no webpages are being served, any help gratefully appreciated.

    Read the article

  • Outlook Signature Broken in Entourage

    - by Eric J.
    Some of our company uses Windows with Outlook 2010, and the rest use Mac with Entourage. When our standard signature line is included in an email that goes to Entourage, the result does not display correctly. It appears that Entourage is mangling the HTML. My working theory is that Entourage encounters inline CSS styles it does not know about and stops processing styles, but I'm really not sure. Question: How can I enter a signature into Outlook 2010 that will render correctly in Entourage? For example, can I specify somehow the exact HTML to use? Here's an example of how the HTML is being changed. Original on Outlook, as received by another Outlook client: <span style='font-size:9.0pt;font-family:"Century Gothic","sans-serif"; color:#1785C5'>My Company<br> </span></b><span class=apple-style-span><span style='font-size:9.0pt; font-family:"Century Gothic","sans-serif";color:#666666'>123 Main St.</span></span><span class=apple-style-span><span style='font-size:9.0pt;font-family:"Century Gothic","sans-serif"; color:#AFAFAF'>&nbsp;</span></span><span class=apple-style-span><span style='font-size:9.0pt;font-family:"Century Gothic","sans-serif";color:#666666'>Suite 100</span></span> Note the use of spans, color #1785C5 and color #666666. Same original email, as displayed in an Entourage client: <span style='font-size:9.0pt;font-family:"Century Gothic","sans-serif"; mso-fareast-font-family:"Times New Roman"'><br> <span style='color:#656565'>My Company<br> 123 Main St Suite 100<br> </span> Note the use of br tags rather than spans, and the color #656565.

    Read the article

  • CPanel: Every url is being redirected to http://:2083

    - by Frank
    On my cpanel server, I restored about 50 accounts from crashed cpanel server. All of the sites were working fine, but suddenly without changing anything, every site started to get redirected to url "http://:2083/"., There is nothing in logs, no errors. when i do wget it says: wget grinfeld.com.br --2012-09-04 13:18:23-- http://grinfeld.com.br/ Resolving grinfeld.com.br... 198.101.221.254 Connecting to grinfeld.com.br|198.101.221.254|:80... connected. HTTP request sent, awaiting response... 301 Moved Location: https://:2083/ [following] https://:2083/: Invalid host name.

    Read the article

  • Trying to Set up SMTP Server on WIndows Server 2012

    - by datc
    I'm working on a website, and I need to test the functionality of sending email messages from ASP.NET, something like this: Dim msg As New MailMessage("email1", "email2") msg.Subject = "Subject"<br> msg.IsBodyHtml = True<br> msg.Body = "Click <a href='site'>here</a>." Dim client As SmtpClient = New SmtpClient() client.Host = "My-Server"<br> client.Port = 25<br> client.DeliveryMethod = SmtpDeliveryMethod.Network<br> client.Send(msg) This is running from a Windows 8 workstation. I've installed SMTP server on my Windows Server 2012 machine. The mail shows up in the mailroot/Queue folder and sits there, eventually getting deposited into Badmail. Now I have AT&T U-verse at home, and a few devices connected to the gateway, including let's call it "My-Server." When I run SmtpDiag from say, datc@... to [email protected] I get SOA serial number match passed, Local DNS (99-135-60-233.lightspeed.bcvloh.sbcglobal.net) & Remote DNS (hotmail.com) tests *not* passed, and ultimately, Connecting to the server failed. Error: 10060. Failed to submit mail to mx2.hotmail.com error. When I set My-Server's IP to static and equal to the external IP, 99.135.60.233, and again run SmtpDiag, I get SOA, Local DNS, and Remote DNS tests passed, but the same 10060 error. Same for yahoo.com, gmail.com, and so forth. Is it my ISP's job to fix this? Some PTR record missing somewhere? Is it at all possible to have a home-based SMTP server? All I want is to test my email code. Perhaps, my IP address is just not "trusted" somehow. Thanks.

    Read the article

  • PHP script keeps doing mmap/munmap

    - by Aurélien Momow
    Hello, My PHP script contains a loop, which does nothing much more than echoing and dereferencing pointers (like in $tab[$othertab[$i]]- stuff). It was working great until yesterday, when this script starting being VERY slow (like 50 times slower than before). After using strace, i figured out that 90% of the time, the script does mmap/munmap. Here is a random portion of the strace log : mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 munmap(0x7fac0156c000, 266240) = 0 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0156c000 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac0152b000 mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fac014ea000 Here is the result of the strace -c command : % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 82.77 0.004092 0 13542 mmap 9.69 0.000479 0 3642 write 7.54 0.000373 0 13541 munmap 0.00 0.000000 0 100 read 0.00 0.000000 0 88 poll 0.00 0.000000 0 25 4 access ------ ----------- ----------- --------- --------- ---------------- 100.00 0.004944 30938 4 total Here is the php script : function affAnnonce($tabAnnonces, $isDoublon = 0) { GLOBAL $db, $base, $tabDomaine, $doublon, $traduction, $tab_contrat, $tab_emploi, $tab_categ, $tab_metier, $tab_region, $tab_departement, $tab_secteur, $tab_experience, $calc_all, $tabLangues, $tabLanguesNiveau, $tabNoAffAnnonce, $tabHisto; foreach($tabAnnonces AS $tmp) { if (in_array($tmp['id'], $tabNoAffAnnonce) === true) { continue; } $value->host = "../"; foreach($tabDomaine AS $domaine => $valeur) { if ($domaine == $tmp['domaine']) { $value->host = $valeur->host; break; } } // Ordre // secteur;metier;contrat;emploi;region;langues;domaine $tabPushModif = array(); if ($tmp['push_preview'] != '') { $tabPushModif = explode(';', $tmp['push_preview']); $tabPushModif['secteur'] = $tabPushModif[0]; $tabPushModif['metier'] = $tabPushModif[1]; $tabPushModif['contrat'] = $tabPushModif[2]; $tabPushModif['id_emploi'] = $tabPushModif[3]; $tabPushModif['regions'] = $tabPushModif[4]; $tabPushModif['langues'] = $tabPushModif[5]; $tabPushModif['domaine'] = $tabPushModif[6]; } $infoSoc = get_nom_societe($tmp['id_societe']); $number = ($tmp['nb_preview_push'] != '' ? $tmp['nb_preview_push'] : '&nbsp;'); $secteurs = explode ("/", $tmp[secteur]); $sector = ""; $count_sect = count($secteurs); for ($k = 0; $k < $count_sect; $k++) { if ($secteurs[$k] != '') { $sector .= $tab_secteur[$secteurs[$k]].'/'; } } $tmp['poste'] = apresinsertion($tmp['poste']); $tmp['metier'] = $tab_metier[$tmp['metier']]; $tmp['region'] = $tab_region[$tmp['region']]; $tmp['departement'] = $tab_departement[$tmp['departement']]; $tmp['secteur'] = $sector; $tmp['id_contrat'] = $tmp['contrat']; $tmp['contrat'] = $tab_contrat[$tmp['contrat']]; $tmp['emploi'] = $tab_emploi[$tmp['id_emploi']]; $tmp['categorie'] = $tab_categ[$tmp['categorie']]; echo '<tr id="'.($isDoublon ? 'dbl_' : '').$tmp['id'].'"><td align="center" class="tdFirst nowrap dbl_'.$tmp['id'].'" id="aff_'.$tmp['id'].'"'; switch($tmp['affiche']) { case '0': echo ' bgcolor=#DBB7FF'; break; default : ; } echo '><a href=?op=annonces&search4='.$tmp[id].' target=_new>'.$tmp[id].'</a><br />'; echo '<a href="'.$value->host.'" target="blank">'.strtoupper($tmp['domaine']).'<br /><img src="../images/flags/'.$tmp['domaine'].'.png" border=0 align=middle></a>'; echo '</TD><TD align=center class=tdNext'; if ($tmp['filtre'] == 1) echo ' bgcolor=#FF0000'; echo '>'; if ($isDoublon) echo '<a id="'.$tmp['id'].'" class="doublon" href="#">DOUBLON</a> - '; if (($tmp[id_reponse] == 1) || ($tmp[id_reponse] == 2) || ($tmp[id_reponse] == 4) || ($tmp[id_reponse] == 5)) echo '<a href="javascript:voir_annonce(\''.$tmp['id'].'\', \''.$value->host.'\')" onMouseOver="showPreview('.$tmp['id'].');" onMouseOut="hidePreview('.$tmp['id'].');">'.$tmp['poste'].'</a>'; if ($tmp[id_reponse] == 3) echo '<a href="javascript:voir_annonce3(\''.$tmp['url_reponse'].'\')" onMouseOver="showPreview('.$tmp['id'].');" onMouseOut="hidePreview('.$tmp['id'].');">'.$tmp['poste'].'</a>'; if ($tmp['urgent'] == 1) print " - <font class=r_bold>urgent</font>"; if ($tmp['gold'] == 1) print " - <font class=g_bold>gold</font>"; if ($tmp['cvtheque'] == 1) print " - CVthèque"; if ($tmp['url_reponse'] != '' && $tmp['id_reponse'] != 3) { echo '<br /><br />URL - '; $len = strlen($tmp['url_reponse']); if ($len > 50) { $link = substr($tmp['url_reponse'], 0, 47).'...'; } else { $link = $tmp['url_reponse']; } echo '<a href="'.$tmp['url_reponse'].'" style="color: #666;" target="_blank">'.$link.'</a>'; } // Début du div ou sera placé l'annonce echo '<br /><div id="preview_'.$tmp['id'].'" name="preview_'.$tmp['id'].'" class="tdStyle1" style="z-index: 1000; display: none; position: fixed; left: 0px; top: 0px; padding: 4px; border: 1px solid #666; background: #fff; text-align: left; width: 777px;" onMouseOver="showPreview('.$tmp['id'].');" onMouseOut="hidePreview('.$tmp['id'].');">'; $tmp["url"] = substr($tmp["url"], 7); $id_modele = getIdModeleByAnnonce($tmp['id_societe'], $tmp["id"], $tmp['domaine']); $tmp["poste"] = mb_strtoupper($tmp["poste"]); $isFnh = isFnhAnnonce($tmp['id']); $logo = ""; if ($isFnh) { $logo_jpg = getFnhLogo(); $logo = "<img align='center' border='0' src='".$logo_jpg."' />"; } else { if ($id_modele > 0) { if ($tmp['id_reponse'] == 1) { $logo_gif = "../fichiers/societes/".$tmp['id_societe']."/".$id_modele.".gif"; if (file_exists($logo_gif)) { $logo = "<img align=center border=0 src=".$logo_gif.">"; } } else { $rep = "../fichiers/societes/".$tmp['id_societe']."/".$id_modele; $logo_jpg = $rep.".jpg"; $logo_swf = $rep.".swf"; $logo_gif = $rep.".gif"; if (file_exists($logo_jpg)) { $logo = "<img align=center border=0 src=".$logo_jpg.">"; } elseif (file_exists($logo_swf)) $logo = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="120" height="600"> <param name=movie value="'.$logo_swf.'"> <param name=quality value=high> <embed src="'.$logo_swf.'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="120" height="600"></embed> </object>'; elseif (file_exists($logo_gif)) { $logo = "<img align=center border=0 src=".$logo_gif.">"; } } } } if (strlen($logo) > 0 && strlen($tmp['url']) > 0) $logo = "<a href=http://".$tmp['url']." target=_blank>".$logo."</a>"; if (strlen($tmp['url_reponse']) <= 0) { $tmp['url_reponse'] = "../jobs/repondre_annonce.php?id=".$tmp['id']."\" onClick=\""; if ($tmp['contact_email'] == "") $tmp['url_reponse'] .= "alert('".$traduction->aff_word("repondre_courrier", $tabTrad['only_word']).'\n'.$tmp['societe'].'\n'.str_replace("<br />", '\n', ereg_replace("[\r\n\t]", "", $tmp['adresse']))."');"; else $tmp['url_reponse'] .= "popUp(this.href, 'scroll', 540, 400);"; $tmp['url_reponse'] .= "return false;"; } ?> <table width="775" cellspacing="0" cellpadding="0" border=0> <? if ($tmp['id_reponse'] != "2") { ?> <tr> <td width="575" align=center valign=top> <table width="535" border=0 cellspacing=0 cellpadding=2> <tr> <td colspan="2" class="nom_societe"><?=$tmp['societe']?></td> </tr> <tr> <td colspan="2"><hr size=1 color=#000000></td> </tr> <tr> <td colspan="2" align="right"><?=date_2fr($tmp["date_affichage"], 1)?></td> </tr> <tr> <td align="right" class=bold><?=$traduction->aff_word("pays")?>&nbsp;:</td> <td align="left"><?=$tmp['pays0']?></td> </tr> <? if ($tmp['region']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("region")?>&nbsp;:</td> <td align="left"><?=$tmp['region']?></td> </tr> <? } if ($tmp['departement']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("departement")?>&nbsp;:</td> <td align="left"><?=$tmp['departement']?></td> </tr> <? } if ($tmp['ville']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("ville")?>&nbsp;:</td> <td align="left"><?=$tmp['ville']?></td> </tr> <? } if ($tmp['debut']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("debut_travail")?>&nbsp;:</td> <td align="left"><?=$tmp['debut']?></td> </tr> <? } ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("type_contrat")?>&nbsp;:</td> <td align="left"><?=$tmp['contrat']?></td> </tr> <? if ($tmp['emploi']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("type_emploi")?>&nbsp;:</td> <td align="left"><?=$tmp['emploi']?></td> </tr> <? } if ($tmp['salaire']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("salaire")?>&nbsp;:</td> <td align="left"><?=$tmp['salaire']?></td> </tr> <? } if ($tmp['experience']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("experience_metier")?>&nbsp;:</td> <td align="left"><?=$tab_experience[$tmp['experience']]?></td> </tr> <? } if ($tmp['reference']) { ?> <tr> <td align="right" class=bold><?=$traduction->aff_word("reference")?>&nbsp;:</td> <td align="left"><?=$tmp['reference']?></td> </tr> <? } ?> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? if ($tmp['presentation']) { ?> <tr> <td valign=top align="right" class=bold><?=$traduction->aff_word("presentation")?>&nbsp;:</td> <td style="text-align: justify;"><?=$tmp['presentation']?></td> </tr> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? } ?> <tr> <td valign="top" class=bold align="right"><?=$traduction->aff_word("poste")?>&nbsp;:</td> <td valign="top" class=titre_poste align=center><?=$tmp['poste']?></td> </tr> <tr> <td colspan=2>&nbsp;</td> </tr> <tr> <td valign="top" class=bold align="right"><?=$traduction->aff_word("description")?>&nbsp;:</td> <td style="text-align: justify;"><?=$tmp['description']?></td> </tr> <tr> <td width=100%>&nbsp;</td> <td width=405><hr size=1 color=#000000 width=405></td> </tr> <? if ($tmp['profil']) { ?> <tr> <td valign="top" align="right" class=bold><?=$traduction->aff_word("profil")?>&nbsp;:</td> <td valign="top" style="text-align: justify;"><?=$tmp['profil']?></td> </tr> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? } if ($tmp['recommandation']) { ?> <tr> <td valign="top" align="left"></td> <td valign="top" style="text-align: justify;"><?=$tmp['recommandation']?></td> </tr> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? } if ($tmp['contact_nom'] || $tmp['contact_prenom']) { ?> <tr> <td valign="top" align="right" class=bold><?=$traduction->aff_word("contact")?>&nbsp;:</td> <td valign="top" align="left"><?=$tmp['contact_prenom']?>&nbsp;<?=$tmp['contact_nom']?></td> </tr> <tr> <td>&nbsp;</td> <td><hr size=1 color=#000000 width=405></td> </tr> <? } ?> <? } elseif ($tmp['domaine'] != 'de') { ?> <tr> <td colspan=2><table width="755" align=right valign=top><tr><td><?=$tmp['presentation']?></td></tr></table></td> </tr> <? } ?> <tr> <td rowspan=6>&nbsp;</td> <td><a href="<?=$tmp['url_reponse']?>" target="_blank">&gt;&gt;&nbsp;<?=$traduction->aff_word("repondre_en_ligne")?></a></td> </tr> <tr> <td><a href="../jobs/affiche_imprime_annonce.php?id=<?=$tmp['id']?>" onClick="popUp(this.href, 'scroll', 540, 400);return false;" target="_blank">&gt;&gt;&nbsp;<?=$traduction->aff_word("version_imprimer")?></a></td> </tr> <tr> <td><a href="../jobs/send_friend_annonce.php?id=<?=$tmp['id']?>" onClick="popUp(this.href, 'clean', 400, 300);return false;" target="_blank">&gt;&gt;&nbsp;<?=$traduction->aff_word("envoi_ami")?></a></td> </tr> <tr> <td><a href="./affiche_liste.php?soc=<?=$tmp['societe_clean']?>">&gt;&gt;&nbsp;<?=$traduction->aff_word("toutes_offres")?> <?=$tmp['societe']?></a></td> </tr> <tr> <td><a href="../jobs/index.php">&gt;&gt;&nbsp;<?=$traduction->aff_word("nouvelle_recherche")?></a></td> </tr> <tr> <td><a href="../jobs/index.php" onClick="javascript:retour(); return false;">&lt;&lt;&nbsp;<?=$traduction->aff_word("retour")?></a></td> </tr> <? if ($tmp['id_reponse'] != "2") { ?> </table> </td> <td width="200" align=center class=black_bord valign=top> <table width="190" cellspacing=0 cellpadding=0 border=0> <tr> <td colspan="2" align="center" valign="top" class=bold><? if ($tmp['id_reponse'] != "5") { ?><br><? } ?><?=$logo?><br><br><?=$tmp['societe']?></td> </tr> <? if ($tmp['adresse']) { ?> <tr> <td align="center" colspan=2><?=$tmp['adresse']?></td> </tr> <tr> <td colspan=2>&nbsp;</td> </tr> <? } if ($tmp['contact_tel']) { ?> <tr> <td class=bold align=right><?=$traduction->aff_word("tel")?> :</td> <td align=center><?=$tmp['contact_tel']?></td> </tr> <? } if ($tmp['contact_fax']) { ?> <tr> <td class=bold align=right><?=$traduction->aff_word("fax")?> :</td> <td align=center><?=$tmp['contact_fax']?></td> </tr> <? } if ($tmp['url']) { ?> <tr> <td colspan=2 align=center><a href="http://<?=$tmp['url']?>" target="_blank"><?=$tmp['url']?></a></td> </tr> <? } ?> </table> </td> </tr> <? } ?> </table> <? echo '</div>'; // Fin du div ou sera placé l'annonce echo "</TD><TD align=center class=tdNext><b>".date_2fr($tmp['date_creation'], 1)."</b><br>".date_2fr($tmp['date_affichage'], 1); echo "</TD><TD align=center class=tdNext>".$tmp[societe]."<br>(<i><a href=".$value->host."login/login.php?login=".$infoSoc->email."&pass=".$infoSoc->password." target=_blank>".$infoSoc->nom."</a></i>)<br><a href=index.php?op=entreprise&ac=tableau_bord&id_societe=".$tmp['id_societe'].">compte</a></TD>"; $color = ''; switch($tmp[push_mail]) { case "0": $color = " bgcolor=#DBB7FF"; break; case "2": $color = " bgcolor=#CCCCCC"; break; default : ; } $type_rep = ""; switch ($tmp[id_reponse]) { case 1: $type_rep = "Standard"; break; case 2: $type_rep = "Chartée"; break; case 3: $type_rep = "Metamoteur"; break; case 4: $type_rep = "Reponse sur site"; break; case 5: $type_rep = "Semi-chartée"; break; } print " <td align=center class=tdNext> <table width=100% border=0 cellspacing=0 cellpadding=0> <tr> <td align=center class=cadreBas>".$tmp['contrat']." - ".$tmp['emploi']."</td> <td $color align=center rowspan=4 width=40%> <a onclick=\"javascript:colorannonce(this, '#CFFFCF');\" href=?op=agentalertes&action=modify_push&amp;id_annonce=".$tmp[id]." target=_blank>Modifier push</a><br><br> <a onclick=\"sendPush(this, ".$tmp['id']."); return false;\" href=\"#\">Envoyer Push</a> </td> </tr> <tr> <td align=center class=cadreBas>".(strlen($tmp['metier']) > 0 ? $tmp['metier'] : '<font class=gris_i>'.$tmp['categorie'].'</font>')."</td> </tr> <tr> <td align=center class=cadreBas>".$tmp[secteur]."</td> </tr> <tr> <td align=center>".($number < 500 ? '<font color="red">' : ($number > 1500 ? '<font color="orange">' : '<font color="green">')).$number."</font></td> </tr> </table> </td> <td align=center class=tdNext> <table width=100% border=0 cellspacing=0 cellpadding=0> <tr> <td align=center class=cadreBas>"; if (strlen($tabPushModif['regions']) > 0) { $tab = explode('/', $tabPushModif['regions']); foreach($tab AS $elem) { if (strlen($elem) <= 0) continue; if (strpos($elem, 'dep-') !== false) { echo $tab_departement[substr($elem, 4)]; $query_tmp = 'SELECT region FROM ref_departement WHERE id = "'.substr($elem, 4).'"'; $obj = $db->getObj($query_tmp); if ($obj) { echo ' - '.$tab_region[$obj->region]; $query_tmp = 'SELECT rp.code_pays FROM ref_pays rp INNER JOIN ref_region rr ON rr.pays = rp.id WHERE rr.id = "'.$obj->region.'"'; $obj = $db->getObj($query_tmp); if ($obj) echo ' ('.$obj->code_pays.')'; } } elseif (is_numeric($elem) === false) { echo '<font class=gris_i>'.$tmp['departement'].' - '.$tmp['region'].'</font> ('.$elem.')'; } else { echo '<font class=gris_i>'.$tmp['departement'].'</font> - '.$tab_region[$elem]; $query_tmp = 'SELECT rp.code_pays FROM ref_pays rp INNER JOIN ref_region rr ON rr.pays = rp.id WHERE rr.id = "'.$obj->region.'"'; $obj = $db->getObj($query_tmp); if ($obj) echo ' ('.$obj->code_pays.')'; } } } else echo $tmp['departement']." - ".$tmp['region']." (".$tmp['code_pays'].")"; echo "</td> </tr> <tr> <td align=center class=cadreBas>".$tmp[ville]."</td> </tr> <tr> <td align=center class=cadreBas>"; if (strlen($tabPushModif['metier']) > 0) { $tmpExp = array(); $tab = explode('/', $tabPushModif['metier']); foreach($tab AS $elem) { if (strlen($elem) <= 0) continue; $tmpMetier = explode('-', $elem); if (isset($tmpMetier[1])) { if (in_array($tmpMetier[1], $tmpExp) === true) continue; $tmpExp[] = $tmpMetier[1]; if ($tmpMetier[1] == $tmp['experience']) echo '<b>'.$tab_experience[$tmpMetier[1]].'</b>/'; else echo $tab_experience[$tmpMetier[1]].'/'; } } if (count($tmpExp) <= 0) echo '<font class=gris_i>'.$tab_experience[$tmp['experience']].'</font>'; } else echo $tab_experience[$tmp['experience']]; echo "</td> </tr> <tr> <td align=center>".$tabLangues[$tmp['id_langue']]->langue." - ".$tabLanguesNiveau[$tmp['id_langue_niveau']]->langue_niveau."</td> </tr> </table> </td> <td align=center class=tdNext> <table width=100% cellspacing=0 cellpadding=0 border=0> <tr> <td align=center class=cadreBas>$type_rep</td> </tr> <tr> <td align=center>".$tmp[compteur_vu]."&nbsp;/&nbsp;<a href=?op=gcand&ac=liste&id_annonce=".$tmp[id]."&statut=all target=_new>".$tmp[compteur_repondu]."</a></td> </tr> </table> </td> <td align=center class=tdNext> <table width=100% cellspacing=0 cellpadding=0 border=0> <tr> <td align=center class=cadreBas><a href=?op=annonces&ac=modifier&id_annonce=".$tmp['id']." target=_new>Modifier</a></td> </tr> <tr> <td align=center class=cadreBas><a href='' onClick=\"valid_delete('".$tmp['id']."'); return false;\">Supprimer</a></td> </tr> <tr> <td align=center><a href='' onClick='changeAff(".$tmp['id']."); return false;' id='changeAff_".$tmp['id']."'>".($tmp['affiche'] == 1 ? 'Mettre hors ligne' : 'Mettre en ligne')."</a></td> </tr> </table> </td> <td align=center class='tdNext gris'> <p style=\"color:#444;\"> &nbsp;".nl2br($tmp['push_res']).'</p>'; if (is_array($tabHisto[$tmp['id']])) { echo '<p style="color:#888; padding-top:5px;">'; foreach($tabHisto[$tmp['id']] as $histo) { echo $histo['type_modif'].' '.HumanDateTime($histo['date']).' par '.$histo['user']; if ($histo['new_annonce']) { echo ' [New ID : <a href="index.php?op=annonces&search4='.$histo['new_annonce'].'">'.$histo['new_annonce'].'</a>]'; } echo '<br />'; } echo '</p>'; } echo " </td> <td align=center>&nbsp;".$tmp['source']; if (!empty($tmp['source_ref'])) { echo '<br /><a href="redirect.php?site='.$tmp['source_ref'].'" target="_blank">Voir original</a>'; } echo '</td></tr>'; if (isset($doublon) && !$isDoublon) { $query2 = " SELECT a.*, rp.pays0, rp.code_pays FROM annonces a INNER JOIN ref_pays rp ON rp.id = a.pays WHERE a.id_societe = '".$tmp['id_societe']."' AND a.contrat = '".$tmp['id_contrat']."' AND a.domaine = '".$tmp['domaine']."' AND a.id != '".$tmp['id']."' AND ADDDATE(a.date_creation, INTERVAL 2 MONTH) > '".$tmp['date_creation']."' AND a.poste = \"".addslashes($tmp['poste'])."\" AND a.ville = \"".addslashes($tmp['ville'])."\" AND a.societe = \"".addslashes($tmp['societe'])."\" AND (a.id_societe != 1 OR (a.id_societe = 1 AND a.contact_email = \"".$tab_annonce['contact_email']."\")) ORDER BY a.id DESC"; $tabAnnonces2 = $db->getTab($query2); if (count($tabAnnonces2) > 0) { $tabId = array(); foreach($tabAnnonces2 as $annonc) { $tabId[] = $annonc['id']; } $tmpListAnnonceTab = annoncelist::getHistorique($tabId); $tmpTabHisto = createTabHisto($tmpListAnnonceTab); $tabHisto += $tmpTabHisto; //Additionne les 2 tableaux, contrairement à array_merge il garde les clés !! affAnnonce($tabAnnonces2, 1); foreach($tabAnnonces2 AS $tmpAnn) $tabNoAffAnnonce[] = $tmpAnn['id']; } } } } ?> Only this script is slow, all the others on the same server/domain/directory work great. On an other server, the same script works fine. The script takes up to 90% of CPU when running. Any ideas?

    Read the article

  • jQuery dialog box, php form.

    - by tony noriega
    i have a dialog box that opens on pageload for a site. script type="text/javascript"> $(function() { $('#dialog-message').dialog({ modal: 'true', width: '400' }); }); </script> this pulls up an include: <div id="dialog-message" title="Free Jiu Jitsu Session at Alliance"> <!--#include virtual="/includes/guest.php" --> guest.php has a very small form that is processed by the page itself: <?php $dbh=mysql_connect //login stuff here if (isset($_POST['submit'])) { if (!$_POST['name'] | !$_POST['email']) { echo"<div class='error'>Error<br />Please provide your Name and Email Address so we may properly contact you.</div>"; } else { $age = $_POST['age']; $name = $_POST['name']; $gender = $_POST['gender']; $email = $_POST['email']; $phone = $_POST['phone']; $comments = $_POST['comments']; $query = "INSERT INTO table here (age,name,gender,email,phone,comments) VALUES ('$age','$name','$gender','$email','$phone','$comments')"; mysql_query($query); mysql_close(); $yoursite = "my site here"; $youremail = $email; $subject = "Website Guest Contact Us Form"; $message = "message here"; $email2 = "send to email address"; mail($email2, $subject, $message, "From: $email"); echo"<div class='thankyou'>Thank you for contacting us,<br /> we will respond as soon as we can.</div>"; } } ?> <form id="contact_us" class="guest" method="post" action="/guest.php" > <fieldset> <legend>Personal Info</legend> <label for="name" class="guest">Name:</label> <input type="text" name="name" id="name" value="" /><br> <label for="phone" class="guest">Phone:</label> <input type="text" name="phone" id="phone" value="" /><br> <label for="email" class="guest">Email Address:</label> <input type="text" name="email" id="email" value="" /><br> <label for="age" class="guest">Age:</label> <input type="text" name="age" id="age" value="" size="2" /><br> <label for="gender" class="guest">Sex:</label> <input type="radio" name="gender" value="male" /> Male <input type="radio" name="gender" value="female" /> Female<br /> </fieldset> <fieldset> <legend>Comments</legend> <label for="comments" class="guest">Comments / Questions:</label> <textarea id="comments" name="comments" rows="4" cols="22"></textarea><br> <input type="submit" value="Submit" name="submit" /> <input type="Reset" value="Reset" /> </fieldset> </form> Problem is, that the path of the form action does not work, becasue this dialog box is on the index.html page of the site, and if i put the absolute path, it doesnt process... i have this functioning on another contact us page, so i know it works, but wit the dialog box, it seems to have stumped me... what should i do?

    Read the article

  • Image displays when clicked with multiple radio button groups

    - by Jean
    I'm creating a form that has seven different selection groups, most with radio buttons (ie: buns, cheese), a couple with check boxes (toppings). I need jQuery to differentiate the groups and display images when clicked. The value can't be part of the code as I use it as part of the php form in the next page. <html> <head> <script src="js/jquery-1.6.1.min.js" type="text/javascript"></script> </head> <body> <div id="myRadioGroup"> <input type="radio" name="cars" value="American" />Yellow American<br /> <input type="radio" name="cars" value="Swiss" />Jarlsberg Swiss<br /> <input type="radio" name="cars" value="Blue" />Blue<br /> <input type="radio" name="cars" value="Cheddar" />Aged Cheddar<br /> <div id="American" class="desc"><img class="item" src="images/american-cheese-slice.png"></div> <div id="Swiss" class="desc"><img class="item" src="images/swisscheese.png"></div> <div id="Blue" class="desc"><img class="item" src="images/bluecheese.png"></div> <div id="Cheddar" class="desc"><img class="item" src="images/agedcheddar.png"></div> </div> <div id="myBunGroup"> <input type="radio" name="buns" value="Whole Wheat" />Whole Wheat<br /> <input type="radio" name="buns" value="Classic" />Classic<br /> <input type="radio" name="buns" value="Gluten Free" />Gluten Free<br /> <input type="radio" name="buns" value="Wrap" />Wrap<br /> <div id="WholeWheat" class="desc"><img class="item" src="images/wholewheat.png"></div> <div id="Classic" class="desc"><img class="item" src="images/classic.png"></div> <div id="GlutenFree" class="desc"><img class="item" src="images/gf-buns.png"></div> <div id="Wrap" class="desc"><img class="item" src="images/tortilla.png"></div> </div> <div id="myToppingGroup"> </div> <!-- http://stackoverflow.com/questions/5940963/jquery-show-and-hide-divs-based-on-radio-button-click --> <script> $(document).ready(function() { $(".item").hide(); $("input[name$="['cars', 'buns']"]").click(function() { var test = $(this).val(); $(".item").hide(); $("#" + test).show(); }); }); </script> </body> </html>

    Read the article

  • JavaScript issues

    - by Michael
    My java scirpt is not working right. It is simple pre-vailidation form and I can not get the script to work. It is supposed to validate each field but I can not get it to validate past the first name. I stripped out all of the other garbage so the code would not be confusing Should be a copy paste to notepad. Little help please <?xml version="1.0" encoding="iso-8859-1"?> <!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> <script language="JavaScript" type="text/javascript"> <!-- function validateForm(theForm) { var name = theForm.firstname.value; var name = theForm.lastname.value; var email = theForm.email.value; if (name == "") { alert("Please fill in your First Name."); theForm.firstname.focus(); return false; } if (name == "") { alert("Please fill in your Last Name."); theForm.lastname.focus(); return false; } if (email == "") { alert("Please fill in your email address."); theForm.email.focus(); return false; } return true; } //--> </script> if (!theForm.myCheckbox1.checked { alert("Please check the honor box."); return false; } </head> <body> </script> <fieldset> <legend>Fun in the Sun With JavaScirpt</legend> <ul> <form action="blah.cgi" method="post" onSubmit="return validateForm(this);"> First name: <input type="text" name="firstname"> <font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"><strong>*</strong></font> <br><br> Last name: <input type="text" name="lastname"> <font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"><strong>*</strong></font> <br><br> Email address: <input type="text" name="email"> <font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"><strong>*</strong></font> <br><br> Phone Number: <input type="text" name="phone"><br><br> <input type="submit" name="submit" value="Submit"> </form> <input type="checkbox" name="myCheckbox" value="someValue"><font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"><strong>*</strong></font> <P>By checking this Box you are confirming the data is accurate</p> <p>(* indicates a required field)</p> </body> </html>

    Read the article

  • One url to image, few results

    - by Misiur
    Hi! I'm trying to show programmers that some captchas are too weak, and i'm breaking them. Now i've got something like this: Function: <?php function cbreak($image) { $info = getimagesize($image); $width = $info[0]; $height = $info[1]; $img = imagecreatefromgif($image); $map = array(); for($y=0; $y<$height; $y++) { for($x=0; $x<$width; $x++) { $color = imagecolorsforindex($img, imagecolorat($img, $x, $y)); $map[$x][$y] = ($color['red'] + $color['blue'] + $color['green'] > 750) ? TRUE : FALSE; } } echo '<pre>'; for($y=0; $y<$height; $y++) { for($x=0; $x<$width; $x++) { echo ($map[$x][$y] == TRUE) ? 'X' : '-'; } echo '<br>'; } echo '</pre>'; $sum = ''; for($x=0; $x<$width; $x++) { $count = 0; for($y=0; $y<$height; $y++) { if($map[$x][$y] == TRUE) $count++; } $sum .= ($count == 0) ? 'X' : $count; } $sum = preg_replace('#X+#', 'X', $sum); $sum = trim($sum, 'X'); $letters = explode('X', $sum); $patterns = array( /* Still not here */ ); $token = ''; for($i=0; $i<count($letters); $i++) { $token .= $patterns[$letters[$i]]; } echo $token; } ?> Action: <?php $cl = curl_init("http://www.takeagift.pl/rejestracja"); curl_setopt($cl, CURLOPT_RETURNTRANSFER, 1); $r = curl_exec($cl); $pattern = "/src=[\"'].*[\"']?/i"; preg_match_all($pattern, $r, $images); $c = array(); for($i=0; $i<sizeof($images[0]); $i++) { if(strstr($images[0][$i], 'captcha') !== false) { $c = $images[0][$i]; } } $s1 = substr($c, 0, -8); echo $s1."<br />"; $s = substr($s1, 5, -1); echo $s."<br />"; curl_close($cl); ?> <img src="http://www.takeagift.pl/includes/modules/captcha.php?1270900968" /><br /> <img src="http://www.takeagift.pl/includes/modules/captcha.php?1270900968" /><br /> <img src="http://www.takeagift.pl/includes/modules/captcha.php?1270900968" /><br /> <img src="http://www.takeagift.pl/includes/modules/captcha.php?1270900968" /><br /> <img src="http://www.takeagift.pl/includes/modules/captcha.php?1270900968" /><br /> <?php include('cb.php'); cbreak("http://www.takeagift.pl/includes/modules/captcha.php?1270900968"); ?> Don't look at preg_match i still haven't learned regexp. So as You can see links are same: (captcha.php?1270900968), but the result - not. Help me, please (i'm not doing it to spam this portal)

    Read the article

  • Problem with Json in Jquery

    - by Davidslv
    Hi everyone, I have a small survey, but when i submit it says that the msg is null, i don't see where is my error. If you could help me i apreciate it. Thank you My Form with Jquery and Ajax Function <!DOCTYPE HTML> <hmtl lang="pt-PT"> <head> <title>Formul&aacute;rio</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> </head> <body> <hr /> <h3>Formulario</h3> <script type="text/javascript" charset="utf-8"> $(function () { $('#submiter').click( function() { $.ajax({ type: "POST", url: 'validar.php', dataType: 'json', success: function(msg) { alert('Mensagem '+ msg.mensagem); }, error : function () { alert('Ocorreu um erro'); } }); }); }); </script> <form id="formulario" action="" method="post" accept-charset="utf-8"> <p>Pergunta 1</p> <label for="pergunta1">sim</label><input type="radio" id="p1" name="pergunta1" value="1" /><br /> <label for="pergunta1">n&atilde;o</label><input type="radio" id="p1" name="pergunta1" value="0" /> <br /> <p>Pergunta 2</p> <label for="pergunta2">sim</label><input type="radio" name="pergunta2" value="0" /><br /> <label for="pergunta2">n&atilde;o</label><input type="radio" name="pergunta2" value="1" /> <br /> <p>Pergunta 3</p> <label for="pergunta3">sim</label><input type="radio" name="pergunta3" value="0" /><br /> <label for="pergunta3">n&atilde;o</label><input type="radio" name="pergunta3" value="1" /> <br /> <p>Pergunta 4</p> <label for="pergunta4">sim</label><input type="radio" name="pergunta4" value="0" /><br /> <label for="pergunta4">n&atilde;o</label><input type="radio" name="pergunta4" value="1" /> <br /> <p><input type="submit" id="submiter" value="Continue &rarr;"></p> </form> </body> </html> My PHP <?php if($_POST) { $pergunta1 = $_POST['pergunta1']; $pergunta2 = $_POST['pergunta2']; $pergunta3 = $_POST['pergunta3']; $pergunta4 = $_POST['pergunta4']; $calcular = $pergunta1 + $pergunta2 + $pergunta3 + $pergunta4; $var = array ('mensagem' => $calcular); echo json_encode($var); } else { $var2 = array('mensagem' => 'sem resultado'); echo json_encode($var2); } ?>

    Read the article

  • PHP will not Echo

    - by user2981166
    I've tried to look into why this isn't echoing but every result the persons trying use php on an html page so this is why I'm here asking. I have 3 php files, a login file, a global config file, and a theme file. The login page echo's the login script but it connects to the global file. The global file connects to the theme file and the db config file. The theme file is a simple table. Here's my files <? include('../tools/global.php'); switch($_POST[act]){ case "setlogin": set($login); break; case "refresh": refresh(); break; case "logout": lout(); break; default: login($mes); break; } function login($mes){ if (isset($_COOKIE["user"])){ $out[body]="<br /> <center> <table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#BDBDBD'> <tr bgcolor='##ff80ff'> <td width='100%' valign='center' align='left' colspan='2' background='#BDBDBD'> <strong>Login</strong> </td> </tr> <tr bgcolor='#BDBDBD'> <td width='100%' valign='center' align='left'><center> <b>You are already logged in! Would you like to <a href='http://www.fivedesignguys.com/dir/panel/login.php?act=refresh&type=logout'>Logout?</a></center></td></tr> </table> </center><br /><br /><br /><br />"; }else{ $out[body]=" <br /> <center> <table width='400' border='0' cellspacing='1' bgcolor='#BDBDBD' cellpadding='1'> <form method='post'> <tr bgcolor='$config[altcolor]'> <td background='#BDBDBD' width='100%' valign='center' align='left' colspan='2'> <strong>Login</strong>"; It continues but I know it's going to echo me the first option, Heres the global php file <?php include('../theme/default.php'); include('config.php'); ?> and finally the default.php theme file <table border='0'> <tr> <td colspan='2'> <center>bar</center> </td> </tr> <tr> <td width='10%'> hey<br>hey<br> </td> <td> hello <?php echo $out[body]; ?> </td> </tr> </table> as you can tell I want it to echo $out[body] but it doesn't want to. Yes all the files are PHP but this is where I'm stuck.

    Read the article

  • Need help with PHP web app bootstrapping error potentially related to Zend [migrated]

    - by Matt Shepherd
    I am trying to get a program called OpenFISMA running on an Ubuntu AMI in AWS. The app is not really coded on the Ubuntu platform, but I am in my comfort zone there, and have tried both CentOS and OpenSUSE (both are sort of "native" for the app) for getting it working with the same or worse results. So, why not just get it working on Ubuntu? Anyway, the app is found here: www.openfisma.org and an install guide is found here: https://openfisma.atlassian.net/wiki/display/030100/Installation+Guide The install guide kind of sucks. It doesn't list dependencies in any coherent way or provide much of any detail (does not even mention Zend once on the entire page) so I've done a lot of work to divine the information I do have. This page provided some dependency inf (though again, Zend is not mentioned once): https://openfisma.atlassian.net/wiki/display/PUBLIC/RPM+Management#RPMManagement-BasicOverviewofRPMPackages Anyway, I got all the way through the install (so far as I could reconstruct it). I am going to the login page for the first time, and there should be some sort of bootstrapping occurring when I load the page. (I am not a programmer so I have no idea what it is doing there.) Anyway, I get a message on the web page that says: "An exception occurred while bootstrapping the application." So, then I go look in /var/www/data/logs/php.log and find this message: [22-Oct-2013 17:29:18 UTC] PHP Fatal error: Uncaught exception 'Zend_Exception' with message 'No entry is registered for key 'Zend_Log'' in /var/www/library/Zend/Registry.php:147 Stack trace: #0 /var/www/public/index.php(188): Zend_Registry::get('Zend_Log') #1 {main} thrown in /var/www/library/Zend/Registry.php on line 147 This occurs every time I load the page. I gather there is an issue related to registering the Zend_Log variable in the Zend registry, but other than that I really have no idea what to do about it. Am I missing a package that it needs, or is this app not coded to register the variables properly? I have no clue. Any help is greatly appreciated. The application file referenced in the log message (index.php) is included below. <?php /** * Copyright (c) 2008 Endeavor Systems, Inc. * * This file is part of OpenFISMA. * * OpenFISMA is free software: you can redistribute it and/or modify it under the terms of the GNU General Public * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later * version. * * OpenFISMA is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with OpenFISMA. If not, see * {@link http://www.gnu.org/licenses/}. */ try { defined('APPLICATION_PATH') || define( 'APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application') ); // Define application environment defined('APPLICATION_ENV') || define( 'APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production') ); set_include_path( APPLICATION_PATH . '/../library/Symfony/Components' . PATH_SEPARATOR . APPLICATION_PATH . '/../library' . PATH_SEPARATOR . get_include_path() ); require_once 'Fisma.php'; require_once 'Zend/Application.php'; $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/config/application.ini' ); Fisma::setAppConfig($application->getOptions()); Fisma::initialize(Fisma::RUN_MODE_WEB_APP); $application->bootstrap()->run(); } catch (Zend_Config_Exception $zce) { // A zend config exception indicates that the application may not be installed properly echo '<h1>The application is not installed correctly</h1>'; $zceMsg = $zce->getMessage(); if (stristr($zceMsg, 'parse_ini_file') !== false) { if (stristr($zceMsg, 'application.ini') !== false) { if (stristr($zceMsg, 'No such file or directory') !== false) { echo 'The ' . APPLICATION_PATH . '/config/application.ini file is missing.'; } elseif (stristr($zceMsg, 'Permission denied') !== false) { echo 'The ' . APPLICATION_PATH . '/config/application.ini file does not have the ' . 'appropriate permissions set for the application to read it.'; } else { echo 'An ini-parsing error has occured in ' . APPLICATION_PATH . '/config/application.ini ' . '<br/>Please check this file and make sure everything is setup correctly.'; } } else if (stristr($zceMsg, 'database.ini') !== false) { if (stristr($zceMsg, 'No such file or directory') !== false) { echo 'The ' . APPLICATION_PATH . '/config/database.ini file is missing.<br/>'; echo 'If you find a database.ini.template file in the config directory, edit this file ' . 'appropriately and rename it to database.ini'; } elseif (stristr($zceMsg, 'Permission denied') !== false) { echo 'The ' . APPLICATION_PATH . '/config/database.ini file does not have the appropriate ' . 'permissions set for the application to read it.'; } else { echo 'An ini-parsing error has occured in ' . APPLICATION_PATH . '/config/database.ini ' . '<br/>Please check this file and make sure everything is setup correctly.'; } } else { echo 'An ini-parsing error has occured. <br/>Please check all configuration files and make sure ' . 'everything is setup correctly'; } } elseif (stristr($zceMsg, 'syntax error') !== false) { if (stristr($zceMsg, 'application.ini') !== false) { echo 'There is a syntax error in ' . APPLICATION_PATH . '/config/application.ini ' . '<br/>Please check this file and make sure everything is setup correctly.'; } elseif (stristr($zceMsg, 'database.ini') !== false) { echo 'There is a syntax error in ' . APPLICATION_PATH . '/config/database.ini ' . '<br/>Please check this file and make sure everything is setup correctly.'; } else { echo 'A syntax error has been reached. <br/>Please check all configuration files and make sure ' . 'everything is setup correctly.'; } } else { // Then the exception message says nothing about parse_ini_file nor 'syntax error' echo 'Please check all configuration files, and ensure all settings are valid.'; } echo '<br/>For more information and help on installing OpenFISMA, please refer to the ' . '<a target="_blank" href="http://manual.openfisma.org/display/ADMIN/Installation">' . 'Installation Guide</a>'; } catch (Doctrine_Manager_Exception $dme) { echo '<h1>An exception occurred while bootstrapping the application.</h1>'; // Does database.ini have valid settings? Or is it the same content as database.ini.template? $databaseIniFail = false; $iniData = file(APPLICATION_PATH . '/config/database.ini'); $iniData = str_replace(chr(10), '', $iniData); if (in_array('db.adapter = ##DB_ADAPTER##', $iniData)) { $databaseIniFail = true; } if (in_array('db.host = ##DB_HOST##', $iniData)) { $databaseIniFail = true; } if (in_array('db.port = ##DB_PORT##', $iniData)) { $databaseIniFail = true; } if (in_array('db.username = ##DB_USER##', $iniData)) { $databaseIniFail = true; } if (in_array('db.password = ##DB_PASS##', $iniData)) { $databaseIniFail = true; } if (in_array('db.schema = ##DB_NAME##', $iniData)) { $databaseIniFail = true; } if ($databaseIniFail) { echo 'You have not applied the settings in ' . APPLICATION_PATH . '/config/database.ini appropriately. ' . 'Please review the contents of this file and try again.'; } else { if (Fisma::debug()) { echo '<p>' . get_class($dme) . '</p><p>' . $dme->getMessage() . '</p><p>' . "<p><pre>Stack Trace:\n" . $dme->getTraceAsString() . '</pre></p>'; } else { $logString = get_class($dme) . "\n" . $dme->getMessage() . "\nStack Trace:\n" . $dme->getTraceAsString() . "\n"; Zend_Registry::get('Zend_Log')->err($logString); } } } catch (Exception $exception) { // If a bootstrap exception occurs, that indicates a serious problem, such as a syntax error. // We won't be able to do anything except display an error. echo '<h1>An exception occurred while bootstrapping the application.</h1>'; if (Fisma::debug()) { echo '<p>' . get_class($exception) . '</p><p>' . $exception->getMessage() . '</p><p>' . "<p><pre>Stack Trace:\n" . $exception->getTraceAsString() . '</pre></p>'; } else { $logString = get_class($exception) . "\n" . $exception->getMessage() . "\nStack Trace:\n" . $exception->getTraceAsString() . "\n"; Zend_Registry::get('Zend_Log')->err($logString); } }

    Read the article

  • Using SocialCounter.NET with ASP.NET MVC

    - by DigiMortal
    I found small library called SocialCounter.NET that is able to display some data from popular social sites. Although it is possible to use widgets offered by social networks there are also scenarios when you don’t want or can’t use these JavaScript based widgets. In this posting I will show you how to use SocialCounter.NET. Start with downloading SocialCounter.NET. You can also use NuGet package manager to download SocialCounter.NET. Using SocialCounter.NET is very easy as you can see from this example view: @using SocialCounter.NET; @{      ViewBag.Title = "Home Page"; } <h2>Social</h2> <p>     Twitter followers: @Counter.GetTwitterFollowersCount("gpeipman")<br />     Facebook friends: @Counter.GetFacebookFriendsCount("gpeipman")<br />     Facebook likes: @Counter.GetFacebookLikes("http://www.eindhovenmetalmeeting.nl/")<br />     Delicious saves count: @Counter.GetDeliciousSaveCount("http://youreffectiveleadership.com/")<br /> </p> And the result is shown on image on right. You can use SocialCounter.NET by example on user profile pages and on your content pages where you want to show how many people have saved current page as bookmark. SocialCounter.NET supports also LinkedIn, RSS-feeds and Google Plus accounts. In future – I hope – they will add support for more social networks to their library.

    Read the article

  • Convert uploaded video files to mp4 using PHP [closed]

    - by Subin
    I created a PHP video uploading script. I need to convert these files to mp4 for HTML5 VIDEO PLAYER using PHP while uploading . How can I do that ? Here is the PHP code. <?php if(isset($_POST['submit'])){ $user=$_COOKIE['VisitorName']; include('config.php'); session_start(); $session_id='1'; //$session id $path = "/home/simsu/subins/videos/data/videos/"; $valid_formats = array("wmv", "ogv", "mp4", "3gp", "ogg"); if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") { $name = $_FILES['uploadedfile']['name']; $size = $_FILES['uploadedfile']['size']; if(strlen($name)) { list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats)) { if($size<(100024*100024)) { $actual_image_name = $path.time().".mp4"; $tmp = $_FILES['uploadedfile']['tmp_name']; $upurl="http://vtube.subins.com/files/video?vid=".time(); $title=$_POST['vn']; mysql_query("INSERT INTO videos(title,user,url,vid,ext) VALUES ('$title', '$user','$upurl',NOW(),'$ext')"); echo '<br><h1>'.$_FILES['uploadedfile']['name'] . " uploaded.</h1>"; } else echo "<br><h1>Video file size max 100 MB"; } else echo "<br><h1>Invalid file format.."; } else echo "<br><h1>Please select a video..!"; exit; } } ?>

    Read the article

  • Why is my "Page [0]" not centered in my webpage?

    - by William
    My "Page [0]" text isn't centered on my webpage. Anyone know why? I could really use some help please. Here is the html: <html> <head> <title>Test Forum</title> <link href="http://prime.programming-designs.com/test_forum/style.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="http://prime.programming-designs.com/test_forum/"><img src="http://prime.programming-designs.com/test_forum//images/banner1.png" alt="" id="banner" /></a> <h1>Test Forums</h1> <hr /> <div id="navi"><div id="naviheader">Boards</div><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=0">Testing</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=1">General Discussion</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=2">Video Games</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=3">Anime and Manga</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=4">BlazBlue</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=5">Shin Megami Tensei</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=6">Earthbound</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=7">Phantasy Star</a><br /><a href="http://prime.programming-designs.com/test_forum/viewboard.php?board=8">Mobile Suit Gundam</a><br /></div> <div class="postbox"><h4>CyanPrime</h4><hr />Welcome to the King's Gate BBS!</div>Page: [<a href="http://prime.programming-designs.com/test_forum/index.php?page=0">0</a>] </body> </html> Here is the CSS: @charset "windows-1252"; body{ background-color: #EEFFF8; color: #000000; text-align: center; } .postbox{ text-align: left; margin: auto; background-color: #dbfef8; border: 1px solid #82FFCD; width: 50%; margin-top: 10px; } .stickypostbox{ text-align: left; margin: auto; background-color: #F5FFFA; border: 1px solid #82FFCD; width: 50%; margin-top: 10px; } h4{ margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; color: #9932CC; } h1{ color: #551A8B; } hr{ color: #82FFCD; background-color: #82FFCD; height: 1px; border: 0px dotted #82FFCD; } a{ color: #7F00FF; text-decoration: none; } a:hover{ color: #7F00FF; text-decoration: underline; } form{ margin: 0px auto; width: 50%; } #formdiv { background-color:#dbfef8; border:1px solid #82FFCD; } .fielddiv1{ background-color: #f9f9f9; border: 1px solid #DBFEF8; vertical-align: middle; width: 45%; float: left; } .fielddiv2{ background-color: #f9f9f9; border: 1px solid #DBFEF8; vertical-align: middle; width: 100%; } .fieldtext1{ width: 50%; background-color: #82FFCD; float: left; } .fieldtext2{ width: 100%; background-color: #82FFCD; } #replydiv{ width: 100%; background-color: #DBFEF8; margin: 10px 0 10px 0; } #admindiv{ width: 100%; background-color: #DBFEF8; margin: 10px 0 10px 0; } #navi{ width: 200px; background-color: #dbfef8; border: 1px solid #82FFCD; text-align: left; float: left; } #naviheader{ width: 100%; background-color: #82FFCD; } #submitbutton{ border: 1px solid #82FFCD; background-color: #DBFEF8; color: #000000; margin-top: 5px; width: 100px; height: 20px; } #banner{ border: 1px solid #82FFCD; } .postbar{ margin-right: 0px; margin-top: 0px; } .bannedtext{ margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; color: #FF0000; } And here is the webpage so you can get some context (you'll notice that my "page [0]" is centered on the other boards, but not the index. http://prime.programming-designs.com/test_forum/

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >